From 530c0869c831496670d4f29998df634dd4d1b3c0 Mon Sep 17 00:00:00 2001 From: Landon Date: Sun, 13 Apr 2025 21:19:36 -0400 Subject: [PATCH 01/26] feat(nx-plugin): add nx plugin to generate and update client code --- packages/nx-plugin/LICENSE.md | 21 + packages/nx-plugin/README.md | 58 + packages/nx-plugin/executors.json | 9 + packages/nx-plugin/generators.json | 11 + packages/nx-plugin/package.json | 71 + .../src/executors/update-api/index.spec.ts | 274 + .../src/executors/update-api/index.ts | 258 + .../src/executors/update-api/schema.d.ts | 16 + .../src/executors/update-api/schema.json | 55 + .../src/generators/openapi-client/README.md | 97 + .../openapi-client/files/README.md.template | 36 + .../files/openapi-ts.config.ts.template | 12 + .../files/package.json.template | 8 + .../files/src/index.ts.template | 1 + .../files/tsconfig.json.template | 12 + .../files/tsconfig.lib.json.template | 10 + .../generators/openapi-client/index.spec.ts | 364 + .../src/generators/openapi-client/index.ts | 760 ++ .../plugins/rq/src/rq.ts.template | 1 + .../src/generators/openapi-client/schema.json | 68 + .../tests/vitest/src/client.spec.ts.template | 10 + .../tests/vitest/tsconfig.spec.json.template | 27 + .../tests/vitest/vite.config.ts.template | 21 + packages/nx-plugin/src/index.ts | 4 + packages/nx-plugin/src/test-utils.ts | 78 + packages/nx-plugin/src/utils.spec.ts | 277 + packages/nx-plugin/src/utils.ts | 304 + packages/nx-plugin/src/vars.ts | 10 + packages/nx-plugin/tsconfig.base.json | 14 + packages/nx-plugin/tsconfig.json | 9 + packages/nx-plugin/tsup.config.ts | 23 + packages/nx-plugin/turbo.json | 14 + packages/nx-plugin/vitest.config.ts | 12 + pnpm-lock.yaml | 8332 ++++++++++------- 34 files changed, 7993 insertions(+), 3284 deletions(-) create mode 100644 packages/nx-plugin/LICENSE.md create mode 100644 packages/nx-plugin/README.md create mode 100644 packages/nx-plugin/executors.json create mode 100644 packages/nx-plugin/generators.json create mode 100644 packages/nx-plugin/package.json create mode 100644 packages/nx-plugin/src/executors/update-api/index.spec.ts create mode 100644 packages/nx-plugin/src/executors/update-api/index.ts create mode 100644 packages/nx-plugin/src/executors/update-api/schema.d.ts create mode 100644 packages/nx-plugin/src/executors/update-api/schema.json create mode 100644 packages/nx-plugin/src/generators/openapi-client/README.md create mode 100644 packages/nx-plugin/src/generators/openapi-client/files/README.md.template create mode 100644 packages/nx-plugin/src/generators/openapi-client/files/openapi-ts.config.ts.template create mode 100644 packages/nx-plugin/src/generators/openapi-client/files/package.json.template create mode 100644 packages/nx-plugin/src/generators/openapi-client/files/src/index.ts.template create mode 100644 packages/nx-plugin/src/generators/openapi-client/files/tsconfig.json.template create mode 100644 packages/nx-plugin/src/generators/openapi-client/files/tsconfig.lib.json.template create mode 100644 packages/nx-plugin/src/generators/openapi-client/index.spec.ts create mode 100644 packages/nx-plugin/src/generators/openapi-client/index.ts create mode 100644 packages/nx-plugin/src/generators/openapi-client/plugins/rq/src/rq.ts.template create mode 100644 packages/nx-plugin/src/generators/openapi-client/schema.json create mode 100644 packages/nx-plugin/src/generators/openapi-client/tests/vitest/src/client.spec.ts.template create mode 100644 packages/nx-plugin/src/generators/openapi-client/tests/vitest/tsconfig.spec.json.template create mode 100644 packages/nx-plugin/src/generators/openapi-client/tests/vitest/vite.config.ts.template create mode 100644 packages/nx-plugin/src/index.ts create mode 100644 packages/nx-plugin/src/test-utils.ts create mode 100644 packages/nx-plugin/src/utils.spec.ts create mode 100644 packages/nx-plugin/src/utils.ts create mode 100644 packages/nx-plugin/src/vars.ts create mode 100644 packages/nx-plugin/tsconfig.base.json create mode 100644 packages/nx-plugin/tsconfig.json create mode 100644 packages/nx-plugin/tsup.config.ts create mode 100644 packages/nx-plugin/turbo.json create mode 100644 packages/nx-plugin/vitest.config.ts diff --git a/packages/nx-plugin/LICENSE.md b/packages/nx-plugin/LICENSE.md new file mode 100644 index 000000000..6acd8004b --- /dev/null +++ b/packages/nx-plugin/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Hey API + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/nx-plugin/README.md b/packages/nx-plugin/README.md new file mode 100644 index 000000000..2edd5d60f --- /dev/null +++ b/packages/nx-plugin/README.md @@ -0,0 +1,58 @@ +# @hey-api/nx-plugin + +This plugin provides a generator and executor for generating and updating OpenAPI clients using the `@hey-api/openapi-ts` library. This can be tied in to automation and CI workflows to ensure your API clients are always up to date. + +## Installation + +```bash +npm install -D @hey-api/plugin-nx +``` + +## Usage + +### Generators + +#### openapi-client + +[Docs](src/generators/openapi-client/README.md) + +This plugin provides a generator for generating OpenAPI clients using the `@hey-api/openapi-ts` library. + +Run in interactive mode `nx g @hey-api/nx-plugin:openapi-client` + +##### Options + +- `name`: The name of the project. [ string ] (required) +- `scope`: The scope of the project. [ string ] (required) +- `spec`: The path to the OpenAPI spec file. [ URI or string ] (required) +- `directory`: The directory to create the project in. [ string ] (optional) (default: `libs`) +- `client`: The type of client to generate. [ string ] (optional) (default: `@hey-api/client-fetch`) + To specify a specific version of the client you can use `@hey-api/client-fetch@1.x.x`. +- `tags`: The tags to add to the project. [ string[] ] (optional) (default: `api,openapi`) + The defaults tags will not be added to the project if you specify this option. +- `plugins`: Additional plugins to provide to the client api. [ string[] ] (optional) +- `test`: The type of tests to setup. [ 'none' | 'vitest' ] (optional) (default: `none`) + +##### Example + +```bash +nx g @hey-api/nx-plugin:openapi-client --name=my-api --client=@hey-api/client-fetch --scope=@my-app --directory=libs --spec=./spec.yaml --tags=api,openapi +``` + +### Executors + +#### update-api + +This executor updates the OpenAPI spec file and generates a new client. +The options for the executor will be populated from the generator. + +Run `nx run @my-org/my-generated-package:updateApi` + +##### Options + +- `spec`: The path to the OpenAPI spec file. [ URI or string ] (required) +- `name`: The name of the project. [ string ] (required) +- `scope`: The scope of the project. [ string ] (required) +- `client`: The type of client to generate. [ string ] (optional) (default: `@hey-api/client-fetch`) +- `directory`: The directory to create the project in. [ string ] (optional) (default: `libs`) +- `plugins`: Additional plugins to provide to the client api. [ string[] ] (optional) (default:[]) diff --git a/packages/nx-plugin/executors.json b/packages/nx-plugin/executors.json new file mode 100644 index 000000000..0a4cee281 --- /dev/null +++ b/packages/nx-plugin/executors.json @@ -0,0 +1,9 @@ +{ + "executors": { + "update-api": { + "implementation": "./dist/executors/update-api/index.js", + "schema": "./dist/executors/update-api/schema.json", + "description": "Updates the OpenAPI spec file and generates new client code if needed." + } + } +} diff --git a/packages/nx-plugin/generators.json b/packages/nx-plugin/generators.json new file mode 100644 index 000000000..bb30bb37c --- /dev/null +++ b/packages/nx-plugin/generators.json @@ -0,0 +1,11 @@ +{ + "name": "openapi-generator", + "version": "0.0.1", + "generators": { + "openapi-client": { + "factory": "./dist/generators/openapi-client/index.js", + "schema": "./dist/generators/openapi-client/schema.json", + "description": "Generate an OpenAPI client library from an OpenAPI spec file." + } + } +} diff --git a/packages/nx-plugin/package.json b/packages/nx-plugin/package.json new file mode 100644 index 000000000..021735d5b --- /dev/null +++ b/packages/nx-plugin/package.json @@ -0,0 +1,71 @@ +{ + "name": "@hey-api/nx-plugin", + "version": "0.0.1", + "description": "🚀 Nx plugin for `@hey-api/openapi-ts` codegen.", + "homepage": "https://heyapi.dev/", + "repository": { + "type": "git", + "url": "git+https://github.com/hey-api/openapi-ts.git", + "directory": "packages/nx-plugin" + }, + "bugs": { + "url": "https://github.com/hey-api/openapi-ts/issues" + }, + "license": "MIT", + "author": { + "email": "lubos@heyapi.dev", + "name": "Hey API", + "url": "https://heyapi.dev" + }, + "funding": "https://github.com/sponsors/hey-api", + "keywords": [ + "codegen", + "openapi", + "plugin", + "nx", + "swagger" + ], + "type": "commonjs", + "main": "./dist/index.js", + "module": "./dist/index.js", + "types": "./dist/index.d.ts", + "scripts": { + "build": "tsup && pnpm check-exports", + "check-exports": "attw --pack .", + "test:watch": "vitest watch --config vitest.config.ts", + "test": "vitest run --config vitest.config.ts", + "typecheck": "tsc --noEmit", + "prepublishOnly": "pnpm build" + }, + "exports": { + "./package.json": "./package.json", + ".": { + "development": "./src/index.ts", + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "default": "./dist/index.js" + } + }, + "executors": "./executors.json", + "generators": "./generators.json", + "dependencies": { + "@hey-api/json-schema-ref-parser": "1.0.4", + "@hey-api/openapi-ts": "workspace:*", + "@nx/devkit": "20.7.2", + "latest-version": "9.0.0", + "openapi-diff": "0.23.7", + "tslib": "2.8.1", + "xcurl": "2.1.2" + }, + "devDependencies": { + "@config/vite-base": "workspace:*", + "typescript": "5.8.3", + "vitest": "3.1.1" + }, + "files": [ + "dist", + "LICENSE.md", + "generators.json", + "executors.json" + ] +} diff --git a/packages/nx-plugin/src/executors/update-api/index.spec.ts b/packages/nx-plugin/src/executors/update-api/index.spec.ts new file mode 100644 index 000000000..f99251a60 --- /dev/null +++ b/packages/nx-plugin/src/executors/update-api/index.spec.ts @@ -0,0 +1,274 @@ +import { existsSync } from 'node:fs'; +import { mkdir, readFile, rm, writeFile } from 'node:fs/promises'; +import { join } from 'node:path'; + +import type { initConfigs } from '@hey-api/openapi-ts/internal'; +import { type ExecutorContext, logger } from '@nx/devkit'; +import { randomUUID } from 'crypto'; +import { afterAll, describe, expect, it, vi } from 'vitest'; + +import generator from '../../generators/openapi-client'; +import { getGeneratorOptions, TestOptions } from '../../test-utils'; +import { CONSTANTS } from '../../vars'; +import executor from '.'; +import type { UpdateApiExecutorSchema } from './schema'; + +vi.mock('@hey-api/openapi-ts/internal', async (importOriginal) => { + const actual = + await importOriginal(); + return { + ...actual, + initConfigs: vi.fn((config: Parameters[0]) => + Promise.resolve([ + { + input: config?.input ?? 'default-input', + output: config?.output ?? 'default-output', + plugins: config?.plugins ?? [], + }, + ]), + ), + }; +}); + +vi.mock('latest-version', () => ({ + default: vi.fn(() => '1.0.0'), +})); + +const tempDirectory = `temp-update-api-${randomUUID()}`; + +const defaultOptions: UpdateApiExecutorSchema = { + client: TestOptions.client, + // don't use tmp, as it is used internally in the lib code for temp files + directory: tempDirectory, + name: TestOptions.name, + plugins: [], + scope: TestOptions.scope, + spec: '', + tempFolder: tempDirectory, +}; + +const testSpecName = 'spec.yaml'; + +const getExecutorOptions = async (name: string) => { + const projectDir = join(defaultOptions.directory, name); + const apiDir = join(projectDir, 'api'); + // Create the API directory and spec file + const absoluteApiDir = join(process.cwd(), apiDir); + if (!existsSync(absoluteApiDir)) { + await mkdir(absoluteApiDir, { recursive: true }); + } + const specPath = join(apiDir, testSpecName); + const absoluteSpecPath = join(process.cwd(), specPath); + const validSpec = ` +openapi: 3.0.0 +info: + title: Test API + version: 1.0.0 +paths: + /test: + get: + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + message: + type: string +`; + logger.debug(`Writing executor spec to ${absoluteSpecPath}`); + await writeFile(absoluteSpecPath, validSpec); + + const context: ExecutorContext = { + cwd: process.cwd(), + isVerbose: false, + nxJsonConfiguration: {}, + projectGraph: { + dependencies: {}, + nodes: {}, + }, + projectsConfigurations: { + projects: { + [TestOptions.name]: { + root: projectDir, + targets: {}, + }, + }, + version: 2, + }, + root: '', + }; + + return { + context, + options: { + ...defaultOptions, + directory: tempDirectory, + name, + spec: specPath, + }, + }; +}; + +describe('UpdateApi Executor', () => { + afterAll(async () => { + const apiDir = join(process.cwd(), tempDirectory); + if (existsSync(apiDir)) { + await rm(apiDir, { force: true, recursive: true }); + } + vi.resetAllMocks(); + }); + + it('can run', async () => { + const { context, options } = await getExecutorOptions( + defaultOptions.name + `-${randomUUID()}`, + ); + const output = await executor(options, context); + expect(output.success).toBe(true); + }); + + it('handles invalid spec file', async () => { + const { context, options } = await getExecutorOptions( + defaultOptions.name + `-${randomUUID()}`, + ); + const invalidSpecPath = join( + process.cwd(), + options.directory, + options.name, + 'api', + 'invalid.yaml', + ); + await mkdir(join(process.cwd(), options.directory, options.name, 'api'), { + recursive: true, + }); + await writeFile(invalidSpecPath, 'invalid: yaml'); + options.spec = invalidSpecPath; + + const output = await executor(options, context); + expect(output.success).toBe(false); + }); + + it('handles non-existent spec file', async () => { + const { context, options } = await getExecutorOptions( + defaultOptions.name + `-${randomUUID()}`, + ); + options.spec = 'non-existent.yaml'; + const output = await executor(options, context); + expect(output.success).toBe(false); + }); + + it('handles different client types', async () => { + const { context, options } = await getExecutorOptions( + defaultOptions.name + `-${randomUUID()}`, + ); + options.client = '@hey-api/client-axios'; + const output = await executor(options, context); + expect(output.success).toBe(true); + }); + + it('handles plugins', async () => { + const { context, options } = await getExecutorOptions( + defaultOptions.name + `-${randomUUID()}`, + ); + options.plugins = ['@tanstack/react-query']; + const output = await executor(options, context); + expect(output.success).toBe(true); + }); + + it('handles identical specs', async () => { + const { context, options } = await getExecutorOptions( + defaultOptions.name + `-${randomUUID()}`, + ); + // Create a copy of the existing spec + const existingSpecPath = join( + process.cwd(), + options.tempFolder ?? '', + options.name, + CONSTANTS.SPEC_DIR_NAME, + testSpecName, + ); + const newSpecPath = join( + process.cwd(), + options.tempFolder ?? '', + options.name, + CONSTANTS.SPEC_DIR_NAME, + 'new-spec.yaml', + ); + const existingSpec = await readFile(existingSpecPath, 'utf-8'); + await mkdir( + join( + process.cwd(), + options.directory, + options.name, + CONSTANTS.SPEC_DIR_NAME, + ), + { + recursive: true, + }, + ); + await writeFile(newSpecPath, existingSpec); + options.spec = newSpecPath; + + const output = await executor(options, context); + expect(output.success).toBe(true); + }); + + it('handles different spec versions', async () => { + const { + options: generatorOptions, + specPath, + tree, + } = await getGeneratorOptions({ + name: defaultOptions.name + `-${randomUUID()}`, + tempDirectory, + }); + const { context, options } = await getExecutorOptions( + generatorOptions.name, + ); + + // Update the executor spec path to the spec path from the generator + options.spec = specPath; + + const absoluteApiDir = join( + process.cwd(), + options.tempFolder ?? '', + options.name, + CONSTANTS.SPEC_DIR_NAME, + ); + const v2SpecPath = join(process.cwd(), specPath); + const v2Spec = ` +swagger: "2.0" +info: + title: Test API + version: 1.0.0 +paths: + /test2: + get: + responses: + '200': + description: OK + schema: + type: object + properties: + message: + type: string +`; + await generator(tree, generatorOptions); + + await mkdir(absoluteApiDir, { + recursive: true, + }); + if (existsSync(v2SpecPath)) { + logger.debug(`Spec file already exists: ${v2SpecPath}`); + await writeFile(v2SpecPath, v2Spec); + } else { + logger.error(`Spec file does not exist: ${v2SpecPath}`); + throw new Error(`Spec file does not exist: ${v2SpecPath}`); + } + + const output = await executor(options, context); + expect(output.success).toBe(true); + }); +}); diff --git a/packages/nx-plugin/src/executors/update-api/index.ts b/packages/nx-plugin/src/executors/update-api/index.ts new file mode 100644 index 000000000..e694645a5 --- /dev/null +++ b/packages/nx-plugin/src/executors/update-api/index.ts @@ -0,0 +1,258 @@ +import { existsSync, writeFileSync } from 'node:fs'; +import { cp, mkdir, readFile, rm } from 'node:fs/promises'; +import { join } from 'node:path'; + +import type { PromiseExecutor } from '@nx/devkit'; +import { logger } from '@nx/devkit'; + +import { + bundleAndDereferenceSpecFile, + compareSpecs, + generateClientCode, +} from '../../utils'; +import { CONSTANTS } from '../../vars'; +import type { UpdateApiExecutorSchema } from './schema'; + +async function setup({ + absoluteTempFolder, + options, + tempFolder, +}: { + absoluteTempFolder: string; + options: UpdateApiExecutorSchema; + tempFolder: string; +}) { + logger.debug( + `Setting up update-api executor with options: ${JSON.stringify(options, null, 2)}`, + ); + logger.debug(`Using temp folder: ${tempFolder}`); + logger.debug(`Absolute temp folder path: ${absoluteTempFolder}`); + + const tempApiFolder = join(tempFolder, CONSTANTS.SPEC_DIR_NAME); + logger.debug(`Temp API folder path: ${tempApiFolder}`); + + // Create temp folders if they don't exist + const absoluteTempApiFolder = join( + absoluteTempFolder, + CONSTANTS.SPEC_DIR_NAME, + ); + logger.debug(`Absolute temp API folder path: ${absoluteTempApiFolder}`); + + if (!existsSync(absoluteTempApiFolder)) { + logger.debug(`Creating executor temp api folder: ${absoluteTempApiFolder}`); + await mkdir(absoluteTempApiFolder, { recursive: true }); + logger.debug(`Created temp API folder: ${absoluteTempApiFolder}`); + } else { + logger.debug(`Temp API folder already exists: ${absoluteTempApiFolder}`); + } + logger.debug('Temp folders created.'); + + // Determine file paths + const projectRoot = join(options.directory, options.name); + logger.debug(`Project root path: ${projectRoot}`); + + const apiDirectory = join(projectRoot, CONSTANTS.SPEC_DIR_NAME); + logger.debug(`API directory path: ${apiDirectory}`); + + const existingSpecPath = join(apiDirectory, CONSTANTS.SPEC_FILE_NAME); + logger.debug(`Existing spec file path: ${existingSpecPath}`); + + const tempSpecPath = join(tempApiFolder, CONSTANTS.SPEC_FILE_NAME); + logger.debug(`Temp spec file path: ${tempSpecPath}`); + + const generatedTempDir = join(tempFolder, CONSTANTS.GENERATED_DIR_NAME); + logger.debug(`Generated temp directory path: ${generatedTempDir}`); + + // Check if existing spec exists + const absoluteExistingSpecPath = join(process.cwd(), existingSpecPath); + logger.debug(`Absolute existing spec path: ${absoluteExistingSpecPath}`); + + if (!existsSync(absoluteExistingSpecPath)) { + logger.error(`No existing spec file found at ${existingSpecPath}.`); + throw new Error(`No existing spec file found at ${existingSpecPath}.`); + } else { + logger.debug(`Existing spec file found at ${absoluteExistingSpecPath}`); + } + + logger.info(`Bundling and dereferencing spec file from: ${options.spec}`); + const dereferencedSpec = await bundleAndDereferenceSpecFile({ + client: options.client, + outputPath: tempSpecPath, + plugins: options.plugins, + specPath: options.spec, + }); + logger.info(`Spec file bundled successfully`); + + // save the dereferenced spec to the temp spec file + try { + logger.debug(`Writing dereferenced spec to temp file: ${tempSpecPath}`); + writeFileSync(tempSpecPath, JSON.stringify(dereferencedSpec, null, 2)); + logger.debug(`Dereferenced spec written to temp file successfully`); + } catch (error) { + logger.error(`Failed to write dereferenced spec to temp file: ${error}.`); + throw error; + } + + logger.info('Reading existing and new spec files...'); + const absoluteTempSpecPath = join(process.cwd(), tempSpecPath); + logger.debug(`Absolute temp spec path: ${absoluteTempSpecPath}`); + + logger.debug(`Reading new spec file from: ${absoluteTempSpecPath}`); + const newSpecString = await readFile(absoluteTempSpecPath, 'utf-8'); + logger.debug( + `New spec file read successfully, size: ${newSpecString.length} bytes`, + ); + + if (!newSpecString) { + logger.error('New spec file is empty.'); + throw new Error('New spec file is empty.'); + } + + logger.debug( + `Comparing specs: ${absoluteExistingSpecPath} and ${absoluteTempSpecPath}`, + ); + + return { + absoluteExistingSpecPath, + absoluteTempSpecPath, + apiDirectory, + generatedTempDir, + newSpecString, + projectRoot, + tempSpecPath, + }; +} + +const runExecutor: PromiseExecutor = async ( + options, + // this is added to stop the CI from complaining about not using the context and to stop the linter from complaining + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _context, +) => { + const tempFolder = options.tempFolder ?? CONSTANTS.TMP_DIR_NAME; + const absoluteTempFolder = join(process.cwd(), tempFolder); + const force = options.force ?? false; + + try { + logger.info(`Setting up executor environment...`); + const { + absoluteExistingSpecPath, + absoluteTempSpecPath, + apiDirectory, + generatedTempDir, + newSpecString, + projectRoot, + tempSpecPath, + } = await setup({ + absoluteTempFolder, + options, + tempFolder, + }); + + logger.info(`Comparing existing spec with new spec...`); + const areSpecsEqual = await compareSpecs( + absoluteExistingSpecPath, + absoluteTempSpecPath, + ); + + // If specs are equal, we don't need to generate new client code and we can return unless the force flag is true + if (areSpecsEqual) { + logger.info('No changes detected in the API spec.'); + if (!force) { + logger.info('Force flag is false. Skipping client code generation.'); + await cleanup(absoluteTempFolder); + return { success: true }; + } else { + logger.info('Force flag is true. Generating new client code...'); + } + } else { + logger.info( + 'Changes detected in API spec. Generating new client code...', + ); + } + // If specs are not equal, we need to generate new client code + // Generate new client code in temp directory + // Create temp generated directory + const absoluteGeneratedTempDir = join(process.cwd(), generatedTempDir); + + if (!existsSync(absoluteGeneratedTempDir)) { + await mkdir(absoluteGeneratedTempDir); + } + + // Generate new client code + await generateClientCode({ + clientType: options.client, + outputPath: generatedTempDir, + plugins: options.plugins, + specFile: tempSpecPath, + }); + + // After successful generation, update the files + logger.info('Updating existing spec and client files...'); + + const absoluteApiDirectory = join(process.cwd(), apiDirectory); + const apiDirectoryExists = existsSync(absoluteApiDirectory); + const existingSpecFileExists = existsSync(absoluteExistingSpecPath); + + // Copy new spec to project + if (apiDirectoryExists) { + if (existingSpecFileExists) { + logger.debug('Existing spec file found. Updating...'); + } else { + logger.debug('No existing spec file found. Creating...'); + } + writeFileSync(absoluteExistingSpecPath, newSpecString); + logger.debug(`Spec file updated successfully`); + } else { + logger.error( + `No API directory found at ${apiDirectory} after checking once, exiting.`, + ); + throw new Error( + `No API directory found at ${apiDirectory} after checking once, exiting.`, + ); + } + + const projectGeneratedDir = join( + projectRoot, + 'src', + CONSTANTS.GENERATED_DIR_NAME, + ); + + const absoluteProjectGeneratedDir = join( + process.cwd(), + projectGeneratedDir, + ); + + // Remove old generated directory if it exists + if (existsSync(absoluteProjectGeneratedDir)) { + await rm(absoluteProjectGeneratedDir, { + force: true, + recursive: true, + }); + } + + // Copy new generated directory + await cp(absoluteGeneratedTempDir, absoluteProjectGeneratedDir, { + recursive: true, + }); + + logger.info('Successfully updated API client and spec files.'); + await cleanup(absoluteTempFolder); + return { success: true }; + } catch (error) { + const errorMessage = error instanceof Error ? error.message : String(error); + logger.debug(`Error details: ${errorMessage}.`); + await cleanup(absoluteTempFolder); + return { success: false }; + } +}; + +async function cleanup(tempFolder: string) { + const absoluteTempFolder = join(process.cwd(), tempFolder); + + if (existsSync(absoluteTempFolder)) { + await rm(absoluteTempFolder, { force: true, recursive: true }); + } +} + +export default runExecutor; diff --git a/packages/nx-plugin/src/executors/update-api/schema.d.ts b/packages/nx-plugin/src/executors/update-api/schema.d.ts new file mode 100644 index 000000000..ebf72493a --- /dev/null +++ b/packages/nx-plugin/src/executors/update-api/schema.d.ts @@ -0,0 +1,16 @@ +export interface UpdateApiExecutorSchema { + client: string; + directory: string; + /** + * If true, the Client code will be regenerated even if the spec has not changed + */ + force?: boolean; + name: string; + plugins: string[]; + scope: string; + spec: string; + /** + * Temporary folder used to store files, only change for testing + */ + tempFolder?: string; +} diff --git a/packages/nx-plugin/src/executors/update-api/schema.json b/packages/nx-plugin/src/executors/update-api/schema.json new file mode 100644 index 000000000..170133555 --- /dev/null +++ b/packages/nx-plugin/src/executors/update-api/schema.json @@ -0,0 +1,55 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "version": 2, + "title": "UpdateApi executor", + "description": "Update the OpenAPI spec file and client", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the project", + "x-prompt": "What is the name of the project? (e.g. my-api)", + "$default": { + "$source": "argv", + "index": 0 + } + }, + "spec": { + "type": "string", + "description": "The path to the OpenAPI spec file", + "x-prompt": "What is the path to the OpenAPI spec file? (URI or local file path)" + }, + "client": { + "type": "string", + "description": "The type of client to generate", + "x-prompt": "What is the type of client to generate? (@hey-api/client-fetch, @hey-api/client-axios)", + "default": "@hey-api/client-fetch" + }, + "scope": { + "type": "string", + "description": "The scope of the project", + "x-prompt": "What is the scope of the project? (e.g. @my-org)" + }, + "directory": { + "type": "string", + "description": "The directory of the project", + "x-prompt": "What is the directory of the project? (e.g. libs)", + "default": "libs" + }, + "plugins": { + "type": "array", + "description": "The plugins to use", + "x-prompt": "What plugins would you like to use? (e.g. @tanstack/react-query)", + "default": [], + "items": { + "type": "string" + } + }, + "force": { + "type": "boolean", + "description": "If true, the Client code will be regenerated even if the spec has not changed", + "default": false + } + }, + "required": ["spec", "scope", "name"] +} diff --git a/packages/nx-plugin/src/generators/openapi-client/README.md b/packages/nx-plugin/src/generators/openapi-client/README.md new file mode 100644 index 000000000..7599b6abe --- /dev/null +++ b/packages/nx-plugin/src/generators/openapi-client/README.md @@ -0,0 +1,97 @@ +# OpenAPI Client Generator + +This NX generator creates a new library project from an OpenAPI specification file. It uses the `@hey-api/openapi-ts` package to generate TypeScript clients, SDKs, and types from the OpenAPI spec. + +## Usage + +```bash +# Using nx directly +nx generate @hey-api/nx-plugin:openapi-client --spec= --client= --scope= + +# Interactive mode +nx generate @hey-api/nx-plugin:openapi-client +``` + +## Options + +| Option | Description | Required | Default | Type | +| ----------- | ------------------------------------------------- | -------- | ----------------------- | ------------------ | +| `name` | Library name | Yes | - | string | +| `scope` | Scope of the project | Yes | - | string | +| `spec` | Path to the OpenAPI spec file (URL or local path) | Yes | - | string | +| `client` | Type of client to generate | No | `@hey-api/client-fetch` | string | +| `directory` | Directory where the library will be created | No | `libs` | string | +| `tags` | Add tags to the library (comma-separated) | No | `api,openapi` | string[] | +| `plugins` | Additional plugins for client | No | [] | string[] | +| `test` | Tests to generate | No | `none` | 'none' or 'vitest' | +| `private` | Whether to make the generated package private | No | `true` | boolean | + +## Examples + +```bash +# Generate a fetch API client +nx generate @hey-api/nx-plugin:openapi-client my-api --spec=https://example.com/api-spec.yaml --client=@hey-api/client-fetch + +# Generate an axios client from a local file +nx generate @hey-api/nx-plugin:openapi-client my-api --spec=./api-specs/my-api.yaml --client=@hey-api/client-axios + +# Generate with custom directory and tags +nx generate @hey-api/nx-plugin:openapi-client my-api --spec=./api-specs/my-api.yaml --directory=libs/api --tags=api,openapi,my-service + +# Generates with test files +nx generate @hey-api/nx-plugin:openapi-client my-api --spec=./api-specs/my-api.yaml --directory=libs/api --test=vitest +``` + +## Generated Project Structure + +The generator creates a new library project with the following structure: + +``` +libs// +├── api/ +│ └── spec.yaml # Bundled and dereferenced OpenAPI spec file +├── src/ +│ ├── generated/ # Generated API client code (not committed to git) +| ├── client.spec.ts # Unit test for the client code +│ ├── index.ts # Exports everything from generated/ +| └── rq.ts # Exports tanstack query client code (if @tanstack/react-query is in the plugins array) +├── package.json +├── vitest.config.ts # Vitest configuration (if test is set to 'vitest') +├── README.md +├── project.json # NX project configuration +├── tsconfig.json # root config +├── tsconfig.lib.json # library config +├── tsconfig.spec.json # test config (if test is set to a value other than none) +└── openapi-ts.config.ts # Configuration for @hey-api/openapi-ts +``` + +## Generating the API Client + +After the project is created, you can regenerate the API client at any time: + +```bash +# Using nx +nx run /:updateApi + +# Using npm script (from the project root) +npm run update +``` + +## Dependencies + +The generator adds the following dependencies to the created project: + +- `@hey-api/openapi-ts` - For generating the client code (dev dependency) +- `@hey-api/client-fetch` or `@hey-api/client-axios` or whichever client is provided - Client implementation (dependency) +- `axios` - If using the axios client (dependency) + +## TODO + +- [x] Generate the client code +- [x] Setup tests for generated code +- [x] Add generator to update the API spec file and regenerate the client code +- [x] Make plugins configurable and ability to add additional plugins +- [x] Support additional client types +- [x] Dogfood the spec bundling and dereferencing +- [ ] Support different test frameworks +- [ ] Add linting generation for diff --git a/packages/nx-plugin/src/generators/openapi-client/files/README.md.template b/packages/nx-plugin/src/generators/openapi-client/files/README.md.template new file mode 100644 index 000000000..eec4f90ec --- /dev/null +++ b/packages/nx-plugin/src/generators/openapi-client/files/README.md.template @@ -0,0 +1,36 @@ +# <%= projectName %> - OpenAPI Client + +This library was generated with [NX](https://nx.dev) using the OpenAPI client generator. + +## Usage + +This package provides a TypeScript client for interacting with the API described by the OpenAPI spec in the `api/` directory. + +### Usage with <%= clientType %> + +```typescript +import { client, myEndpointCall } from '<%= projectScope %>/<%= projectName %>'; + +// set the client instance +client.setConfig({ + baseUrl: 'https://example.com' +}); + +// Example API call +async function getData() { + const result = await myEndpointCall(); + console.log(result); +} +``` + +## Regenerating the API Client + +If the API specification changes, you can regenerate the client: + +```bash +# From the project root +nx run <%= projectScope %>/<%= projectName %>:updateApi + +## Force the client to rebuild +nx run <%= projectScope %>/<%= projectName %>:updateApi --force --skip-nx-cache +``` diff --git a/packages/nx-plugin/src/generators/openapi-client/files/openapi-ts.config.ts.template b/packages/nx-plugin/src/generators/openapi-client/files/openapi-ts.config.ts.template new file mode 100644 index 000000000..2e0659877 --- /dev/null +++ b/packages/nx-plugin/src/generators/openapi-client/files/openapi-ts.config.ts.template @@ -0,0 +1,12 @@ +import { defineConfig } from '@hey-api/openapi-ts'; + +export default defineConfig({ + input: '<%= SPEC_DIR_NAME %>/<%= SPEC_FILE_NAME %>', + output: 'src/<%= GENERATED_DIR_NAME %>', + plugins: [ + '<%= clientType %>', + <% for(let x = 0; x < plugins.length; x++) { %> + '<%= plugins[x] %>' + <% } %> + ], +}); diff --git a/packages/nx-plugin/src/generators/openapi-client/files/package.json.template b/packages/nx-plugin/src/generators/openapi-client/files/package.json.template new file mode 100644 index 000000000..6c6e0972f --- /dev/null +++ b/packages/nx-plugin/src/generators/openapi-client/files/package.json.template @@ -0,0 +1,8 @@ +{ + "name": "<%= projectScope %>/<%= projectName %>", + "version": "0.1.0", + "type": "commonjs", + "scripts": { + "update": "nx run <%= projectScope %>/<%= projectName %>:updateApi" + } +} diff --git a/packages/nx-plugin/src/generators/openapi-client/files/src/index.ts.template b/packages/nx-plugin/src/generators/openapi-client/files/src/index.ts.template new file mode 100644 index 000000000..69e4e4eb8 --- /dev/null +++ b/packages/nx-plugin/src/generators/openapi-client/files/src/index.ts.template @@ -0,0 +1 @@ +export * from './generated'; diff --git a/packages/nx-plugin/src/generators/openapi-client/files/tsconfig.json.template b/packages/nx-plugin/src/generators/openapi-client/files/tsconfig.json.template new file mode 100644 index 000000000..a76ba77c5 --- /dev/null +++ b/packages/nx-plugin/src/generators/openapi-client/files/tsconfig.json.template @@ -0,0 +1,12 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + } + ] +} diff --git a/packages/nx-plugin/src/generators/openapi-client/files/tsconfig.lib.json.template b/packages/nx-plugin/src/generators/openapi-client/files/tsconfig.lib.json.template new file mode 100644 index 000000000..faa09cc18 --- /dev/null +++ b/packages/nx-plugin/src/generators/openapi-client/files/tsconfig.lib.json.template @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": ["node"] + }, + "include": ["src/**/*.ts"], + "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"] +} diff --git a/packages/nx-plugin/src/generators/openapi-client/index.spec.ts b/packages/nx-plugin/src/generators/openapi-client/index.spec.ts new file mode 100644 index 000000000..e54195dc2 --- /dev/null +++ b/packages/nx-plugin/src/generators/openapi-client/index.spec.ts @@ -0,0 +1,364 @@ +import { randomUUID } from 'node:crypto'; +import { existsSync, mkdirSync, rmSync } from 'node:fs'; +import { join } from 'node:path'; + +import type { initConfigs } from '@hey-api/openapi-ts/internal'; +import { readJson } from '@nx/devkit'; +import { afterAll, beforeEach, describe, expect, it, vi } from 'vitest'; + +import { getGeneratorOptions } from '../../test-utils'; +import { generateClientCode } from '../../utils'; +import generator, { updateTsConfig } from './index'; +import { + generateApi, + generateNxProject, + normalizeOptions, + updatePackageJson, +} from './index'; + +vi.mock('@hey-api/openapi-ts', async (importOriginal) => { + const actual = await importOriginal(); + return { + ...actual, + createClient: vi.fn(), + }; +}); + +vi.mock('@hey-api/openapi-ts/internal', async (importOriginal) => { + const actual = + await importOriginal(); + return { + ...actual, + initConfigs: vi.fn((config: Parameters[0]) => + Promise.resolve([ + { + input: config?.input ?? 'default-input', + output: config?.output ?? 'default-output', + plugins: config?.plugins ?? [], + }, + ]), + ), + }; +}); + +vi.mock('latest-version', () => ({ + default: vi.fn(() => '1.0.0'), +})); + +const tempDirectory = `temp-openapi-client-${randomUUID()}`; + +describe('openapi-client generator', () => { + beforeEach(() => { + // Clear mocks + vi.clearAllMocks(); + }); + + afterAll(() => { + try { + const tempDir = join(process.cwd(), tempDirectory); + if (existsSync(tempDir)) { + rmSync(tempDir, { force: true, recursive: true }); + } + } catch (error) { + console.error(error); + } + + vi.resetAllMocks(); + }); + + describe('normalizeOptions', () => { + it('should normalize options with default values', async () => { + const uuid = randomUUID(); + const { options, specPath } = await getGeneratorOptions({ + name: `test-api-${uuid}`, + tempDirectory, + }); + const normalized = normalizeOptions(options); + + expect(normalized).toEqual({ + clientType: '@hey-api/client-fetch', + isPrivate: true, + plugins: [], + projectDirectory: `${tempDirectory}/test-api-${uuid}`, + projectName: 'test-api', + projectRoot: `${tempDirectory}/test-api-${uuid}/test-api`, + projectScope: '@test-api', + specFile: specPath, + tagArray: ['api', 'openapi'], + tempFolder: options.tempFolderDir, + test: 'none', + }); + }); + + it('should normalize options with custom directory and tags', async () => { + const { options, specPath } = await getGeneratorOptions({ + name: `test-api-${randomUUID()}`, + tempDirectory, + }); + + const customOptions = { + ...options, + directory: 'custom-dir', + tags: ['custom', 'tags'], + }; + + const normalized = normalizeOptions(customOptions); + + expect(normalized).toEqual({ + clientType: '@hey-api/client-fetch', + isPrivate: true, + plugins: [], + projectDirectory: 'custom-dir', + projectName: 'test-api', + projectRoot: 'custom-dir/test-api', + projectScope: '@test-api', + specFile: specPath, + tagArray: ['custom', 'tags'], + tempFolder: options.tempFolderDir, + test: 'none', + }); + }); + }); + + describe('generateNxProject', () => { + it('should generate project configuration', async () => { + const { options, tree } = await getGeneratorOptions({ + name: `test-api-${randomUUID()}`, + tempDirectory, + }); + const normalizedOptions = normalizeOptions(options); + + generateNxProject({ clientPlugins: {}, normalizedOptions, tree }); + + const config = readJson( + tree, + `${normalizedOptions.projectRoot}/project.json`, + ); + expect(config).toBeDefined(); + expect(config.projectType).toBe('library'); + expect(config.targets.build).toBeDefined(); + expect(config.targets.generateApi).toBeDefined(); + }); + + it('should generate project files', async () => { + const { options, tree } = await getGeneratorOptions({ + name: `test-api-${randomUUID()}`, + tempDirectory, + }); + const normalizedOptions = normalizeOptions(options); + + generateNxProject({ clientPlugins: {}, normalizedOptions, tree }); + + expect( + tree.exists(`${normalizedOptions.projectRoot}/tsconfig.json`), + ).toBeTruthy(); + expect( + tree.exists(`${normalizedOptions.projectRoot}/tsconfig.lib.json`), + ).toBeTruthy(); + expect( + tree.exists(`${normalizedOptions.projectRoot}/package.json`), + ).toBeTruthy(); + expect( + tree.exists(`${normalizedOptions.projectRoot}/README.md`), + ).toBeTruthy(); + }); + }); + + describe('generateApi', () => { + it('should process and bundle the OpenAPI spec file', async () => { + const { options, specPath, tree } = await getGeneratorOptions({ + name: `test-api-${randomUUID()}`, + tempDirectory, + }); + const normalizedOptions = normalizeOptions(options); + const { projectRoot } = normalizedOptions; + + await generateApi({ + client: '@hey-api/client-fetch', + plugins: [], + projectRoot, + specFile: specPath, + tempFolder: tempDirectory, + tree, + }); + + expect(tree.exists(`${projectRoot}/api/spec.yaml`)).toBeTruthy(); + }); + + it('should throw error for invalid spec file', async () => { + const { options, tree } = await getGeneratorOptions({ + name: `test-api-${randomUUID()}`, + tempDirectory, + }); + const normalizedOptions = normalizeOptions(options); + const { projectRoot } = normalizedOptions; + + await expect( + generateApi({ + client: '@hey-api/client-fetch', + plugins: [], + projectRoot, + specFile: 'non-existent.yaml', + tempFolder: tempDirectory, + tree, + }), + ).rejects.toThrow(); + }); + }); + + describe('updatePackageJson', () => { + it('should update package.json with correct dependencies', async () => { + const { options, tree } = await getGeneratorOptions({ + name: `test-api-${randomUUID()}`, + tempDirectory, + }); + const normalizedOptions = normalizeOptions(options); + const { projectName, projectRoot, projectScope } = normalizedOptions; + + // Create initial package.json + tree.write( + `${projectRoot}/package.json`, + JSON.stringify({ + dependencies: {}, + devDependencies: {}, + name: `${projectScope}/${projectName}`, + }), + ); + + // Create tsconfig.base.json + tree.write( + 'tsconfig.base.json', + JSON.stringify({ + compilerOptions: { + paths: {}, + }, + }), + ); + + await updatePackageJson({ + clientType: '@hey-api/client-fetch', + isPrivate: true, + plugins: [], + projectRoot, + tree, + }); + + const packageJson = readJson(tree, `${projectRoot}/package.json`); + expect(packageJson.dependencies['@hey-api/client-fetch']).toBeDefined(); + }); + + it('should update tsconfig with correct dependencies', async () => { + const { options, tree } = await getGeneratorOptions({ + name: `test-api-${randomUUID()}`, + tempDirectory, + }); + const normalizedOptions = normalizeOptions(options); + const { projectName, projectRoot, projectScope } = normalizedOptions; + + // Create tsconfig.base.json + tree.write( + 'tsconfig.base.json', + JSON.stringify({ + compilerOptions: { + paths: {}, + }, + }), + ); + + updateTsConfig({ + clientPlugins: { + '@tanstack/react-query': { + tsConfigCompilerPaths: { + 'my-test-path': './src/index.ts', + }, + }, + }, + projectName, + projectRoot, + projectScope, + tree, + }); + + // Verify tsconfig.base.json was updated + const tsconfig = readJson(tree, 'tsconfig.base.json'); + expect( + tsconfig.compilerOptions.paths[`${projectScope}/${projectName}`], + ).toBeDefined(); + expect(tsconfig.compilerOptions.paths['my-test-path']).toBeDefined(); + }); + + it('should update package.json with axios dependencies when clientType is axios', async () => { + const { options, tree } = await getGeneratorOptions({ + name: `test-api-${randomUUID()}`, + tempDirectory, + }); + const normalizedOptions = normalizeOptions(options); + const { projectName, projectRoot, projectScope } = normalizedOptions; + + // Create initial package.json + tree.write( + `${projectRoot}/package.json`, + JSON.stringify({ + dependencies: {}, + devDependencies: {}, + name: `${projectScope}/${projectName}`, + }), + ); + + await updatePackageJson({ + clientType: '@hey-api/client-axios', + isPrivate: true, + plugins: [], + projectRoot, + tree, + }); + + const packageJson = readJson(tree, `${projectRoot}/package.json`); + expect(packageJson.dependencies.axios).toBeDefined(); + }); + }); + + describe('generateClientCode', () => { + it('should generate client code without errors', async () => { + const { options, specPath } = await getGeneratorOptions({ + name: `test-api-${randomUUID()}`, + tempDirectory, + }); + const normalizedOptions = normalizeOptions(options); + const { clientType, plugins, projectRoot } = normalizedOptions; + + // Create necessary directories + const fullProjectRoot = join(process.cwd(), projectRoot); + if (!existsSync(fullProjectRoot)) { + mkdirSync(fullProjectRoot, { recursive: true }); + } + + await expect( + generateClientCode({ + clientType, + outputPath: `${projectRoot}/src/generated`, + plugins, + specFile: specPath, + }), + ).resolves.not.toThrow(); + }); + }); + + describe('full generator', () => { + it('should run the full generator successfully', async () => { + const { options, tree } = await getGeneratorOptions({ + name: `test-api-${randomUUID()}`, + tempDirectory, + }); + await generator(tree, options); + + // Verify project structure + const normalizedOptions = normalizeOptions(options); + const { projectRoot } = normalizedOptions; + + expect(tree.exists(`${projectRoot}/package.json`)).toBeTruthy(); + expect(tree.exists(`${projectRoot}/tsconfig.json`)).toBeTruthy(); + expect(tree.exists(`${projectRoot}/api/spec.yaml`)).toBeTruthy(); + }); + }); +}); diff --git a/packages/nx-plugin/src/generators/openapi-client/index.ts b/packages/nx-plugin/src/generators/openapi-client/index.ts new file mode 100644 index 000000000..1eb856eff --- /dev/null +++ b/packages/nx-plugin/src/generators/openapi-client/index.ts @@ -0,0 +1,760 @@ +import { existsSync, writeFileSync } from 'node:fs'; +import { mkdir, rm } from 'node:fs/promises'; +import { join } from 'node:path'; + +import type { ProjectConfiguration, Tree } from '@nx/devkit'; +import { + addDependenciesToPackageJson, + addProjectConfiguration, + formatFiles, + generateFiles, + installPackagesTask, + joinPathFragments, + logger, + names, + updateJson, +} from '@nx/devkit'; + +import packageJson from '../../../package.json'; +import type { UpdateApiExecutorSchema } from '../../executors/update-api/schema'; +import { + bundleAndDereferenceSpecFile, + generateClientCode, + generateClientCommand, + getPackageName, + getVersionOfPackage, + isAFile, + isUrl, +} from '../../utils'; +import { CONSTANTS } from '../../vars'; + +const defaultTempFolder = join(process.cwd(), CONSTANTS.TMP_DIR_NAME); + +/** + * Plugin configuration for the OpenAPI client generator + */ +export type ClientPluginOptions = { + /** + * Additional entry points to be added for this plugin to the tsconfig.base.json file + */ + additionalEntryPoints?: string[]; + /** + * Path to the template files to be added for this plugin to the project + */ + templateFilesPath?: string; + /** + * Compiler paths to be added for this plugin to the tsconfig.base.json file + */ + tsConfigCompilerPaths?: Record; +}; + +const getClientPlugins = ({ + inputPlugins, + projectName, + projectRoot, + projectScope, +}: NormalizedOptions & { + inputPlugins: string[]; +}): Record => { + const plugins: Record = { + '@tanstack/react-query': { + additionalEntryPoints: [`{projectRoot}/src/rq.ts`], + templateFilesPath: './plugins/rq', + tsConfigCompilerPaths: { + [`${projectScope}/${projectName}/rq`]: `./${projectRoot}/src/rq.ts`, + }, + }, + }; + + // Filter the plugins that are in the inputPlugins array + const filteredPlugins = Object.keys(plugins) + .filter((plugin) => inputPlugins.includes(plugin)) + .reduce( + (acc, plugin) => { + const keyedPlugin = plugin as keyof typeof plugins; + const foundPlugin = plugins[keyedPlugin]; + if (!foundPlugin) { + return acc; + } + acc[plugin] = foundPlugin; + + return acc; + }, + {} as Record, + ); + + return filteredPlugins; +}; + +// add additional test runners to support here +/** + * The test runner to use + */ +export type TestRunner = 'vitest'; + +/** + * The test runners and their configurations for generating test files + */ +const testRunners: Record< + TestRunner, + { + /** + * The template path to the test files + */ + templatePath: string; + } +> = { + vitest: { + templatePath: './tests/vitest', + }, +}; + +export interface OpenApiClientGeneratorSchema { + /** + * The client to use for the OpenAPI client + */ + client: string; + /** + * The directory to use for the project + */ + directory: string; + /** + * The name of the project + */ + name: string; + /** + * The plugins to use for the OpenAPI client + */ + plugins: string[]; + /** + * Whether to make the generated package private, defaults to `true` + */ + private?: boolean; + /** + * The scope of the project + */ + scope: string; + /** + * The spec file to use for the OpenAPI client + */ + spec: string; + /** + * The tags to use for the project + */ + tags?: string[]; + /** + * The directory to use for the temp folder, defaults to `./tmp` + * Only used for testing purposes + */ + tempFolderDir?: string; + /** + * The test runner to use for the project, defaults to `none` + */ + test?: TestRunner | 'none'; +} + +export default async function ( + tree: Tree, + options: OpenApiClientGeneratorSchema, +) { + logger.info( + `Starting OpenAPI client generator with options: ${JSON.stringify(options, null, 2)}`, + ); + try { + const normalizedOptions = normalizeOptions(options); + logger.debug( + `Normalized options: ${JSON.stringify(normalizedOptions, null, 2)}`, + ); + + const { + clientType, + isPrivate, + plugins, + projectName, + projectRoot, + projectScope, + specFile, + tempFolder, + } = normalizedOptions; + + logger.info( + `Generating OpenAPI client for '${projectName}' using client type '${clientType}'`, + ); + logger.debug(`Using plugins: ${plugins.join(', ')}`); + + const clientPlugins = getClientPlugins({ + ...normalizedOptions, + inputPlugins: plugins, + }); + logger.debug(`Found ${Object.keys(clientPlugins).length} client plugins`); + + // Create the temp folder + if (!existsSync(tempFolder)) { + logger.debug(`Creating temp folder: ${tempFolder}`); + await mkdir(tempFolder); + } else { + logger.debug(`Temp folder already exists: ${tempFolder}`); + } + + // Generate the Nx project + logger.info(`Generating Nx project structure`); + generateNxProject({ + clientPlugins, + normalizedOptions, + tree, + }); + + // Generate the api client code + logger.info(`Generating API client code using spec file: ${specFile}`); + await generateApi({ + client: clientType, + plugins, + projectRoot, + specFile, + tempFolder, + tree, + }); + + // Update the package.json file + logger.info(`Updating package.json with dependencies`); + const installDeps = await updatePackageJson({ + clientType, + isPrivate, + plugins, + projectRoot, + tree, + }); + + // Update the tsconfig.base.json file + logger.info(`Updating tsconfig.base.json with project paths`); + updateTsConfig({ + clientPlugins, + projectName, + projectRoot, + projectScope, + tree, + }); + + // Generate the client code + logger.info(`Generating client code from spec file`); + await generateClientCode({ + clientType, + outputPath: `${projectRoot}/src/${CONSTANTS.GENERATED_DIR_NAME}`, + plugins, + specFile: `${tempFolder}/${CONSTANTS.SPEC_DIR_NAME}/${CONSTANTS.SPEC_FILE_NAME}`, + }); + + // Format the files + logger.debug(`Formatting generated files`); + await formatFiles(tree); + + // Remove the temp folder + const absoluteTempFolder = join(process.cwd(), tempFolder); + logger.debug(`Removing temp folder: ${absoluteTempFolder}`); + await rm(absoluteTempFolder, { force: true, recursive: true }); + + logger.info( + `OpenAPI client generator completed successfully for ${projectName}`, + ); + // Return a function that installs the packages + return async () => { + logger.info(`Installing dependencies for ${projectName}`); + await installDeps(); + installPackagesTask(tree); + logger.info(`Dependencies installed successfully`); + }; + } catch (error) { + const errorMessage = error instanceof Error ? error.message : String(error); + logger.error(`OpenAPI client generator failed: ${errorMessage}`); + throw error; + } +} + +export interface NormalizedOptions { + clientType: string; + isPrivate: boolean; + plugins: string[]; + projectDirectory: string; + projectName: string; + projectRoot: string; + projectScope: string; + specFile: string; + tagArray: string[]; + tempFolder: string; + test: TestRunner | 'none'; +} + +export type GeneratedOptions = NormalizedOptions & typeof CONSTANTS; + +type ProjectConfigurationTargets = NonNullable; +type ValueType> = T[keyof T]; + +type Input = NonNullable< + ValueType['inputs'] +>[number]; +type Output = NonNullable< + ValueType['outputs'] +>[number]; + +/** + * Normalizes the CLI input options + */ +export function normalizeOptions( + options: OpenApiClientGeneratorSchema, +): NormalizedOptions { + const name = names(options.name).fileName; + const projectDirectory = names(options.directory).fileName.replace('./', ''); + const projectName = name.replace(new RegExp('/', 'g'), '-'); + const projectRoot = `${projectDirectory}/${projectName}`; + + const tagArray = Array.from( + new Set( + (typeof options.tags === 'string' + ? (options.tags as string).split(',') + : (options.tags ?? []) + ).map((s) => s.trim()), + ), + ); + const tempFolder = options.tempFolderDir ?? defaultTempFolder; + + return { + clientType: options.client, + isPrivate: options.private ?? true, + plugins: options.plugins, + projectDirectory, + projectName, + projectRoot, + projectScope: options.scope, + specFile: options.spec, + tagArray, + tempFolder, + test: options.test ?? 'none', + }; +} + +/** + * Generates the nx project + */ +export function generateNxProject({ + clientPlugins, + normalizedOptions, + tree, +}: { + clientPlugins: Record; + normalizedOptions: NormalizedOptions; + tree: Tree; +}) { + logger.debug(`Generating Nx project...`); + const { + clientType, + plugins, + projectDirectory, + projectName, + projectRoot, + projectScope, + specFile, + tagArray, + test, + } = normalizedOptions; + + const updateOptions: UpdateApiExecutorSchema = { + client: clientType, + directory: projectDirectory, + name: projectName, + plugins, + scope: projectScope, + spec: specFile, + }; + + const specIsAFile = isAFile(specFile); + const specIsRemote = isUrl(specFile); + + const additionalEntryPoints: string[] = []; + + for (const plugin of plugins) { + const clientPlugin = clientPlugins[plugin]; + if (clientPlugin) { + additionalEntryPoints.push(...(clientPlugin.additionalEntryPoints ?? [])); + } + } + + const baseInputs: Input[] = [ + `{projectRoot}/${CONSTANTS.SPEC_DIR_NAME}`, + '{projectRoot}/package.json', + '{projectRoot}/tsconfig.json', + '{projectRoot}/tsconfig.lib.json', + '{projectRoot}/openapi-ts.config.ts', + ]; + + const updateInputs: Input[] = [...baseInputs]; + + if (specIsAFile) { + // if the spec file is a file then we need to add it to inputs so that it is watched by NX + updateInputs.push(specFile); + } else if (specIsRemote) { + // here we should add a hash of the spec file to the inputs so that NX will watch for changes + // fetch the spec file from url and get the hash + const apiHash: Input = { + runtime: `npx node -e "console.log(require('crypto').createHash('sha256').update(process.argv[1]).digest('hex'))" "$(npx -y xcurl -s ${specFile})"`, + }; + updateInputs.push(apiHash); + } else { + logger.error(`Spec file ${specFile} is not a file or valid URI.`); + throw new Error(`Spec file ${specFile} is not a file or valid URI.`); + } + + const generateOutputs: Output[] = ['{options.outputPath}']; + const generateOutputPath = `./src/${CONSTANTS.GENERATED_DIR_NAME}`; + + // Create basic project structure + addProjectConfiguration(tree, `${projectScope}/${projectName}`, { + projectType: 'library', + root: projectRoot, + sourceRoot: `{projectRoot}/src`, + tags: tagArray, + targets: { + build: { + dependsOn: ['updateApi'], + executor: '@nx/js:tsc', + inputs: [ + { dependentTasksOutputFiles: '**/*.ts' }, + '^build', + ...baseInputs, + ], + options: { + additionalEntryPoints, + assets: [ + { + glob: 'README.md', + input: `./{projectRoot}`, + output: '.', + }, + ], + generateExportsField: true, + generatePackageJson: true, + main: `{projectRoot}/src/index.ts`, + outputPath: `{projectRoot}/dist`, + rootDir: `{projectRoot}/src`, + tsConfig: `{projectRoot}/${CONSTANTS.TS_LIB_CONFIG_NAME}`, + }, + outputs: ['{projectRoot}/dist'], + }, + generateApi: { + executor: 'nx:run-commands', + inputs: baseInputs, + options: { + command: generateClientCommand({ + clientType, + outputPath: generateOutputPath, + plugins, + specFile: `./${CONSTANTS.SPEC_DIR_NAME}/${CONSTANTS.SPEC_FILE_NAME}`, + }), + cwd: `{projectRoot}`, + outputPath: generateOutputPath, + }, + outputs: generateOutputs, + }, + // this adds the update-api executor to the generated project + updateApi: { + cache: true, + executor: `${packageJson.name}:update-api`, + inputs: updateInputs, + options: updateOptions, + outputs: [ + `{projectRoot}/src/${CONSTANTS.GENERATED_DIR_NAME}`, + `{projectRoot}/${CONSTANTS.SPEC_DIR_NAME}`, + ], + }, + }, + }); + + const generatedOptions: GeneratedOptions = { + ...normalizedOptions, + ...CONSTANTS, + }; + + // Create directory structure + const templatePath = join(__dirname, 'files'); + generateFiles(tree, templatePath, projectRoot, generatedOptions); + + for (const plugin of plugins) { + const pluginConfig = clientPlugins[plugin]; + if (pluginConfig) { + handlePlugin({ + generatedOptions, + plugin: pluginConfig, + projectRoot, + tree, + }); + } + } + + // Generate the test files + if (test !== 'none') { + generateTestFiles({ + generatedOptions, + projectRoot, + test, + tree, + }); + } else { + logger.debug(`No test runner specified, skipping test files generation`); + } + logger.debug(`Nx project generated successfully.`); +} + +function handlePlugin({ + generatedOptions, + plugin, + projectRoot, + tree, +}: { + generatedOptions: GeneratedOptions; + plugin: ClientPluginOptions; + projectRoot: string; + tree: Tree; +}) { + if (plugin.templateFilesPath) { + const pluginTemplatePath = join(__dirname, plugin.templateFilesPath); + generateFiles(tree, pluginTemplatePath, projectRoot, generatedOptions); + } +} + +export function generateTestFiles({ + generatedOptions, + projectRoot, + test, + tree, +}: { + generatedOptions: GeneratedOptions; + projectRoot: string; + test: TestRunner; + tree: Tree; +}) { + // link the tsconfig.spec.json to the tsconfig.json + updateJson(tree, `${projectRoot}/tsconfig.json`, (json) => { + json.references = [ + ...(json.references ?? []), + { + path: `./${CONSTANTS.TS_SPEC_CONFIG_NAME}`, + }, + ]; + return json; + }); + + const { templatePath } = testRunners[test]; + generateFiles( + tree, + join(__dirname, templatePath), + projectRoot, + generatedOptions, + ); +} + +/** + * Generates the api client code using the spec file + */ +export async function generateApi({ + client, + plugins, + projectRoot, + specFile, + tempFolder, + tree, +}: { + client: string; + plugins: string[]; + projectRoot: string; + specFile: string; + tempFolder: string; + tree: Tree; +}) { + // Create api directory if it doesn't exist + const apiDirectory = joinPathFragments(projectRoot, CONSTANTS.SPEC_DIR_NAME); + + // Determine spec file paths + const specDestination = joinPathFragments( + apiDirectory, + CONSTANTS.SPEC_FILE_NAME, + ); + + const tempSpecFolder = joinPathFragments(tempFolder, CONSTANTS.SPEC_DIR_NAME); + + // Create a full file path for the temp spec files + const tempSpecDestination = joinPathFragments( + tempSpecFolder, + CONSTANTS.SPEC_FILE_NAME, + ); + + try { + const absoluteTempSpecDestination = join( + process.cwd(), + tempSpecDestination, + ); + + // Ensure the directories exist in the tree file system + tree.write(specDestination, ''); + + const dereferencedSpec = await bundleAndDereferenceSpecFile({ + client, + outputPath: absoluteTempSpecDestination, + plugins, + specPath: specFile, + }); + + const dereferencedSpecString = JSON.stringify(dereferencedSpec, null, 2); + const absoluteSpecDestination = join(process.cwd(), tempSpecFolder); + + // Read the bundled file back into the tree + if (dereferencedSpec) { + try { + // write to temp spec destination + await mkdir(absoluteSpecDestination, { recursive: true }); + writeFileSync(absoluteTempSpecDestination, dereferencedSpecString); + } catch (error: unknown) { + const errorMessage = + error instanceof Error ? error.message : String(error); + logger.error( + `Failed to write dereferenced spec to temp file: ${errorMessage}.`, + ); + throw error; + } + // write to to destination in the tree + tree.write(specDestination, dereferencedSpecString); + } else { + logger.error('Failed to bundle spec file.'); + throw new Error('Failed to bundle spec file.'); + } + } catch (error: unknown) { + const errorMessage = error instanceof Error ? error.message : String(error); + logger.error(`Failed to bundle OpenAPI spec: ${errorMessage}.`); + throw error; + } +} + +async function getPackageDetails(name: string) { + const { default: latestVersion } = await import('latest-version'); + + const packageName = getPackageName(name); + const packageVersion = + getVersionOfPackage(name) || `^${await latestVersion(packageName)}`; + + return { + packageName, + packageVersion, + }; +} +/** + * Updates the package.json file to add dependencies and scripts + */ +export async function updatePackageJson({ + clientType, + isPrivate, + plugins, + projectRoot, + tree, +}: { + clientType: string; + /** + * Whether to make the generated package private + */ + isPrivate: boolean; + plugins: string[]; + projectRoot: string; + tree: Tree; +}) { + const { default: latestVersion } = await import('latest-version'); + + // add the client as a dependency + const clientDetails = getPackageDetails(clientType); + // add the openapi-ts as a dependency + const openApiTsDetails = getPackageDetails('@hey-api/openapi-ts'); + // add the plugins as dependencies + const pluginDetails = plugins.map(getPackageDetails); + + const results = await Promise.all([ + clientDetails, + openApiTsDetails, + ...pluginDetails, + ]); + + // Update package.json to add dependencies and scripts + const deps = results.reduce( + (acc, result) => { + acc[result.packageName] = result.packageVersion; + return acc; + }, + {} as Record, + ); + + if ((await clientDetails).packageName === '@hey-api/client-axios') { + const axiosVersion = await latestVersion('axios'); + deps['axios'] = `^${axiosVersion}`; + } + + const installDeps = addDependenciesToPackageJson( + tree, + deps, + {}, + join(projectRoot, 'package.json'), + ); + + // update the private and publishConfig field in the package.json file + updateJson(tree, join(projectRoot, 'package.json'), (json) => { + if (isPrivate) { + json.private = isPrivate; + } else { + json.publishConfig = { + access: 'public', + }; + } + return json; + }); + + return installDeps; +} + +export function updateTsConfig({ + clientPlugins, + projectName, + projectRoot, + projectScope, + tree, +}: { + clientPlugins: Record; + projectName: string; + projectRoot: string; + projectScope: string; + tree: Tree; +}) { + const tsconfigName = CONSTANTS.TS_BASE_CONFIG_NAME; + + try { + updateJson(tree, tsconfigName, (json) => { + const paths = json.compilerOptions.paths || {}; + paths[`${projectScope}/${projectName}`] = [ + `./${projectRoot}/src/index.ts`, + ]; + + for (const plugin of Object.keys(clientPlugins)) { + const item = clientPlugins[plugin]; + if (!item) { + continue; + } + const pluginTsConfigPath = item.tsConfigCompilerPaths; + if (pluginTsConfigPath) { + // for each key in the pluginTsConfigPath object, add it to the paths object + for (const [key, value] of Object.entries(pluginTsConfigPath)) { + paths[key] = [value]; + } + } + } + json.compilerOptions.paths = paths; + return json; + }); + } catch (error: unknown) { + const errorMessage = error instanceof Error ? error.message : String(error); + logger.error(`Failed to update ${tsconfigName}: ${errorMessage}.`); + throw error; + } +} diff --git a/packages/nx-plugin/src/generators/openapi-client/plugins/rq/src/rq.ts.template b/packages/nx-plugin/src/generators/openapi-client/plugins/rq/src/rq.ts.template new file mode 100644 index 000000000..21d9765cd --- /dev/null +++ b/packages/nx-plugin/src/generators/openapi-client/plugins/rq/src/rq.ts.template @@ -0,0 +1 @@ +export * from './generated/@tanstack/react-query.gen'; diff --git a/packages/nx-plugin/src/generators/openapi-client/schema.json b/packages/nx-plugin/src/generators/openapi-client/schema.json new file mode 100644 index 000000000..598283939 --- /dev/null +++ b/packages/nx-plugin/src/generators/openapi-client/schema.json @@ -0,0 +1,68 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "cli": "nx", + "$id": "openapi-client", + "title": "OpenAPI Client Generator", + "description": "Generate an OpenAPI client library from an OpenAPI spec file", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Library name", + "$default": { + "$source": "argv", + "index": 0 + }, + "x-prompt": "What name would you like to use for the library?" + }, + "directory": { + "type": "string", + "description": "Directory where the library will be created", + "default": "libs" + }, + "scope": { + "type": "string", + "description": "Scope of the library", + "x-prompt": "What is the scope of the library?" + }, + "spec": { + "type": "string", + "description": "Path to the OpenAPI spec file (URL or local path)", + "x-prompt": "What is the URL or local path to the OpenAPI spec file?" + }, + "tags": { + "type": "array", + "description": "Add tags to the library (comma-separated)", + "default": ["api", "openapi"], + "items": { + "type": "string" + } + }, + "client": { + "type": "string", + "description": "Type of client to generate", + "default": "@hey-api/client-fetch", + "x-prompt": "Which client type would you like to use?" + }, + "plugins": { + "type": "array", + "description": "Plugins to use", + "default": [], + "items": { + "type": "string" + } + }, + "test": { + "type": "string", + "description": "Test to use", + "default": "none", + "enum": ["none", "vitest"] + }, + "private": { + "type": "boolean", + "description": "Whether to make the generated package private", + "default": true + } + }, + "required": ["name", "spec", "scope"] +} diff --git a/packages/nx-plugin/src/generators/openapi-client/tests/vitest/src/client.spec.ts.template b/packages/nx-plugin/src/generators/openapi-client/tests/vitest/src/client.spec.ts.template new file mode 100644 index 000000000..2504a0f04 --- /dev/null +++ b/packages/nx-plugin/src/generators/openapi-client/tests/vitest/src/client.spec.ts.template @@ -0,0 +1,10 @@ +import { describe, it, expect } from 'vitest'; +import { client } from './generated/client.gen'; + +describe('Generated API Client', () => { + describe('Client Configuration', () => { + it('should create client', () => { + expect(client).toBeDefined(); + }); + }); +}); diff --git a/packages/nx-plugin/src/generators/openapi-client/tests/vitest/tsconfig.spec.json.template b/packages/nx-plugin/src/generators/openapi-client/tests/vitest/tsconfig.spec.json.template new file mode 100644 index 000000000..e41666556 --- /dev/null +++ b/packages/nx-plugin/src/generators/openapi-client/tests/vitest/tsconfig.spec.json.template @@ -0,0 +1,27 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./out-tsc/vitest", + "types": [ + "vitest/globals", + "vitest/importMeta", + "vite/client", + "node", + "vitest" + ], + "module": "nodenext", + "moduleResolution": "nodenext" + }, + "include": [ + "vite.config.ts, + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.test.tsx", + "src/**/*.spec.tsx", + "src/**/*.test.js", + "src/**/*.spec.js", + "src/**/*.test.jsx", + "src/**/*.spec.jsx", + "src/**/*.d.ts" + ] +} diff --git a/packages/nx-plugin/src/generators/openapi-client/tests/vitest/vite.config.ts.template b/packages/nx-plugin/src/generators/openapi-client/tests/vitest/vite.config.ts.template new file mode 100644 index 000000000..ef423b002 --- /dev/null +++ b/packages/nx-plugin/src/generators/openapi-client/tests/vitest/vite.config.ts.template @@ -0,0 +1,21 @@ +/// +import { defineConfig } from 'vite'; +import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; +import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin'; + +export default defineConfig({ + root: __dirname, + cacheDir: '../../node_modules/.vite/<%= projectName %>', + plugins: [nxViteTsPaths(), nxCopyAssetsPlugin(['*.md'])], + test: { + watch: false, + globals: true, + environment: 'node', + include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], + reporters: ['default'], + coverage: { + reportsDirectory: '../../coverage/<%= projectDirectory %>/<%= projectName %>', + provider: 'v8' as const, + }, + }, +}); diff --git a/packages/nx-plugin/src/index.ts b/packages/nx-plugin/src/index.ts new file mode 100644 index 000000000..1a94e34b3 --- /dev/null +++ b/packages/nx-plugin/src/index.ts @@ -0,0 +1,4 @@ +export * from './executors/update-api'; +export * from './generators/openapi-client'; +export * from './utils'; +export * from './vars'; diff --git a/packages/nx-plugin/src/test-utils.ts b/packages/nx-plugin/src/test-utils.ts new file mode 100644 index 000000000..71797a1e7 --- /dev/null +++ b/packages/nx-plugin/src/test-utils.ts @@ -0,0 +1,78 @@ +import { existsSync } from 'node:fs'; +import { mkdir, writeFile } from 'node:fs/promises'; +import { join } from 'node:path'; + +import { logger, type Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; + +import type { OpenApiClientGeneratorSchema } from './generators/openapi-client'; + +export const TestOptions = { + client: '@hey-api/client-fetch', + name: 'test-api', + scope: '@test-api', + specFileName: 'test-spec.yaml', + tags: ['api', 'openapi'], +}; + +export const getGeneratorOptions = async ({ + name, + tempDirectory, +}: { + name: string; + /** + * The directory that will be used to create the temp spec file + */ + tempDirectory: string; +}): Promise<{ + options: OpenApiClientGeneratorSchema; + specPath: string; + tree: Tree; +}> => { + const tree = createTreeWithEmptyWorkspace(); + + // Create a mock spec file in the workspace + const mockSpecContent = ` +openapi: 3.0.0 +info: + title: Test API + version: 1.0.0 +paths: + /test: + get: + responses: + '200': + description: OK + `; + + // Create temp directory in the workspace root + const tempDir = `${tempDirectory}/${name}`; + const apiDir = `${tempDir}/api`; + if (!existsSync(apiDir)) { + await mkdir(join(process.cwd(), apiDir), { recursive: true }); + } + + // Write the spec file + const tempSpecPath = `${apiDir}/${TestOptions.specFileName}`; + const absoluteSpecPath = join(process.cwd(), tempSpecPath); + logger.debug(`Writing generator spec to ${absoluteSpecPath}`); + await writeFile(absoluteSpecPath, mockSpecContent); + + const options = { + client: TestOptions.client, + directory: tempDir, + name: TestOptions.name, + plugins: [], + scope: TestOptions.scope, + spec: tempSpecPath, + tags: TestOptions.tags, + tempFolderDir: tempDir + '/temp', + } satisfies OpenApiClientGeneratorSchema; + + // Update options with the correct spec file path + return { + options, + specPath: tempSpecPath, + tree, + }; +}; diff --git a/packages/nx-plugin/src/utils.spec.ts b/packages/nx-plugin/src/utils.spec.ts new file mode 100644 index 000000000..034bf1eee --- /dev/null +++ b/packages/nx-plugin/src/utils.spec.ts @@ -0,0 +1,277 @@ +import { randomUUID } from 'node:crypto'; +import { rm, writeFile } from 'node:fs/promises'; +import { join } from 'node:path'; + +import { createClient } from '@hey-api/openapi-ts'; +import { getSpec, type initConfigs } from '@hey-api/openapi-ts/internal'; +import { afterAll, beforeEach, describe, expect, it, vi } from 'vitest'; + +import { + bundleAndDereferenceSpecFile, + generateClientCode, + generateClientCommand, + getPackageName, + getVersionOfPackage, + isAFile, + isUrl, +} from './utils'; + +vi.mock('@hey-api/openapi-ts', async (importOriginal) => { + const actual = await importOriginal(); + return { + ...actual, + createClient: vi.fn(), + }; +}); + +vi.mock('@hey-api/openapi-ts/internal', async (importOriginal) => { + const actual = + await importOriginal(); + return { + ...actual, + getSpec: vi.fn(() => + Promise.resolve({ + data: {}, + error: null, + }), + ), + initConfigs: vi.fn((config: Parameters[0]) => + Promise.resolve([ + { + input: config?.input ?? 'default-input', + output: config?.output ?? 'default-output', + plugins: config?.plugins ?? [], + }, + ]), + ), + parseOpenApiSpec: vi.fn(() => ({ + spec: { + name: 'test-name', + }, + })), + }; +}); + +describe('utils', () => { + beforeEach(() => { + vi.clearAllMocks(); + }); + + afterAll(() => { + vi.resetAllMocks(); + }); + + describe('generateClientCommand', () => { + it('should generate command without plugins', () => { + const command = generateClientCommand({ + clientType: '@hey-api/client-fetch', + outputPath: './src/generated', + plugins: [], + specFile: './api/spec.yaml', + }); + + expect(command).toBe( + 'npx @hey-api/openapi-ts -i ./api/spec.yaml -o ./src/generated -c @hey-api/client-fetch', + ); + }); + + it('should generate command with plugins', () => { + const command = generateClientCommand({ + clientType: '@hey-api/client-fetch', + outputPath: './src/generated', + plugins: ['@tanstack/react-query', 'zod'], + specFile: './api/spec.yaml', + }); + + expect(command).toBe( + 'npx @hey-api/openapi-ts -i ./api/spec.yaml -o ./src/generated -c @hey-api/client-fetch -p @tanstack/react-query,zod', + ); + }); + }); + + describe('getVersionOfPackage', () => { + it('should extract version from package name with version', () => { + expect(getVersionOfPackage('@hey-api/client-fetch@0.9.0')).toBe('0.9.0'); + expect(getVersionOfPackage('axios@1.2.3')).toBe('1.2.3'); + }); + + it('should return undefined for package name without version', () => { + expect(getVersionOfPackage('@hey-api/client-fetch')).toBeUndefined(); + expect(getVersionOfPackage('axios')).toBeUndefined(); + }); + + it('should handle scoped packages correctly', () => { + expect(getVersionOfPackage('@scope/package@1.0.0')).toBe('1.0.0'); + expect(getVersionOfPackage('@scope/package')).toBeUndefined(); + }); + }); + + describe('getPackageName', () => { + it('should extract package name from package with version', () => { + expect(getPackageName('@hey-api/client-fetch@0.9.0')).toBe( + '@hey-api/client-fetch', + ); + expect(getPackageName('axios@1.2.3')).toBe('axios'); + }); + + it('should return same name for package without version', () => { + expect(getPackageName('@hey-api/client-fetch')).toBe( + '@hey-api/client-fetch', + ); + expect(getPackageName('axios')).toBe('axios'); + }); + + it('should handle scoped packages correctly', () => { + expect(getPackageName('@scope/package@1.0.0')).toBe('@scope/package'); + expect(getPackageName('@scope/package')).toBe('@scope/package'); + }); + }); + + describe('generateClientCode', () => { + it('should execute command successfully', async () => { + await generateClientCode({ + clientType: '@hey-api/client-fetch', + outputPath: './src/generated', + plugins: [], + specFile: './api/spec.yaml', + }); + + expect(createClient).toHaveBeenCalledWith({ + input: './api/spec.yaml', + output: './src/generated', + plugins: ['@hey-api/client-fetch'], + }); + }); + + it('should throw error when command fails', async () => { + vi.mocked(createClient).mockImplementationOnce(() => { + throw new Error('Command failed'); + }); + + try { + await generateClientCode({ + clientType: '@hey-api/client-fetch', + outputPath: './src/generated', + plugins: [], + specFile: './api/spec.yaml', + }); + // If we get here, fail the test + expect.fail('Expected function to throw'); + } catch (error) { + if (error instanceof Error) { + expect(error.message).toContain('Command failed'); + } else { + expect.fail('Expected error to be an instance of Error'); + } + } + }); + }); + + describe('bundleAndDereferenceSpecFile', () => { + it('should execute bundle command successfully', async () => { + // write temp spec file + const specAsYaml = `openapi: 3.0.0 +info: + title: Test API + version: 1.0.0 +paths: + /test: + get: + summary: Test endpoint + responses: + '200': + description: A successful response +`; + const tempSpecFile = join( + process.cwd(), + `temp-spec-${randomUUID()}.yaml`, + ); + await writeFile(tempSpecFile, specAsYaml); + + const dereferencedSpec = await bundleAndDereferenceSpecFile({ + client: '@hey-api/client-fetch', + outputPath: './output/dereferenced-spec.yaml', + plugins: [], + specPath: tempSpecFile, + }); + + expect(dereferencedSpec).toBeDefined(); + expect((dereferencedSpec as any).name).toBe('test-name'); + + // delete temp spec file + await rm(tempSpecFile, { force: true }); + }); + + it('should throw error when bundle command fails', async () => { + vi.mocked(getSpec).mockImplementationOnce(() => + Promise.reject(new Error('Bundle failed')), + ); + + // write temp spec file + const specAsYaml = `openapi: 3.0.0 +info: + title: Test API + version: 1.0.0 +paths: + /test: + get: + summary: Test endpoint + responses: + '200': + description: A successful response +`; + const tempSpecFile = join( + process.cwd(), + `temp-spec-${randomUUID()}.yaml`, + ); + await writeFile(tempSpecFile, specAsYaml); + + await expect(() => + bundleAndDereferenceSpecFile({ + client: '@hey-api/client-fetch', + outputPath: './output/dereferenced-spec.yaml', + plugins: [], + specPath: tempSpecFile, + }), + ).rejects.toThrow('Bundle failed'); + + // delete temp spec file + await rm(tempSpecFile, { force: true }); + }); + }); + + describe('isUrl', () => { + it('should return true for valid URLs', () => { + expect(isUrl('https://example.com')).toBe(true); + expect(isUrl('http://example.com')).toBe(true); + }); + + it('should return false for invalid URLs', () => { + expect(isUrl('not-a-url')).toBe(false); + }); + + it('should return false for file paths', () => { + expect(isUrl('/path/to/spec.yaml')).toBe(false); + }); + }); + + describe('isAFile', () => { + it('should return true for valid file paths', async () => { + await writeFile('./spec.yaml', 'openapi: 3.0.0'); + expect(isAFile('./spec.yaml')).toBe(true); + await rm('./spec.yaml'); + }); + + it('should return false for valid URLs', () => { + expect(isAFile('https://example.com')).toBe(false); + }); + + it('should return false for invalid file paths', () => { + expect(isAFile('not-a-file')).toBe(false); + }); + + it('should fail if provided a url', () => { + expect(isAFile('http://example.com')).toBe(false); + }); + }); +}); diff --git a/packages/nx-plugin/src/utils.ts b/packages/nx-plugin/src/utils.ts new file mode 100644 index 000000000..0fb8b6f5b --- /dev/null +++ b/packages/nx-plugin/src/utils.ts @@ -0,0 +1,304 @@ +import { existsSync, lstatSync } from 'node:fs'; + +import type { JSONSchema } from '@hey-api/json-schema-ref-parser'; +import { createClient } from '@hey-api/openapi-ts'; +import { + getSpec, + initConfigs, + parseOpenApiSpec, +} from '@hey-api/openapi-ts/internal'; +import { logger } from '@nx/devkit'; +import OpenApiDiff from 'openapi-diff'; + +export function generateClientCommand({ + clientType, + outputPath, + plugins, + specFile, +}: { + clientType: string; + outputPath: string; + plugins: string[]; + specFile: string; +}) { + return `npx @hey-api/openapi-ts -i ${specFile} -o ${outputPath} -c ${clientType}${plugins.length > 0 ? ` -p ${plugins.join(',')}` : ''}`; +} + +/** + * example package name: @hey-api/client-fetch@0.9.0 + */ +export function getVersionOfPackage(packageName: string) { + // we compare the index of the @ symbol and we check greater than 0 over -1 because if the @ symbol is at the 0 position then that is not a version + const atIndex = packageName.lastIndexOf('@'); + return atIndex > 0 ? packageName.slice(atIndex + 1) : undefined; +} + +export function getPackageName(packageName: string) { + const atIndex = packageName.lastIndexOf('@'); + return atIndex > 0 + ? packageName.slice(0, atIndex) || packageName + : packageName; +} + +type ConfigOptions = NonNullable[0]>; +type ClientConfig = Extract< + ConfigOptions, + { + plugins?: any; + } +>; + +/** + * Generates the client code using the spec file + */ +export async function generateClientCode({ + clientType, + outputPath, + plugins, + specFile, +}: { + clientType: string; + outputPath: string; + plugins: string[]; + specFile: string; +}) { + try { + logger.info(`Generating client code using spec file...`); + await createClient({ + input: specFile, + output: outputPath, + plugins: [clientType, ...plugins] as ClientConfig['plugins'], + }); + logger.info(`Generated client code successfully.`); + } catch (error) { + logger.error(`Failed to generate client code: ${error}`); + throw error; + } +} + +/** + * Bundle and dereference the new spec file + */ +export async function bundleAndDereferenceSpecFile({ + client, + outputPath, + plugins, + specPath, +}: { + client: string; + outputPath: string; + plugins: string[]; + specPath: string; +}) { + try { + logger.debug(`Bundling OpenAPI spec file ${specPath}...`); + + logger.debug(`Getting spec file...`); + const { data, error } = await getSpec({ + inputPath: specPath, + timeout: 10000, + watch: { headers: new Headers() }, + }); + if (error) { + logger.error(`Failed to get spec file: ${error}`); + throw new Error(`Failed to get spec file: ${error}`); + } + logger.debug(`Spec file loaded.`); + const spec = data; + // loading default config + logger.debug(`Loading default config...`); + const configs = await initConfigs({ + input: specPath, + output: outputPath, + plugins: [client, ...plugins] as ClientConfig['plugins'], + }); + // getting the first config + const config = configs[0]; + if (!config) { + logger.error('Failed to load config.'); + throw new Error('Failed to load config.'); + } + logger.debug(`Parsing spec...`); + const context = parseOpenApiSpec({ + config, + spec, + }); + if (!context) { + logger.error('Failed to parse spec.'); + throw new Error('Failed to parse spec.'); + } + const dereferencedSpec = context?.spec; + if (!dereferencedSpec) { + logger.error('Failed to dereference spec.'); + throw new Error('Failed to dereference spec.'); + } + logger.debug(`Spec bundled and dereferenced.`); + return dereferencedSpec as JSONSchema; + } catch (error) { + logger.error(`Failed to bundle and dereference spec file: ${error}.`); + throw error; + } +} + +/** + * Fetches an unparsed spec file + */ +async function getSpecFile(path: string) { + const spec = await getSpec({ + inputPath: path, + timeout: 10000, + watch: { headers: new Headers() }, + }); + if (spec.error) { + throw new Error('Failed to read spec file'); + } + + return spec.data; +} + +function getSpecVersion(spec: JSONSchema) { + if ('openapi' in spec && typeof spec.openapi === 'string') { + return spec.openapi; + } + + if ('swagger' in spec && typeof spec.swagger === 'string') { + return spec.swagger; + } + return 'unknown'; +} + +function validateSpecVersions( + newSpecVersion: string, + existingSpecVersion: string, +) { + if (!newSpecVersion.startsWith('3') && !newSpecVersion.startsWith('2')) { + throw new Error('New spec is not a valid OpenAPI spec version of 2 or 3.'); + } + + logger.debug('Checking spec versions...'); + logger.debug(`Existing spec version: ${existingSpecVersion}`); + logger.debug(`New spec version: ${newSpecVersion}`); + const existingVersionIs3 = existingSpecVersion.startsWith('3'); + const newSpecVersionIs3 = newSpecVersion.startsWith('3'); + const existingVersionIs2 = existingSpecVersion.startsWith('2'); + const newSpecVersionIs2 = newSpecVersion.startsWith('2'); + + if (!newSpecVersionIs3 && !newSpecVersionIs2) { + throw new Error('New spec is not a valid OpenAPI spec version of 2 or 3.'); + } + + if (!existingVersionIs3 && !existingVersionIs2) { + logger.error( + 'Existing spec is not a valid OpenAPI spec version of 2 or 3.', + ); + throw new Error( + 'Existing spec is not a valid OpenAPI spec version of 2 or 3.', + ); + } + + return { + existingVersionIs2, + existingVersionIs3, + newSpecVersionIs2, + newSpecVersionIs3, + }; +} + +/** + * Fetches two spec files and returns them + */ +export async function getSpecFiles( + existingSpecPath: string, + newSpecPath: string, +) { + logger.debug('Loading spec files...'); + const parsedExistingSpecTask = getSpecFile(existingSpecPath); + const parsedNewSpecTask = getSpecFile(newSpecPath); + const tasks = await Promise.allSettled([ + parsedExistingSpecTask, + parsedNewSpecTask, + ]); + + if (tasks[0].status === 'rejected' && tasks[1].status === 'rejected') { + throw new Error('Failed to read both spec files'); + } + + if (tasks[0].status === 'rejected') { + throw new Error('Failed to read existing spec file'); + } + + if (tasks[1].status === 'rejected') { + throw new Error('Failed to read updated spec file.'); + } + + const existingSpec = await parsedExistingSpecTask; + const newSpec = await parsedNewSpecTask; + + return { + existingSpec, + newSpec, + }; +} + +/** + * Fetches two spec files and compares them for differences + */ +export async function compareSpecs( + existingSpecPath: string, + newSpecPath: string, +) { + const { existingSpec, newSpec } = await getSpecFiles( + existingSpecPath, + newSpecPath, + ); + + const existingSpecVersion = getSpecVersion(existingSpec); + const newSpecVersion = getSpecVersion(newSpec); + + const { existingVersionIs3, newSpecVersionIs3 } = validateSpecVersions( + newSpecVersion, + existingSpecVersion, + ); + + logger.debug('Comparing specs...'); + // Compare specs + const diff = await OpenApiDiff.diffSpecs({ + destinationSpec: { + content: JSON.stringify(newSpec), + format: newSpecVersionIs3 ? 'openapi3' : 'swagger2', + location: newSpecPath, + }, + sourceSpec: { + content: JSON.stringify(existingSpec), + format: existingVersionIs3 ? 'openapi3' : 'swagger2', + location: existingSpecPath, + }, + }); + const areSpecsEqual = + diff.breakingDifferencesFound === false && + diff.nonBreakingDifferences.length === 0 && + // TODO: figure out if we should check unclassifiedDifferences + diff.unclassifiedDifferences.length === 0; + + logger.debug(`Are specs equal: ${areSpecsEqual}`); + return areSpecsEqual; +} + +export function isUrl(url: string) { + try { + const urlObject = new URL(url); + return urlObject.protocol === 'http:' || urlObject.protocol === 'https:'; + } catch { + return false; + } +} + +/** + * Checks if the spec is a file on the local file system + */ +export function isAFile(isFileSystemFile: string) { + if (isUrl(isFileSystemFile)) { + return false; + } + return existsSync(isFileSystemFile) && lstatSync(isFileSystemFile).isFile(); +} diff --git a/packages/nx-plugin/src/vars.ts b/packages/nx-plugin/src/vars.ts new file mode 100644 index 000000000..ba3844c6b --- /dev/null +++ b/packages/nx-plugin/src/vars.ts @@ -0,0 +1,10 @@ +export const CONSTANTS = { + BASE_TEST_TEMPLATE_PATH: 'tests/base', + GENERATED_DIR_NAME: 'generated', + SPEC_DIR_NAME: 'api', + SPEC_FILE_NAME: 'spec.yaml', + TMP_DIR_NAME: 'tmp', + TS_BASE_CONFIG_NAME: 'tsconfig.base.json', + TS_LIB_CONFIG_NAME: 'tsconfig.lib.json', + TS_SPEC_CONFIG_NAME: 'tsconfig.spec.json', +}; diff --git a/packages/nx-plugin/tsconfig.base.json b/packages/nx-plugin/tsconfig.base.json new file mode 100644 index 000000000..4ae154dda --- /dev/null +++ b/packages/nx-plugin/tsconfig.base.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "declaration": true, + "esModuleInterop": true, + "module": "ESNext", + "moduleResolution": "Bundler", + "noImplicitOverride": true, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "strict": true, + "target": "ES2022", + "useUnknownInCatchVariables": false + } +} diff --git a/packages/nx-plugin/tsconfig.json b/packages/nx-plugin/tsconfig.json new file mode 100644 index 000000000..89ceb3bfa --- /dev/null +++ b/packages/nx-plugin/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "declaration": false, + "esModuleInterop": true, + "resolveJsonModule": true, + "skipLibCheck": true + } +} diff --git a/packages/nx-plugin/tsup.config.ts b/packages/nx-plugin/tsup.config.ts new file mode 100644 index 000000000..c101964ef --- /dev/null +++ b/packages/nx-plugin/tsup.config.ts @@ -0,0 +1,23 @@ +import { defineConfig } from 'tsup'; + +export default defineConfig((options) => ({ + banner(ctx) { + /** + * fix dynamic require in ESM + * @link https://github.com/hey-api/openapi-ts/issues/1079 + */ + if (ctx.format === 'esm') { + return { + js: "import { createRequire } from 'module'; const require = createRequire(import.meta.url);", + }; + } + }, + clean: true, + dts: true, + entry: ['src/index.ts'], + format: ['cjs', 'esm'], + minify: !options.watch, + shims: false, + sourcemap: true, + treeshake: true, +})); diff --git a/packages/nx-plugin/turbo.json b/packages/nx-plugin/turbo.json new file mode 100644 index 000000000..09e65b626 --- /dev/null +++ b/packages/nx-plugin/turbo.json @@ -0,0 +1,14 @@ +{ + "$schema": "../../node_modules/turbo/schema.json", + "extends": ["//"], + "tasks": { + "build": { + "cache": true, + "dependsOn": ["^build"], + "outputs": ["dist/**"] + }, + "test": { + "dependsOn": [] + } + } +} diff --git a/packages/nx-plugin/vitest.config.ts b/packages/nx-plugin/vitest.config.ts new file mode 100644 index 000000000..4fc2d0500 --- /dev/null +++ b/packages/nx-plugin/vitest.config.ts @@ -0,0 +1,12 @@ +import { fileURLToPath } from 'node:url'; + +import { createVitestConfig } from '@config/vite-base'; + +export default createVitestConfig( + fileURLToPath(new URL('./', import.meta.url)), + { + test: { + environment: 'node', + }, + }, +); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 838ef95bd..096acbf2d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -31,7 +31,7 @@ importers: version: 8.29.1(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3) '@vitest/coverage-v8': specifier: 3.1.1 - version: 3.1.1(vitest@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) + version: 3.1.1(vitest@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) eslint: specifier: 9.17.0 version: 9.17.0(jiti@2.4.2) @@ -73,7 +73,7 @@ importers: version: 6.1.1(rollup@4.31.0)(typescript@5.8.3) tsup: specifier: 8.4.0 - version: 8.4.0(jiti@2.4.2)(postcss@8.5.4)(typescript@5.8.3)(yaml@2.8.0) + version: 8.4.0(jiti@2.4.2)(postcss@8.5.3)(typescript@5.8.3)(yaml@2.8.0) turbo: specifier: 2.5.5 version: 2.5.5 @@ -85,7 +85,7 @@ importers: version: 8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3) vitest: specifier: 3.1.1 - version: 3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + version: 3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) docs: dependencies: @@ -101,7 +101,7 @@ importers: version: 0.33.5 vitepress: specifier: 1.3.0 - version: 1.3.0(@algolia/client-search@5.21.0)(@types/node@22.10.5)(@types/react@19.0.1)(axios@1.8.2)(less@4.2.2)(postcss@8.5.4)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.85.0)(search-insights@2.17.3)(terser@5.39.0)(typescript@5.8.3) + version: 1.3.0(@algolia/client-search@5.25.0)(@types/node@22.10.5)(@types/react@19.0.1)(axios@1.9.0)(less@4.2.2)(postcss@8.5.3)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.85.0)(search-insights@2.17.3)(terser@5.39.1)(typescript@5.8.3) vue: specifier: 3.5.13 version: 3.5.13(typescript@5.8.3) @@ -147,7 +147,7 @@ importers: version: 8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3) '@vitejs/plugin-react': specifier: 4.4.0-beta.1 - version: 4.4.0-beta.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) + version: 4.4.0-beta.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) autoprefixer: specifier: 10.4.19 version: 10.4.19(postcss@8.4.41) @@ -174,7 +174,7 @@ importers: version: 5.8.3 vite: specifier: 6.2.7 - version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) examples/openapi-ts-fastify: dependencies: @@ -202,10 +202,10 @@ importers: version: 5.8.3 vite: specifier: 6.2.7 - version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) vitest: specifier: 3.1.1 - version: 3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + version: 3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) examples/openapi-ts-fetch: dependencies: @@ -245,7 +245,7 @@ importers: version: 8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3) '@vitejs/plugin-react': specifier: 4.4.0-beta.1 - version: 4.4.0-beta.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) + version: 4.4.0-beta.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) autoprefixer: specifier: 10.4.19 version: 10.4.19(postcss@8.4.41) @@ -272,7 +272,7 @@ importers: version: 5.8.3 vite: specifier: 6.2.7 - version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) examples/openapi-ts-next: dependencies: @@ -321,7 +321,7 @@ importers: version: link:../../packages/nuxt nuxt: specifier: 3.14.1592 - version: 3.14.1592(@parcel/watcher@2.5.1)(@types/node@22.10.5)(db0@0.3.1)(encoding@0.1.13)(eslint@9.17.0(jiti@2.4.2))(ioredis@5.6.0)(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.41.1)(sass@1.85.0)(terser@5.39.0)(typescript@5.8.3)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) + version: 3.14.1592(@parcel/watcher@2.5.1)(@types/node@22.10.5)(db0@0.3.2)(encoding@0.1.13)(eslint@9.17.0(jiti@2.4.2))(ioredis@5.6.1)(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.40.2)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) vue: specifier: 3.5.13 version: 3.5.13(typescript@5.8.3) @@ -334,7 +334,7 @@ importers: devDependencies: vite: specifier: 6.2.7 - version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) examples/openapi-ts-sample: dependencies: @@ -380,7 +380,7 @@ importers: version: 8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3) '@vitejs/plugin-react': specifier: 4.4.0-beta.1 - version: 4.4.0-beta.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) + version: 4.4.0-beta.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) autoprefixer: specifier: 10.4.19 version: 10.4.19(postcss@8.4.41) @@ -407,7 +407,7 @@ importers: version: 5.8.3 vite: specifier: 6.2.7 - version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) examples/openapi-ts-tanstack-angular-query-experimental: dependencies: @@ -416,7 +416,7 @@ importers: version: 19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)) '@angular/cdk': specifier: ^19.2.1 - version: 19.2.2(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1) + version: 19.2.16(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1) '@angular/common': specifier: ^19.2.0 version: 19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1) @@ -431,7 +431,7 @@ importers: version: 19.2.0(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(@angular/platform-browser@19.2.0(@angular/animations@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(rxjs@7.8.1) '@angular/material': specifier: ^19.2.1 - version: 19.2.2(@angular/cdk@19.2.2(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(@angular/forms@19.2.0(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(@angular/platform-browser@19.2.0(@angular/animations@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(rxjs@7.8.1))(@angular/platform-browser@19.2.0(@angular/animations@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(rxjs@7.8.1) + version: 19.2.16(@angular/cdk@19.2.16(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(@angular/forms@19.2.0(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(@angular/platform-browser@19.2.0(@angular/animations@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(rxjs@7.8.1))(@angular/platform-browser@19.2.0(@angular/animations@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(rxjs@7.8.1) '@angular/platform-browser': specifier: ^19.2.0 version: 19.2.0(@angular/animations@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)) @@ -468,7 +468,7 @@ importers: version: link:../../packages/openapi-ts '@types/jasmine': specifier: ~5.1.0 - version: 5.1.7 + version: 5.1.8 jasmine-core: specifier: ~5.2.0 version: 5.2.0 @@ -535,7 +535,7 @@ importers: version: 8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3) '@vitejs/plugin-react': specifier: 4.4.0-beta.1 - version: 4.4.0-beta.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) + version: 4.4.0-beta.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) autoprefixer: specifier: 10.4.19 version: 10.4.19(postcss@8.4.41) @@ -562,7 +562,7 @@ importers: version: 5.8.3 vite: specifier: 6.2.7 - version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) examples/openapi-ts-tanstack-svelte-query: dependencies: @@ -584,13 +584,13 @@ importers: version: 2.0.0 '@sveltejs/adapter-auto': specifier: 4.0.0 - version: 4.0.0(@sveltejs/kit@2.17.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)))(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))) + version: 4.0.0(@sveltejs/kit@2.17.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)))(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))) '@sveltejs/kit': specifier: 2.17.1 - version: 2.17.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)))(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) + version: 2.17.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)))(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) '@sveltejs/vite-plugin-svelte': specifier: 5.0.3 - version: 5.0.3(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) + version: 5.0.3(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) '@types/eslint': specifier: 9.6.0 version: 9.6.0 @@ -626,10 +626,10 @@ importers: version: 8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3) vite: specifier: 6.2.7 - version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) vitest: specifier: 3.1.1 - version: 3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + version: 3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) examples/openapi-ts-tanstack-vue-query: dependencies: @@ -669,10 +669,10 @@ importers: version: 22.10.5 '@vitejs/plugin-vue': specifier: 5.2.1 - version: 5.2.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3)) + version: 5.2.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: 4.1.1 - version: 4.1.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3)) + version: 4.1.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3)) '@vue/eslint-config-prettier': specifier: 10.1.0 version: 10.1.0(@types/eslint@9.6.0)(eslint@9.17.0(jiti@2.4.2))(prettier@3.4.2) @@ -714,13 +714,13 @@ importers: version: 5.8.3 vite: specifier: 6.2.7 - version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) vite-plugin-vue-devtools: specifier: 7.7.0 - version: 7.7.0(rollup@4.41.1)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3)) + version: 7.7.0(rollup@4.40.2)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3)) vitest: specifier: 3.1.1 - version: 3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + version: 3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) vue-tsc: specifier: 2.2.0 version: 2.2.0(typescript@5.8.3) @@ -729,10 +729,10 @@ importers: dependencies: vite: specifier: ^6.2.7 - version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) vitest: specifier: ^3.1.1 - version: 3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + version: 3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) devDependencies: typescript: specifier: ^5.8.3 @@ -760,7 +760,7 @@ importers: version: 1.7.4 nuxt: specifier: '>= 3.0.0 < 4' - version: 3.14.1592(@parcel/watcher@2.5.1)(@types/node@22.10.5)(db0@0.3.1)(encoding@0.1.13)(eslint@9.17.0(jiti@2.4.2))(ioredis@5.6.0)(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@3.29.5)(sass@1.85.0)(terser@5.39.0)(typescript@5.8.3)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) + version: 3.14.1592(@parcel/watcher@2.5.1)(@types/node@22.10.5)(db0@0.3.2)(encoding@0.1.13)(eslint@9.17.0(jiti@2.4.2))(ioredis@5.6.1)(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@3.29.5)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) vue: specifier: '>= 3.5.13 < 4' version: 3.5.13(typescript@5.8.3) @@ -773,16 +773,50 @@ importers: version: link:../openapi-ts '@nuxt/module-builder': specifier: 0.8.4 - version: 0.8.4(@nuxt/kit@3.15.4(magicast@0.3.5))(nuxi@3.22.5)(sass@1.85.0)(typescript@5.8.3) + version: 0.8.4(@nuxt/kit@3.15.4(magicast@0.3.5))(nuxi@3.25.1)(sass@1.85.0)(typescript@5.8.3) '@nuxt/schema': specifier: 3.16.2 version: 3.16.2 '@nuxt/test-utils': specifier: 3.17.2 - version: 3.17.2(@types/node@22.10.5)(@vue/test-utils@2.4.6)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(magicast@0.3.5)(sass@1.85.0)(terser@5.39.0)(typescript@5.8.3)(vitest@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))(yaml@2.8.0) + version: 3.17.2(@types/node@22.10.5)(@vue/test-utils@2.4.6)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(magicast@0.3.5)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vitest@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(yaml@2.8.0) vite: specifier: 6.2.7 - version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) + + packages/nx-plugin: + dependencies: + '@hey-api/json-schema-ref-parser': + specifier: 1.0.4 + version: 1.0.4 + '@hey-api/openapi-ts': + specifier: workspace:* + version: link:../openapi-ts + '@nx/devkit': + specifier: 20.7.2 + version: 20.7.2(nx@21.0.3) + latest-version: + specifier: 9.0.0 + version: 9.0.0 + openapi-diff: + specifier: 0.23.7 + version: 0.23.7(openapi-types@12.1.3) + tslib: + specifier: 2.8.1 + version: 2.8.1 + xcurl: + specifier: 2.1.2 + version: 2.1.2 + devDependencies: + '@config/vite-base': + specifier: workspace:* + version: link:../config-vite-base + typescript: + specifier: 5.8.3 + version: 5.8.3 + vitest: + specifier: 3.1.1 + version: 3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) packages/openapi-ts: dependencies: @@ -846,7 +880,7 @@ importers: version: 3.3.2 nuxt: specifier: 3.14.1592 - version: 3.14.1592(@parcel/watcher@2.5.1)(@types/node@22.10.5)(db0@0.3.1)(encoding@0.1.13)(eslint@9.17.0(jiti@2.4.2))(ioredis@5.6.0)(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.41.1)(sass@1.85.0)(terser@5.39.0)(typescript@5.8.3)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) + version: 3.14.1592(@parcel/watcher@2.5.1)(@types/node@22.10.5)(db0@0.3.2)(encoding@0.1.13)(eslint@9.17.0(jiti@2.4.2))(ioredis@5.6.1)(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.40.2)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)) prettier: specifier: 3.4.2 version: 3.4.2 @@ -870,7 +904,7 @@ importers: devDependencies: '@angular-devkit/build-angular': specifier: 19.2.0 - version: 19.2.0(@angular/compiler-cli@19.2.0(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.8.3))(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@types/node@22.10.5)(chokidar@4.0.3)(jiti@2.4.2)(karma@6.4.4)(tailwindcss@3.4.9(ts-node@10.9.2(@types/node@22.10.5)(typescript@5.8.3)))(typescript@5.8.3)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))(yaml@2.8.0) + version: 19.2.0(@angular/compiler-cli@19.2.0(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.8.3))(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@types/node@22.10.5)(chokidar@4.0.3)(jiti@2.4.2)(karma@6.4.4)(tailwindcss@3.4.9(ts-node@10.9.2(@types/node@22.10.5)(typescript@5.8.3)))(typescript@5.8.3)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(yaml@2.8.0) '@angular/animations': specifier: 19.2.0 version: 19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)) @@ -918,7 +952,7 @@ importers: version: 5.73.3(react@19.0.0) '@tanstack/solid-query': specifier: 5.73.3 - version: 5.73.3(solid-js@1.9.7) + version: 5.73.3(solid-js@1.9.6) '@tanstack/svelte-query': specifier: 5.73.3 version: 5.73.3(svelte@5.19.9) @@ -954,7 +988,7 @@ importers: version: 3.3.2 nuxt: specifier: 3.14.1592 - version: 3.14.1592(@parcel/watcher@2.5.1)(@types/node@22.10.5)(db0@0.3.1)(encoding@0.1.13)(eslint@9.17.0(jiti@2.4.2))(ioredis@5.6.0)(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.41.1)(sass@1.85.0)(terser@5.39.0)(typescript@5.8.3)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) + version: 3.14.1592(@parcel/watcher@2.5.1)(@types/node@22.10.5)(db0@0.3.2)(encoding@0.1.13)(eslint@9.17.0(jiti@2.4.2))(ioredis@5.6.1)(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.40.2)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) prettier: specifier: 3.4.2 version: 3.4.2 @@ -1023,7 +1057,7 @@ importers: version: 5.8.3 vite: specifier: 6.2.7 - version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) packages: @@ -1047,56 +1081,56 @@ packages: '@algolia/client-search': '>= 4.9.1 < 6' algoliasearch: '>= 4.9.1 < 6' - '@algolia/client-abtesting@5.21.0': - resolution: {integrity: sha512-I239aSmXa3pXDhp3AWGaIfesqJBNFA7drUM8SIfNxMIzvQXUnHRf4rW1o77QXLI/nIClNsb8KOLaB62gO9LnlQ==} + '@algolia/client-abtesting@5.25.0': + resolution: {integrity: sha512-1pfQulNUYNf1Tk/svbfjfkLBS36zsuph6m+B6gDkPEivFmso/XnRgwDvjAx80WNtiHnmeNjIXdF7Gos8+OLHqQ==} engines: {node: '>= 14.0.0'} - '@algolia/client-analytics@5.21.0': - resolution: {integrity: sha512-OxoUfeG9G4VE4gS7B4q65KkHzdGsQsDwxQfR5J9uKB8poSGuNlHJWsF3ABqCkc5VliAR0m8KMjsQ9o/kOpEGnQ==} + '@algolia/client-analytics@5.25.0': + resolution: {integrity: sha512-AFbG6VDJX/o2vDd9hqncj1B6B4Tulk61mY0pzTtzKClyTDlNP0xaUiEKhl6E7KO9I/x0FJF5tDCm0Hn6v5x18A==} engines: {node: '>= 14.0.0'} - '@algolia/client-common@5.21.0': - resolution: {integrity: sha512-iHLgDQFyZNe9M16vipbx6FGOA8NoMswHrfom/QlCGoyh7ntjGvfMb+J2Ss8rRsAlOWluv8h923Ku3QVaB0oWDQ==} + '@algolia/client-common@5.25.0': + resolution: {integrity: sha512-il1zS/+Rc6la6RaCdSZ2YbJnkQC6W1wiBO8+SH+DE6CPMWBU6iDVzH0sCKSAtMWl9WBxoN6MhNjGBnCv9Yy2bA==} engines: {node: '>= 14.0.0'} - '@algolia/client-insights@5.21.0': - resolution: {integrity: sha512-y7XBO9Iwb75FLDl95AYcWSLIViJTpR5SUUCyKsYhpP9DgyUqWbISqDLXc96TS9shj+H+7VsTKA9cJK8NUfVN6g==} + '@algolia/client-insights@5.25.0': + resolution: {integrity: sha512-blbjrUH1siZNfyCGeq0iLQu00w3a4fBXm0WRIM0V8alcAPo7rWjLbMJMrfBtzL9X5ic6wgxVpDADXduGtdrnkw==} engines: {node: '>= 14.0.0'} - '@algolia/client-personalization@5.21.0': - resolution: {integrity: sha512-6KU658lD9Tss4oCX6c/O15tNZxw7vR+WAUG95YtZzYG/KGJHTpy2uckqbMmC2cEK4a86FAq4pH5azSJ7cGMjuw==} + '@algolia/client-personalization@5.25.0': + resolution: {integrity: sha512-aywoEuu1NxChBcHZ1pWaat0Plw7A8jDMwjgRJ00Mcl7wGlwuPt5dJ/LTNcg3McsEUbs2MBNmw0ignXBw9Tbgow==} engines: {node: '>= 14.0.0'} - '@algolia/client-query-suggestions@5.21.0': - resolution: {integrity: sha512-pG6MyVh1v0X+uwrKHn3U+suHdgJ2C+gug+UGkNHfMELHMsEoWIAQhxMBOFg7hCnWBFjQnuq6qhM3X9X5QO3d9Q==} + '@algolia/client-query-suggestions@5.25.0': + resolution: {integrity: sha512-a/W2z6XWKjKjIW1QQQV8PTTj1TXtaKx79uR3NGBdBdGvVdt24KzGAaN7sCr5oP8DW4D3cJt44wp2OY/fZcPAVA==} engines: {node: '>= 14.0.0'} - '@algolia/client-search@5.21.0': - resolution: {integrity: sha512-nZfgJH4njBK98tFCmCW1VX/ExH4bNOl9DSboxeXGgvhoL0fG1+4DDr/mrLe21OggVCQqHwXBMh6fFInvBeyhiQ==} + '@algolia/client-search@5.25.0': + resolution: {integrity: sha512-9rUYcMIBOrCtYiLX49djyzxqdK9Dya/6Z/8sebPn94BekT+KLOpaZCuc6s0Fpfq7nx5J6YY5LIVFQrtioK9u0g==} engines: {node: '>= 14.0.0'} - '@algolia/ingestion@1.21.0': - resolution: {integrity: sha512-k6MZxLbZphGN5uRri9J/krQQBjUrqNcScPh985XXEFXbSCRvOPKVtjjLdVjGVHXXPOQgKrIZHxIdRNbHS+wVuA==} + '@algolia/ingestion@1.25.0': + resolution: {integrity: sha512-jJeH/Hk+k17Vkokf02lkfYE4A+EJX+UgnMhTLR/Mb+d1ya5WhE+po8p5a/Nxb6lo9OLCRl6w3Hmk1TX1e9gVbQ==} engines: {node: '>= 14.0.0'} - '@algolia/monitoring@1.21.0': - resolution: {integrity: sha512-FiW5nnmyHvaGdorqLClw3PM6keXexAMiwbwJ9xzQr4LcNefLG3ln82NafRPgJO/z0dETAOKjds5aSmEFMiITHQ==} + '@algolia/monitoring@1.25.0': + resolution: {integrity: sha512-Ls3i1AehJ0C6xaHe7kK9vPmzImOn5zBg7Kzj8tRYIcmCWVyuuFwCIsbuIIz/qzUf1FPSWmw0TZrGeTumk2fqXg==} engines: {node: '>= 14.0.0'} - '@algolia/recommend@5.21.0': - resolution: {integrity: sha512-+JXavbbliaLmah5QNgc/TDW/+r0ALa+rGhg5Y7+pF6GpNnzO0L+nlUaDNE8QbiJfz54F9BkwFUnJJeRJAuzTFw==} + '@algolia/recommend@5.25.0': + resolution: {integrity: sha512-79sMdHpiRLXVxSjgw7Pt4R1aNUHxFLHiaTDnN2MQjHwJ1+o3wSseb55T9VXU4kqy3m7TUme3pyRhLk5ip/S4Mw==} engines: {node: '>= 14.0.0'} - '@algolia/requester-browser-xhr@5.21.0': - resolution: {integrity: sha512-Iw+Yj5hOmo/iixHS94vEAQ3zi5GPpJywhfxn1el/zWo4AvPIte/+1h9Ywgw/+3M7YBj4jgAkScxjxQCxzLBsjA==} + '@algolia/requester-browser-xhr@5.25.0': + resolution: {integrity: sha512-JLaF23p1SOPBmfEqozUAgKHQrGl3z/Z5RHbggBu6s07QqXXcazEsub5VLonCxGVqTv6a61AAPr8J1G5HgGGjEw==} engines: {node: '>= 14.0.0'} - '@algolia/requester-fetch@5.21.0': - resolution: {integrity: sha512-Z00SRLlIFj3SjYVfsd9Yd3kB3dUwQFAkQG18NunWP7cix2ezXpJqA+xAoEf9vc4QZHdxU3Gm8gHAtRiM2iVaTQ==} + '@algolia/requester-fetch@5.25.0': + resolution: {integrity: sha512-rtzXwqzFi1edkOF6sXxq+HhmRKDy7tz84u0o5t1fXwz0cwx+cjpmxu/6OQKTdOJFS92JUYHsG51Iunie7xbqfQ==} engines: {node: '>= 14.0.0'} - '@algolia/requester-node-http@5.21.0': - resolution: {integrity: sha512-WqU0VumUILrIeVYCTGZlyyZoC/tbvhiyPxfGRRO1cSjxN558bnJLlR2BvS0SJ5b75dRNK7HDvtXo2QoP9eLfiA==} + '@algolia/requester-node-http@5.25.0': + resolution: {integrity: sha512-ZO0UKvDyEFvyeJQX0gmZDQEvhLZ2X10K+ps6hViMo1HgE2V8em00SwNsQ+7E/52a+YiBkVWX61pJJJE44juDMQ==} engines: {node: '>= 14.0.0'} '@alloc/quick-lru@5.2.0': @@ -1220,8 +1254,8 @@ packages: tailwindcss: optional: true - '@angular/cdk@19.2.2': - resolution: {integrity: sha512-YLiydMiTSf7s/LKaLgNeWawspulqdo/47zcjs1sEkHOcmyN1yR2Q0zQdgSbtsvuNikaR4NMNgTybNTDnULl64A==} + '@angular/cdk@19.2.16': + resolution: {integrity: sha512-67nbWqoiZIBc8nEaCn7GHd02bM5T9qAbJ5w+Zq4V19CL3oCtrCrS4CV3Lsoi5HETSmn4iZcYS/Dph8omCvNkew==} peerDependencies: '@angular/common': ^19.0.0 || ^20.0.0 '@angular/core': ^19.0.0 || ^20.0.0 @@ -1272,10 +1306,10 @@ packages: '@angular/platform-browser': 19.2.0 rxjs: ^6.5.3 || ^7.4.0 - '@angular/material@19.2.2': - resolution: {integrity: sha512-ChaxmiQkdtYJZCuTzh/LuOofg3/TLKDM/NtmlPrOA8GCEGX5oHQiu9NgJmdwi8LmGJL0lvFS1ftfVSjBTgHlxA==} + '@angular/material@19.2.16': + resolution: {integrity: sha512-SSky/3MBOTdCBWOEffmVdnnKaCX6T4r3CqK2TJCLqWsHarPz5jovYIacfOe1RJzXijmDxXK5+VYhS64PNJaa6g==} peerDependencies: - '@angular/cdk': 19.2.2 + '@angular/cdk': 19.2.16 '@angular/common': ^19.0.0 || ^20.0.0 '@angular/core': ^19.0.0 || ^20.0.0 '@angular/forms': ^19.0.0 || ^20.0.0 @@ -1314,6 +1348,24 @@ packages: '@antfu/utils@0.7.10': resolution: {integrity: sha512-+562v9k4aI80m1+VuMHehNJWLOFjBnXn3tdOitzD0il5b7smkSBal4+a3oKiQTbrwMmN/TBUMDvbdoWDehgOww==} + '@apidevtools/json-schema-ref-parser@9.0.9': + resolution: {integrity: sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w==} + + '@apidevtools/json-schema-ref-parser@9.1.2': + resolution: {integrity: sha512-r1w81DpR+KyRWd3f+rk6TNqMgedmAxZP5v5KWlXQWlgMUUtyEJch0DKEci1SorPMiSeM8XPl7MZ3miJ60JIpQg==} + + '@apidevtools/openapi-schemas@2.1.0': + resolution: {integrity: sha512-Zc1AlqrJlX3SlpupFGpiLi2EbteyP7fXmUOGup6/DnkRgjP9bgMM/ag+n91rsv0U1Gpz0H3VILA/o3bW7Ua6BQ==} + engines: {node: '>=10'} + + '@apidevtools/swagger-methods@3.0.2': + resolution: {integrity: sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg==} + + '@apidevtools/swagger-parser@10.0.3': + resolution: {integrity: sha512-sNiLY51vZOmSPFZA5TF35KZ2HbgYklQnTSDnkghamzLb3EkNtcQnrBQEj5AOCxHpTtXpqMCRM1CrmV2rG6nw4g==} + peerDependencies: + openapi-types: '>=7' + '@arethetypeswrong/cli@0.17.4': resolution: {integrity: sha512-AeiKxtf67XD/NdOqXgBOE5TZWH3EOCt+0GkbUpekOzngc+Q/cRZ5azjWyMxISxxfp0EItgm5NoSld9p7BAA5xQ==} engines: {node: '>=18'} @@ -1323,154 +1375,158 @@ packages: resolution: {integrity: sha512-Izvir8iIoU+X4SKtDAa5kpb+9cpifclzsbA8x/AZY0k0gIfXYQ1fa1B6Epfe6vNA2YfDX8VtrZFgvnXB6aPEoQ==} engines: {node: '>=18'} - '@babel/code-frame@7.26.2': - resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==} - engines: {node: '>=6.9.0'} - - '@babel/compat-data@7.26.8': - resolution: {integrity: sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ==} + '@babel/code-frame@7.27.1': + resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==} engines: {node: '>=6.9.0'} - '@babel/core@7.26.10': - resolution: {integrity: sha512-vMqyb7XCDMPvJFFOaT9kxtiRh42GwlZEg1/uIgtZshS5a/8OaduUfCi7kynKgc3Tw/6Uo2D+db9qBttghhmxwQ==} + '@babel/compat-data@7.27.2': + resolution: {integrity: sha512-TUtMJYRPyUb/9aU8f3K0mjmjf6M9N5Woshn2CS6nqJSeJtTtQcpLUXjGt9vbF8ZGff0El99sWkLgzwW3VXnxZQ==} engines: {node: '>=6.9.0'} '@babel/core@7.26.9': resolution: {integrity: sha512-lWBYIrF7qK5+GjY5Uy+/hEgp8OJWOD/rpy74GplYRhEauvbHDeFB8t5hPOZxCZ0Oxf4Cc36tK51/l3ymJysrKw==} engines: {node: '>=6.9.0'} - '@babel/generator@7.26.10': - resolution: {integrity: sha512-rRHT8siFIXQrAYOYqZQVsAr8vJ+cBNqcVAY6m5V8/4QqzaPl+zDBe6cLEPRDuNOUf3ww8RfJVlOyQMoSI+5Ang==} + '@babel/core@7.27.1': + resolution: {integrity: sha512-IaaGWsQqfsQWVLqMn9OB92MNN7zukfVA4s7KKAI0KfrrDsZ0yhi5uV4baBuLuN7n3vsZpwP8asPPcVwApxvjBQ==} engines: {node: '>=6.9.0'} '@babel/generator@7.26.9': resolution: {integrity: sha512-kEWdzjOAUMW4hAyrzJ0ZaTOu9OmpyDIQicIh0zg0EEcEkYXZb2TjtBhnHi2ViX7PKwZqF4xwqfAm299/QMP3lg==} engines: {node: '>=6.9.0'} + '@babel/generator@7.27.1': + resolution: {integrity: sha512-UnJfnIpc/+JO0/+KRVQNGU+y5taA5vCbwN8+azkX6beii/ZF+enZJSOKo11ZSzGJjlNfJHfQtmQT8H+9TXPG2w==} + engines: {node: '>=6.9.0'} + '@babel/helper-annotate-as-pure@7.25.9': resolution: {integrity: sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g==} engines: {node: '>=6.9.0'} - '@babel/helper-compilation-targets@7.26.5': - resolution: {integrity: sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA==} + '@babel/helper-annotate-as-pure@7.27.1': + resolution: {integrity: sha512-WnuuDILl9oOBbKnb4L+DyODx7iC47XfzmNCpTttFsSp6hTG7XZxu60+4IO+2/hPfcGOoKbFiwoI/+zwARbNQow==} + engines: {node: '>=6.9.0'} + + '@babel/helper-compilation-targets@7.27.2': + resolution: {integrity: sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==} engines: {node: '>=6.9.0'} - '@babel/helper-create-class-features-plugin@7.26.9': - resolution: {integrity: sha512-ubbUqCofvxPRurw5L8WTsCLSkQiVpov4Qx0WMA+jUN+nXBK8ADPlJO1grkFw5CWKC5+sZSOfuGMdX1aI1iT9Sg==} + '@babel/helper-create-class-features-plugin@7.27.1': + resolution: {integrity: sha512-QwGAmuvM17btKU5VqXfb+Giw4JcN0hjuufz3DYnpeVDvZLAObloM77bhMXiqry3Iio+Ai4phVRDwl6WU10+r5A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-create-regexp-features-plugin@7.26.3': - resolution: {integrity: sha512-G7ZRb40uUgdKOQqPLjfD12ZmGA54PzqDFUv2BKImnC9QIfGhIHKvVML0oN8IUiDq4iRqpq74ABpvOaerfWdong==} + '@babel/helper-create-regexp-features-plugin@7.27.1': + resolution: {integrity: sha512-uVDC72XVf8UbrH5qQTc18Agb8emwjTiZrQE11Nv3CuBEZmVvTwwE9CBUEvHku06gQCAyYf8Nv6ja1IN+6LMbxQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-define-polyfill-provider@0.6.3': - resolution: {integrity: sha512-HK7Bi+Hj6H+VTHA3ZvBis7V/6hu9QuTrnMXNybfUf2iiuU/N97I8VjB+KbhFF8Rld/Lx5MzoCwPCpPjfK+n8Cg==} + '@babel/helper-define-polyfill-provider@0.6.4': + resolution: {integrity: sha512-jljfR1rGnXXNWnmQg2K3+bvhkxB51Rl32QRaOTuwwjviGrHzIbSc8+x9CpraDtbT7mfyjXObULP4w/adunNwAw==} peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 - '@babel/helper-member-expression-to-functions@7.25.9': - resolution: {integrity: sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ==} + '@babel/helper-member-expression-to-functions@7.27.1': + resolution: {integrity: sha512-E5chM8eWjTp/aNoVpcbfM7mLxu9XGLWYise2eBKGQomAk/Mb4XoxyqXTZbuTohbsl8EKqdlMhnDI2CCLfcs9wA==} engines: {node: '>=6.9.0'} - '@babel/helper-module-imports@7.25.9': - resolution: {integrity: sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==} + '@babel/helper-module-imports@7.27.1': + resolution: {integrity: sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==} engines: {node: '>=6.9.0'} - '@babel/helper-module-transforms@7.26.0': - resolution: {integrity: sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==} + '@babel/helper-module-transforms@7.27.1': + resolution: {integrity: sha512-9yHn519/8KvTU5BjTVEEeIM3w9/2yXNKoD82JifINImhpKkARMJKPP59kLo+BafpdN5zgNeIcS4jsGDmd3l58g==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-optimise-call-expression@7.25.9': - resolution: {integrity: sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ==} + '@babel/helper-optimise-call-expression@7.27.1': + resolution: {integrity: sha512-URMGH08NzYFhubNSGJrpUEphGKQwMQYBySzat5cAByY1/YgIRkULnIy3tAMeszlL/so2HbeilYloUmSpd7GdVw==} engines: {node: '>=6.9.0'} - '@babel/helper-plugin-utils@7.26.5': - resolution: {integrity: sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg==} + '@babel/helper-plugin-utils@7.27.1': + resolution: {integrity: sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==} engines: {node: '>=6.9.0'} - '@babel/helper-remap-async-to-generator@7.25.9': - resolution: {integrity: sha512-IZtukuUeBbhgOcaW2s06OXTzVNJR0ybm4W5xC1opWFFJMZbwRj5LCk+ByYH7WdZPZTt8KnFwA8pvjN2yqcPlgw==} + '@babel/helper-remap-async-to-generator@7.27.1': + resolution: {integrity: sha512-7fiA521aVw8lSPeI4ZOD3vRFkoqkJcS+z4hFo82bFSH/2tNd6eJ5qCVMS5OzDmZh/kaHQeBaeyxK6wljcPtveA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-replace-supers@7.26.5': - resolution: {integrity: sha512-bJ6iIVdYX1YooY2X7w1q6VITt+LnUILtNk7zT78ykuwStx8BauCzxvFqFaHjOpW1bVnSUM1PN1f0p5P21wHxvg==} + '@babel/helper-replace-supers@7.27.1': + resolution: {integrity: sha512-7EHz6qDZc8RYS5ElPoShMheWvEgERonFCs7IAonWLLUTXW59DP14bCZt89/GKyreYn8g3S83m21FelHKbeDCKA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-skip-transparent-expression-wrappers@7.25.9': - resolution: {integrity: sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA==} + '@babel/helper-skip-transparent-expression-wrappers@7.27.1': + resolution: {integrity: sha512-Tub4ZKEXqbPjXgWLl2+3JpQAYBJ8+ikpQ2Ocj/q/r0LwE3UhENh7EUabyHjz2kCEsrRY83ew2DQdHluuiDQFzg==} engines: {node: '>=6.9.0'} '@babel/helper-split-export-declaration@7.24.7': resolution: {integrity: sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==} engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.25.9': - resolution: {integrity: sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==} + '@babel/helper-string-parser@7.27.1': + resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.25.9': - resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==} + '@babel/helper-validator-identifier@7.27.1': + resolution: {integrity: sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-option@7.25.9': - resolution: {integrity: sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==} + '@babel/helper-validator-option@7.27.1': + resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==} engines: {node: '>=6.9.0'} - '@babel/helper-wrap-function@7.25.9': - resolution: {integrity: sha512-ETzz9UTjQSTmw39GboatdymDq4XIQbR8ySgVrylRhPOFpsd+JrKHIuF0de7GCWmem+T4uC5z7EZguod7Wj4A4g==} + '@babel/helper-wrap-function@7.27.1': + resolution: {integrity: sha512-NFJK2sHUvrjo8wAU/nQTWU890/zB2jj0qBcCbZbbf+005cAsv6tMjXz31fBign6M5ov1o0Bllu+9nbqkfsjjJQ==} engines: {node: '>=6.9.0'} - '@babel/helpers@7.26.10': - resolution: {integrity: sha512-UPYc3SauzZ3JGgj87GgZ89JVdC5dj0AoetR5Bw6wj4niittNyFh6+eOGonYvJ1ao6B8lEa3Q3klS7ADZ53bc5g==} + '@babel/helpers@7.27.1': + resolution: {integrity: sha512-FCvFTm0sWV8Fxhpp2McP5/W53GPllQ9QeQ7SiqGWjMf/LVG07lFa5+pgK05IRhVwtvafT22KF+ZSnM9I545CvQ==} engines: {node: '>=6.9.0'} - '@babel/parser@7.26.10': - resolution: {integrity: sha512-6aQR2zGE/QFi8JpDLjUZEPYOs7+mhKXm86VaKFiLP35JQwQb6bwUE+XbvkH0EptsYhbNBSUGaUBLKqxH1xSgsA==} + '@babel/parser@7.27.2': + resolution: {integrity: sha512-QYLs8299NA7WM/bZAdp+CviYYkVoYXlDW2rzliy3chxd1PQjej7JORuMJDJXJUb9g0TT+B99EwaVLKmX+sPXWw==} engines: {node: '>=6.0.0'} hasBin: true - '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.25.9': - resolution: {integrity: sha512-ZkRyVkThtxQ/J6nv3JFYv1RYY+JT5BvU0y3k5bWrmuG4woXypRa4PXmm9RhOwodRkYFWqC0C0cqcJ4OqR7kW+g==} + '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.27.1': + resolution: {integrity: sha512-QPG3C9cCVRQLxAVwmefEmwdTanECuUBMQZ/ym5kiw3XKCGA7qkuQLcjWWHcrD/GKbn/WmJwaezfuuAOcyKlRPA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/plugin-bugfix-safari-class-field-initializer-scope@7.25.9': - resolution: {integrity: sha512-MrGRLZxLD/Zjj0gdU15dfs+HH/OXvnw/U4jJD8vpcP2CJQapPEv1IWwjc/qMg7ItBlPwSv1hRBbb7LeuANdcnw==} + '@babel/plugin-bugfix-safari-class-field-initializer-scope@7.27.1': + resolution: {integrity: sha512-qNeq3bCKnGgLkEXUuFry6dPlGfCdQNZbn7yUAPCInwAJHMU7THJfrBSozkcWq5sNM6RcF3S8XyQL2A52KNR9IA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.25.9': - resolution: {integrity: sha512-2qUwwfAFpJLZqxd02YW9btUCZHl+RFvdDkNfZwaIJrvB8Tesjsk8pEQkTvGwZXLqXUx/2oyY3ySRhm6HOXuCug==} + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.27.1': + resolution: {integrity: sha512-g4L7OYun04N1WyqMNjldFwlfPCLVkgB54A/YCXICZYBsvJJE3kByKv9c9+R/nAfmIfjl2rKYLNyMHboYbZaWaA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.25.9': - resolution: {integrity: sha512-6xWgLZTJXwilVjlnV7ospI3xi+sl8lN8rXXbBD6vYn3UYDlGsag8wrZkKcSI8G6KgqKP7vNFaDgeDnfAABq61g==} + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.27.1': + resolution: {integrity: sha512-oO02gcONcD5O1iTLi/6frMJBIwWEHceWGSGqrpCmEL8nogiS6J9PBlE48CaK20/Jx1LuRml9aDftLgdjXT8+Cw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.13.0 - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.25.9': - resolution: {integrity: sha512-aLnMXYPnzwwqhYSCyXfKkIkYgJ8zv9RK+roo9DkTXz38ynIhd9XCbN08s3MGvqL2MYGVUGdRQLL/JqBIeJhJBg==} + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.27.1': + resolution: {integrity: sha512-6BpaYGDavZqkI6yT+KSPdpZFfpnd68UKXbcjI9pJ13pvHhPrCKWOOLp+ysvMeA+DxnhuPpgIaRpxRxo5A9t5jw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/plugin-proposal-decorators@7.25.9': - resolution: {integrity: sha512-smkNLL/O1ezy9Nhy4CNosc4Va+1wo5w4gzSZeLe6y6dM4mmHfYOCPolXQPHQxonZCF+ZyebxN9vqOolkYrSn5g==} + '@babel/plugin-proposal-decorators@7.27.1': + resolution: {integrity: sha512-DTxe4LBPrtFdsWzgpmbBKevg3e9PBy+dXRt19kSbucbZvL2uqtdqwwpluL1jfxYE0wIDTFp1nTy/q6gNLsxXrg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1481,14 +1537,14 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-decorators@7.25.9': - resolution: {integrity: sha512-ryzI0McXUPJnRCvMo4lumIKZUzhYUO/ScI+Mz4YVaTLt04DHNSjEUjKVvbzQjZFLuod/cYEc07mJWhzl6v4DPg==} + '@babel/plugin-syntax-decorators@7.27.1': + resolution: {integrity: sha512-YMq8Z87Lhl8EGkmb0MwYkt36QnxC+fzCgrl66ereamPlYToRpIk5nUjKUY3QKLWq8mwUB1BgbeXcTJhZOCDg5A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-import-assertions@7.26.0': - resolution: {integrity: sha512-QCWT5Hh830hK5EQa7XzuqIkQU9tT/whqbDz7kuaZMHFl1inRRg7JnuAEOQ0Ur0QUl0NufCk1msK2BeY79Aj/eg==} + '@babel/plugin-syntax-import-assertions@7.27.1': + resolution: {integrity: sha512-UT/Jrhw57xg4ILHLFnzFpPDlMbcdEicaAtjPQpbj9wa8T4r5KVWCimHcL/460g8Ht0DMxDyjsLgiWSkVjnwPFg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1499,19 +1555,25 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-import-attributes@7.27.1': + resolution: {integrity: sha512-oFT0FrKHgF53f4vOsZGi2Hh3I35PfSmVs4IBFLFj4dnafP+hIWDLg3VyKmUHfLoLHlyxY4C7DGtmHuJgn+IGww==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-import-meta@7.10.4': resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-jsx@7.25.9': - resolution: {integrity: sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA==} + '@babel/plugin-syntax-jsx@7.27.1': + resolution: {integrity: sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-typescript@7.25.9': - resolution: {integrity: sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ==} + '@babel/plugin-syntax-typescript@7.27.1': + resolution: {integrity: sha512-xfYCBMxveHrRMnAWl1ZlPXOZjzkN82THFvLhQhFXFt81Z5HnN+EtUkZhv/zcKpmT3fzmWZB0ywiBrbC3vogbwQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1522,8 +1584,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0 - '@babel/plugin-transform-arrow-functions@7.25.9': - resolution: {integrity: sha512-6jmooXYIwn9ca5/RylZADJ+EnSxVUS5sjeJ9UPk6RWRzXCmOJCy6dqItPJFpw2cuCangPK4OYr5uhGKcmrm5Qg==} + '@babel/plugin-transform-arrow-functions@7.27.1': + resolution: {integrity: sha512-8Z4TGic6xW70FKThA5HYEKKyBpOOsucTOD1DjU3fZxDg+K3zBJcXMFnt/4yQiZnf5+MiOMSXQ9PaEK/Ilh1DeA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1540,242 +1602,242 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-block-scoped-functions@7.26.5': - resolution: {integrity: sha512-chuTSY+hq09+/f5lMj8ZSYgCFpppV2CbYrhNFJ1BFoXpiWPnnAb7R0MqrafCpN8E1+YRrtM1MXZHJdIx8B6rMQ==} + '@babel/plugin-transform-block-scoped-functions@7.27.1': + resolution: {integrity: sha512-cnqkuOtZLapWYZUYM5rVIdv1nXYuFVIltZ6ZJ7nIj585QsjKM5dhL2Fu/lICXZ1OyIAFc7Qy+bvDAtTXqGrlhg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-block-scoping@7.25.9': - resolution: {integrity: sha512-1F05O7AYjymAtqbsFETboN1NvBdcnzMerO+zlMyJBEz6WkMdejvGWw9p05iTSjC85RLlBseHHQpYaM4gzJkBGg==} + '@babel/plugin-transform-block-scoping@7.27.1': + resolution: {integrity: sha512-QEcFlMl9nGTgh1rn2nIeU5bkfb9BAjaQcWbiP4LvKxUot52ABcTkpcyJ7f2Q2U2RuQ84BNLgts3jRme2dTx6Fw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-class-properties@7.25.9': - resolution: {integrity: sha512-bbMAII8GRSkcd0h0b4X+36GksxuheLFjP65ul9w6C3KgAamI3JqErNgSrosX6ZPj+Mpim5VvEbawXxJCyEUV3Q==} + '@babel/plugin-transform-class-properties@7.27.1': + resolution: {integrity: sha512-D0VcalChDMtuRvJIu3U/fwWjf8ZMykz5iZsg77Nuj821vCKI3zCyRLwRdWbsuJ/uRwZhZ002QtCqIkwC/ZkvbA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-class-static-block@7.26.0': - resolution: {integrity: sha512-6J2APTs7BDDm+UMqP1useWqhcRAXo0WIoVj26N7kPFB6S73Lgvyka4KTZYIxtgYXiN5HTyRObA72N2iu628iTQ==} + '@babel/plugin-transform-class-static-block@7.27.1': + resolution: {integrity: sha512-s734HmYU78MVzZ++joYM+NkJusItbdRcbm+AGRgJCt3iA+yux0QpD9cBVdz3tKyrjVYWRl7j0mHSmv4lhV0aoA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.12.0 - '@babel/plugin-transform-classes@7.25.9': - resolution: {integrity: sha512-mD8APIXmseE7oZvZgGABDyM34GUmK45Um2TXiBUt7PnuAxrgoSVf123qUzPxEr/+/BHrRn5NMZCdE2m/1F8DGg==} + '@babel/plugin-transform-classes@7.27.1': + resolution: {integrity: sha512-7iLhfFAubmpeJe/Wo2TVuDrykh/zlWXLzPNdL0Jqn/Xu8R3QQ8h9ff8FQoISZOsw74/HFqFI7NX63HN7QFIHKA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-computed-properties@7.25.9': - resolution: {integrity: sha512-HnBegGqXZR12xbcTHlJ9HGxw1OniltT26J5YpfruGqtUHlz/xKf/G2ak9e+t0rVqrjXa9WOhvYPz1ERfMj23AA==} + '@babel/plugin-transform-computed-properties@7.27.1': + resolution: {integrity: sha512-lj9PGWvMTVksbWiDT2tW68zGS/cyo4AkZ/QTp0sQT0mjPopCmrSkzxeXkznjqBxzDI6TclZhOJbBmbBLjuOZUw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-destructuring@7.25.9': - resolution: {integrity: sha512-WkCGb/3ZxXepmMiX101nnGiU+1CAdut8oHyEOHxkKuS1qKpU2SMXE2uSvfz8PBuLd49V6LEsbtyPhWC7fnkgvQ==} + '@babel/plugin-transform-destructuring@7.27.1': + resolution: {integrity: sha512-ttDCqhfvpE9emVkXbPD8vyxxh4TWYACVybGkDj+oReOGwnp066ITEivDlLwe0b1R0+evJ13IXQuLNB5w1fhC5Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-dotall-regex@7.25.9': - resolution: {integrity: sha512-t7ZQ7g5trIgSRYhI9pIJtRl64KHotutUJsh4Eze5l7olJv+mRSg4/MmbZ0tv1eeqRbdvo/+trvJD/Oc5DmW2cA==} + '@babel/plugin-transform-dotall-regex@7.27.1': + resolution: {integrity: sha512-gEbkDVGRvjj7+T1ivxrfgygpT7GUd4vmODtYpbs0gZATdkX8/iSnOtZSxiZnsgm1YjTgjI6VKBGSJJevkrclzw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-duplicate-keys@7.25.9': - resolution: {integrity: sha512-LZxhJ6dvBb/f3x8xwWIuyiAHy56nrRG3PeYTpBkkzkYRRQ6tJLu68lEF5VIqMUZiAV7a8+Tb78nEoMCMcqjXBw==} + '@babel/plugin-transform-duplicate-keys@7.27.1': + resolution: {integrity: sha512-MTyJk98sHvSs+cvZ4nOauwTTG1JeonDjSGvGGUNHreGQns+Mpt6WX/dVzWBHgg+dYZhkC4X+zTDfkTU+Vy9y7Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-duplicate-named-capturing-groups-regex@7.25.9': - resolution: {integrity: sha512-0UfuJS0EsXbRvKnwcLjFtJy/Sxc5J5jhLHnFhy7u4zih97Hz6tJkLU+O+FMMrNZrosUPxDi6sYxJ/EA8jDiAog==} + '@babel/plugin-transform-duplicate-named-capturing-groups-regex@7.27.1': + resolution: {integrity: sha512-hkGcueTEzuhB30B3eJCbCYeCaaEQOmQR0AdvzpD4LoN0GXMWzzGSuRrxR2xTnCrvNbVwK9N6/jQ92GSLfiZWoQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/plugin-transform-dynamic-import@7.25.9': - resolution: {integrity: sha512-GCggjexbmSLaFhqsojeugBpeaRIgWNTcgKVq/0qIteFEqY2A+b9QidYadrWlnbWQUrW5fn+mCvf3tr7OeBFTyg==} + '@babel/plugin-transform-dynamic-import@7.27.1': + resolution: {integrity: sha512-MHzkWQcEmjzzVW9j2q8LGjwGWpG2mjwaaB0BNQwst3FIjqsg8Ct/mIZlvSPJvfi9y2AC8mi/ktxbFVL9pZ1I4A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-exponentiation-operator@7.26.3': - resolution: {integrity: sha512-7CAHcQ58z2chuXPWblnn1K6rLDnDWieghSOEmqQsrBenH0P9InCUtOJYD89pvngljmZlJcz3fcmgYsXFNGa1ZQ==} + '@babel/plugin-transform-exponentiation-operator@7.27.1': + resolution: {integrity: sha512-uspvXnhHvGKf2r4VVtBpeFnuDWsJLQ6MF6lGJLC89jBR1uoVeqM416AZtTuhTezOfgHicpJQmoD5YUakO/YmXQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-export-namespace-from@7.25.9': - resolution: {integrity: sha512-2NsEz+CxzJIVOPx2o9UsW1rXLqtChtLoVnwYHHiB04wS5sgn7mrV45fWMBX0Kk+ub9uXytVYfNP2HjbVbCB3Ww==} + '@babel/plugin-transform-export-namespace-from@7.27.1': + resolution: {integrity: sha512-tQvHWSZ3/jH2xuq/vZDy0jNn+ZdXJeM8gHvX4lnJmsc3+50yPlWdZXIc5ay+umX+2/tJIqHqiEqcJvxlmIvRvQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-for-of@7.26.9': - resolution: {integrity: sha512-Hry8AusVm8LW5BVFgiyUReuoGzPUpdHQQqJY5bZnbbf+ngOHWuCuYFKw/BqaaWlvEUrF91HMhDtEaI1hZzNbLg==} + '@babel/plugin-transform-for-of@7.27.1': + resolution: {integrity: sha512-BfbWFFEJFQzLCQ5N8VocnCtA8J1CLkNTe2Ms2wocj75dd6VpiqS5Z5quTYcUoo4Yq+DN0rtikODccuv7RU81sw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-function-name@7.25.9': - resolution: {integrity: sha512-8lP+Yxjv14Vc5MuWBpJsoUCd3hD6V9DgBon2FVYL4jJgbnVQ9fTgYmonchzZJOVNgzEgbxp4OwAf6xz6M/14XA==} + '@babel/plugin-transform-function-name@7.27.1': + resolution: {integrity: sha512-1bQeydJF9Nr1eBCMMbC+hdwmRlsv5XYOMu03YSWFwNs0HsAmtSxxF1fyuYPqemVldVyFmlCU7w8UE14LupUSZQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-json-strings@7.25.9': - resolution: {integrity: sha512-xoTMk0WXceiiIvsaquQQUaLLXSW1KJ159KP87VilruQm0LNNGxWzahxSS6T6i4Zg3ezp4vA4zuwiNUR53qmQAw==} + '@babel/plugin-transform-json-strings@7.27.1': + resolution: {integrity: sha512-6WVLVJiTjqcQauBhn1LkICsR2H+zm62I3h9faTDKt1qP4jn2o72tSvqMwtGFKGTpojce0gJs+76eZ2uCHRZh0Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-literals@7.25.9': - resolution: {integrity: sha512-9N7+2lFziW8W9pBl2TzaNht3+pgMIRP74zizeCSrtnSKVdUl8mAjjOP2OOVQAfZ881P2cNjDj1uAMEdeD50nuQ==} + '@babel/plugin-transform-literals@7.27.1': + resolution: {integrity: sha512-0HCFSepIpLTkLcsi86GG3mTUzxV5jpmbv97hTETW3yzrAij8aqlD36toB1D0daVFJM8NK6GvKO0gslVQmm+zZA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-logical-assignment-operators@7.25.9': - resolution: {integrity: sha512-wI4wRAzGko551Y8eVf6iOY9EouIDTtPb0ByZx+ktDGHwv6bHFimrgJM/2T021txPZ2s4c7bqvHbd+vXG6K948Q==} + '@babel/plugin-transform-logical-assignment-operators@7.27.1': + resolution: {integrity: sha512-SJvDs5dXxiae4FbSL1aBJlG4wvl594N6YEVVn9e3JGulwioy6z3oPjx/sQBO3Y4NwUu5HNix6KJ3wBZoewcdbw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-member-expression-literals@7.25.9': - resolution: {integrity: sha512-PYazBVfofCQkkMzh2P6IdIUaCEWni3iYEerAsRWuVd8+jlM1S9S9cz1dF9hIzyoZ8IA3+OwVYIp9v9e+GbgZhA==} + '@babel/plugin-transform-member-expression-literals@7.27.1': + resolution: {integrity: sha512-hqoBX4dcZ1I33jCSWcXrP+1Ku7kdqXf1oeah7ooKOIiAdKQ+uqftgCFNOSzA5AMS2XIHEYeGFg4cKRCdpxzVOQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-modules-amd@7.25.9': - resolution: {integrity: sha512-g5T11tnI36jVClQlMlt4qKDLlWnG5pP9CSM4GhdRciTNMRgkfpo5cR6b4rGIOYPgRRuFAvwjPQ/Yk+ql4dyhbw==} + '@babel/plugin-transform-modules-amd@7.27.1': + resolution: {integrity: sha512-iCsytMg/N9/oFq6n+gFTvUYDZQOMK5kEdeYxmxt91fcJGycfxVP9CnrxoliM0oumFERba2i8ZtwRUCMhvP1LnA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-modules-commonjs@7.26.3': - resolution: {integrity: sha512-MgR55l4q9KddUDITEzEFYn5ZsGDXMSsU9E+kh7fjRXTIC3RHqfCo8RPRbyReYJh44HQ/yomFkqbOFohXvDCiIQ==} + '@babel/plugin-transform-modules-commonjs@7.27.1': + resolution: {integrity: sha512-OJguuwlTYlN0gBZFRPqwOGNWssZjfIUdS7HMYtN8c1KmwpwHFBwTeFZrg9XZa+DFTitWOW5iTAG7tyCUPsCCyw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-modules-systemjs@7.25.9': - resolution: {integrity: sha512-hyss7iIlH/zLHaehT+xwiymtPOpsiwIIRlCAOwBB04ta5Tt+lNItADdlXw3jAWZ96VJ2jlhl/c+PNIQPKNfvcA==} + '@babel/plugin-transform-modules-systemjs@7.27.1': + resolution: {integrity: sha512-w5N1XzsRbc0PQStASMksmUeqECuzKuTJer7kFagK8AXgpCMkeDMO5S+aaFb7A51ZYDF7XI34qsTX+fkHiIm5yA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-modules-umd@7.25.9': - resolution: {integrity: sha512-bS9MVObUgE7ww36HEfwe6g9WakQ0KF07mQF74uuXdkoziUPfKyu/nIm663kz//e5O1nPInPFx36z7WJmJ4yNEw==} + '@babel/plugin-transform-modules-umd@7.27.1': + resolution: {integrity: sha512-iQBE/xC5BV1OxJbp6WG7jq9IWiD+xxlZhLrdwpPkTX3ydmXdvoCpyfJN7acaIBZaOqTfr76pgzqBJflNbeRK+w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-named-capturing-groups-regex@7.25.9': - resolution: {integrity: sha512-oqB6WHdKTGl3q/ItQhpLSnWWOpjUJLsOCLVyeFgeTktkBSCiurvPOsyt93gibI9CmuKvTUEtWmG5VhZD+5T/KA==} + '@babel/plugin-transform-named-capturing-groups-regex@7.27.1': + resolution: {integrity: sha512-SstR5JYy8ddZvD6MhV0tM/j16Qds4mIpJTOd1Yu9J9pJjH93bxHECF7pgtc28XvkzTD6Pxcm/0Z73Hvk7kb3Ng==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/plugin-transform-new-target@7.25.9': - resolution: {integrity: sha512-U/3p8X1yCSoKyUj2eOBIx3FOn6pElFOKvAAGf8HTtItuPyB+ZeOqfn+mvTtg9ZlOAjsPdK3ayQEjqHjU/yLeVQ==} + '@babel/plugin-transform-new-target@7.27.1': + resolution: {integrity: sha512-f6PiYeqXQ05lYq3TIfIDu/MtliKUbNwkGApPUvyo6+tc7uaR4cPjPe7DFPr15Uyycg2lZU6btZ575CuQoYh7MQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-nullish-coalescing-operator@7.26.6': - resolution: {integrity: sha512-CKW8Vu+uUZneQCPtXmSBUC6NCAUdya26hWCElAWh5mVSlSRsmiCPUUDKb3Z0szng1hiAJa098Hkhg9o4SE35Qw==} + '@babel/plugin-transform-nullish-coalescing-operator@7.27.1': + resolution: {integrity: sha512-aGZh6xMo6q9vq1JGcw58lZ1Z0+i0xB2x0XaauNIUXd6O1xXc3RwoWEBlsTQrY4KQ9Jf0s5rgD6SiNkaUdJegTA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-numeric-separator@7.25.9': - resolution: {integrity: sha512-TlprrJ1GBZ3r6s96Yq8gEQv82s8/5HnCVHtEJScUj90thHQbwe+E5MLhi2bbNHBEJuzrvltXSru+BUxHDoog7Q==} + '@babel/plugin-transform-numeric-separator@7.27.1': + resolution: {integrity: sha512-fdPKAcujuvEChxDBJ5c+0BTaS6revLV7CJL08e4m3de8qJfNIuCc2nc7XJYOjBoTMJeqSmwXJ0ypE14RCjLwaw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-object-rest-spread@7.25.9': - resolution: {integrity: sha512-fSaXafEE9CVHPweLYw4J0emp1t8zYTXyzN3UuG+lylqkvYd7RMrsOQ8TYx5RF231be0vqtFC6jnx3UmpJmKBYg==} + '@babel/plugin-transform-object-rest-spread@7.27.2': + resolution: {integrity: sha512-AIUHD7xJ1mCrj3uPozvtngY3s0xpv7Nu7DoUSnzNY6Xam1Cy4rUznR//pvMHOhQ4AvbCexhbqXCtpxGHOGOO6g==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-object-super@7.25.9': - resolution: {integrity: sha512-Kj/Gh+Rw2RNLbCK1VAWj2U48yxxqL2x0k10nPtSdRa0O2xnHXalD0s+o1A6a0W43gJ00ANo38jxkQreckOzv5A==} + '@babel/plugin-transform-object-super@7.27.1': + resolution: {integrity: sha512-SFy8S9plRPbIcxlJ8A6mT/CxFdJx/c04JEctz4jf8YZaVS2px34j7NXRrlGlHkN/M2gnpL37ZpGRGVFLd3l8Ng==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-optional-catch-binding@7.25.9': - resolution: {integrity: sha512-qM/6m6hQZzDcZF3onzIhZeDHDO43bkNNlOX0i8n3lR6zLbu0GN2d8qfM/IERJZYauhAHSLHy39NF0Ctdvcid7g==} + '@babel/plugin-transform-optional-catch-binding@7.27.1': + resolution: {integrity: sha512-txEAEKzYrHEX4xSZN4kJ+OfKXFVSWKB2ZxM9dpcE3wT7smwkNmXo5ORRlVzMVdJbD+Q8ILTgSD7959uj+3Dm3Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-optional-chaining@7.25.9': - resolution: {integrity: sha512-6AvV0FsLULbpnXeBjrY4dmWF8F7gf8QnvTEoO/wX/5xm/xE1Xo8oPuD3MPS+KS9f9XBEAWN7X1aWr4z9HdOr7A==} + '@babel/plugin-transform-optional-chaining@7.27.1': + resolution: {integrity: sha512-BQmKPPIuc8EkZgNKsv0X4bPmOoayeu4F1YCwx2/CfmDSXDbp7GnzlUH+/ul5VGfRg1AoFPsrIThlEBj2xb4CAg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-parameters@7.25.9': - resolution: {integrity: sha512-wzz6MKwpnshBAiRmn4jR8LYz/g8Ksg0o80XmwZDlordjwEk9SxBzTWC7F5ef1jhbrbOW2DJ5J6ayRukrJmnr0g==} + '@babel/plugin-transform-parameters@7.27.1': + resolution: {integrity: sha512-018KRk76HWKeZ5l4oTj2zPpSh+NbGdt0st5S6x0pga6HgrjBOJb24mMDHorFopOOd6YHkLgOZ+zaCjZGPO4aKg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-private-methods@7.25.9': - resolution: {integrity: sha512-D/JUozNpQLAPUVusvqMxyvjzllRaF8/nSrP1s2YGQT/W4LHK4xxsMcHjhOGTS01mp9Hda8nswb+FblLdJornQw==} + '@babel/plugin-transform-private-methods@7.27.1': + resolution: {integrity: sha512-10FVt+X55AjRAYI9BrdISN9/AQWHqldOeZDUoLyif1Kn05a56xVBXb8ZouL8pZ9jem8QpXaOt8TS7RHUIS+GPA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-private-property-in-object@7.25.9': - resolution: {integrity: sha512-Evf3kcMqzXA3xfYJmZ9Pg1OvKdtqsDMSWBDzZOPLvHiTt36E75jLDQo5w1gtRU95Q4E5PDttrTf25Fw8d/uWLw==} + '@babel/plugin-transform-private-property-in-object@7.27.1': + resolution: {integrity: sha512-5J+IhqTi1XPa0DXF83jYOaARrX+41gOewWbkPyjMNRDqgOCqdffGh8L3f/Ek5utaEBZExjSAzcyjmV9SSAWObQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-property-literals@7.25.9': - resolution: {integrity: sha512-IvIUeV5KrS/VPavfSM/Iu+RE6llrHrYIKY1yfCzyO/lMXHQ+p7uGhonmGVisv6tSBSVgWzMBohTcvkC9vQcQFA==} + '@babel/plugin-transform-property-literals@7.27.1': + resolution: {integrity: sha512-oThy3BCuCha8kDZ8ZkgOg2exvPYUlprMukKQXI1r1pJ47NCvxfkEy8vK+r/hT9nF0Aa4H1WUPZZjHTFtAhGfmQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-react-jsx-self@7.25.9': - resolution: {integrity: sha512-y8quW6p0WHkEhmErnfe58r7x0A70uKphQm8Sp8cV7tjNQwK56sNVK0M73LK3WuYmsuyrftut4xAkjjgU0twaMg==} + '@babel/plugin-transform-react-jsx-self@7.27.1': + resolution: {integrity: sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-react-jsx-source@7.25.9': - resolution: {integrity: sha512-+iqjT8xmXhhYv4/uiYd8FNQsraMFZIfxVSqxxVSZP0WbbSAWvBXAul0m/zu+7Vv4O/3WtApy9pmaTMiumEZgfg==} + '@babel/plugin-transform-react-jsx-source@7.27.1': + resolution: {integrity: sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-regenerator@7.25.9': - resolution: {integrity: sha512-vwDcDNsgMPDGP0nMqzahDWE5/MLcX8sv96+wfX7as7LoF/kr97Bo/7fI00lXY4wUXYfVmwIIyG80fGZ1uvt2qg==} + '@babel/plugin-transform-regenerator@7.27.1': + resolution: {integrity: sha512-B19lbbL7PMrKr52BNPjCqg1IyNUIjTcxKj8uX9zHO+PmWN93s19NDr/f69mIkEp2x9nmDJ08a7lgHaTTzvW7mw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-regexp-modifiers@7.26.0': - resolution: {integrity: sha512-vN6saax7lrA2yA/Pak3sCxuD6F5InBjn9IcrIKQPjpsLvuHYLVroTxjdlVRHjjBWxKOqIwpTXDkOssYT4BFdRw==} + '@babel/plugin-transform-regexp-modifiers@7.27.1': + resolution: {integrity: sha512-TtEciroaiODtXvLZv4rmfMhkCv8jx3wgKpL68PuiPh2M4fvz5jhsA7697N1gMvkvr/JTF13DrFYyEbY9U7cVPA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/plugin-transform-reserved-words@7.25.9': - resolution: {integrity: sha512-7DL7DKYjn5Su++4RXu8puKZm2XBPHyjWLUidaPEkCUBbE7IPcsrkRHggAOOKydH1dASWdcUBxrkOGNxUv5P3Jg==} + '@babel/plugin-transform-reserved-words@7.27.1': + resolution: {integrity: sha512-V2ABPHIJX4kC7HegLkYoDpfg9PVmuWy/i6vUM5eGK22bx4YVFD3M5F0QQnWQoDs6AGsUWTVOopBiMFQgHaSkVw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1786,62 +1848,62 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-shorthand-properties@7.25.9': - resolution: {integrity: sha512-MUv6t0FhO5qHnS/W8XCbHmiRWOphNufpE1IVxhK5kuN3Td9FT1x4rx4K42s3RYdMXCXpfWkGSbCSd0Z64xA7Ng==} + '@babel/plugin-transform-shorthand-properties@7.27.1': + resolution: {integrity: sha512-N/wH1vcn4oYawbJ13Y/FxcQrWk63jhfNa7jef0ih7PHSIHX2LB7GWE1rkPrOnka9kwMxb6hMl19p7lidA+EHmQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-spread@7.25.9': - resolution: {integrity: sha512-oNknIB0TbURU5pqJFVbOOFspVlrpVwo2H1+HUIsVDvp5VauGGDP1ZEvO8Nn5xyMEs3dakajOxlmkNW7kNgSm6A==} + '@babel/plugin-transform-spread@7.27.1': + resolution: {integrity: sha512-kpb3HUqaILBJcRFVhFUs6Trdd4mkrzcGXss+6/mxUd273PfbWqSDHRzMT2234gIg2QYfAjvXLSquP1xECSg09Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-sticky-regex@7.25.9': - resolution: {integrity: sha512-WqBUSgeVwucYDP9U/xNRQam7xV8W5Zf+6Eo7T2SRVUFlhRiMNFdFz58u0KZmCVVqs2i7SHgpRnAhzRNmKfi2uA==} + '@babel/plugin-transform-sticky-regex@7.27.1': + resolution: {integrity: sha512-lhInBO5bi/Kowe2/aLdBAawijx+q1pQzicSgnkB6dUPc1+RC8QmJHKf2OjvU+NZWitguJHEaEmbV6VWEouT58g==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-template-literals@7.26.8': - resolution: {integrity: sha512-OmGDL5/J0CJPJZTHZbi2XpO0tyT2Ia7fzpW5GURwdtp2X3fMmN8au/ej6peC/T33/+CRiIpA8Krse8hFGVmT5Q==} + '@babel/plugin-transform-template-literals@7.27.1': + resolution: {integrity: sha512-fBJKiV7F2DxZUkg5EtHKXQdbsbURW3DZKQUWphDum0uRP6eHGGa/He9mc0mypL680pb+e/lDIthRohlv8NCHkg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-typeof-symbol@7.26.7': - resolution: {integrity: sha512-jfoTXXZTgGg36BmhqT3cAYK5qkmqvJpvNrPhaK/52Vgjhw4Rq29s9UqpWWV0D6yuRmgiFH/BUVlkl96zJWqnaw==} + '@babel/plugin-transform-typeof-symbol@7.27.1': + resolution: {integrity: sha512-RiSILC+nRJM7FY5srIyc4/fGIwUhyDuuBSdWn4y6yT6gm652DpCHZjIipgn6B7MQ1ITOUnAKWixEUjQRIBIcLw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-typescript@7.26.8': - resolution: {integrity: sha512-bME5J9AC8ChwA7aEPJ6zym3w7aObZULHhbNLU0bKUhKsAkylkzUdq+0kdymh9rzi8nlNFl2bmldFBCKNJBUpuw==} + '@babel/plugin-transform-typescript@7.27.1': + resolution: {integrity: sha512-Q5sT5+O4QUebHdbwKedFBEwRLb02zJ7r4A5Gg2hUoLuU3FjdMcyqcywqUrLCaDsFCxzokf7u9kuy7qz51YUuAg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-unicode-escapes@7.25.9': - resolution: {integrity: sha512-s5EDrE6bW97LtxOcGj1Khcx5AaXwiMmi4toFWRDP9/y0Woo6pXC+iyPu/KuhKtfSrNFd7jJB+/fkOtZy6aIC6Q==} + '@babel/plugin-transform-unicode-escapes@7.27.1': + resolution: {integrity: sha512-Ysg4v6AmF26k9vpfFuTZg8HRfVWzsh1kVfowA23y9j/Gu6dOuahdUVhkLqpObp3JIv27MLSii6noRnuKN8H0Mg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-unicode-property-regex@7.25.9': - resolution: {integrity: sha512-Jt2d8Ga+QwRluxRQ307Vlxa6dMrYEMZCgGxoPR8V52rxPyldHu3hdlHspxaqYmE7oID5+kB+UKUB/eWS+DkkWg==} + '@babel/plugin-transform-unicode-property-regex@7.27.1': + resolution: {integrity: sha512-uW20S39PnaTImxp39O5qFlHLS9LJEmANjMG7SxIhap8rCHqu0Ik+tLEPX5DKmHn6CsWQ7j3lix2tFOa5YtL12Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-unicode-regex@7.25.9': - resolution: {integrity: sha512-yoxstj7Rg9dlNn9UQxzk4fcNivwv4nUYz7fYXBaKxvw/lnmPuOm/ikoELygbYq68Bls3D/D+NBPHiLwZdZZ4HA==} + '@babel/plugin-transform-unicode-regex@7.27.1': + resolution: {integrity: sha512-xvINq24TRojDuyt6JGtHmkVkrfVV3FPT16uytxImLeBZqW3/H52yN+kM1MGuyPkIQxrzKwPHs5U/MP3qKyzkGw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-unicode-sets-regex@7.25.9': - resolution: {integrity: sha512-8BYqO3GeVNHtx69fdPshN3fnzUNLrWdHhk/icSwigksJGczKSizZ+Z6SBCxTs723Fr5VSNorTIK7a+R2tISvwQ==} + '@babel/plugin-transform-unicode-sets-regex@7.27.1': + resolution: {integrity: sha512-EtkOujbc4cgvb0mlpQefi4NTPBzhSIevblFevACNLUspmrALgmEBdL/XfnyyITfd8fKBZrZys92zOWcik7j9Tw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 @@ -1857,42 +1919,42 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 || ^8.0.0-0 <8.0.0 - '@babel/runtime@7.26.10': - resolution: {integrity: sha512-2WJMeRQPHKSPemqk/awGrAiuFfzBmOIPXKizAsVhWH9YJqLZ0H+HS4c8loHGgW6utJ3E/ejXQUsiGaQy2NZ9Fw==} - engines: {node: '>=6.9.0'} - '@babel/runtime@7.26.9': resolution: {integrity: sha512-aA63XwOkcl4xxQa3HjPMqOP6LiK0ZDv3mUPYEFXkpHbaFjtGggE1A61FjFzJnB+p7/oy2gA8E+rcBNl/zC1tMg==} engines: {node: '>=6.9.0'} - '@babel/standalone@7.26.10': - resolution: {integrity: sha512-AYXK0hLWfEaK9WAePJqs30qro09a8w7X3YZzjukqtLXreE7xBZYdi5EMrP87T4UrVqmQ9tIX6L6SeTu5LDh3zw==} + '@babel/runtime@7.27.1': + resolution: {integrity: sha512-1x3D2xEk2fRo3PAhwQwu5UubzgiVWSXTBfWpVd2Mx2AzRqJuDJCsgaDVZ7HB5iGzDW1Hl1sWN2mFyKjmR9uAog==} + engines: {node: '>=6.9.0'} + + '@babel/standalone@7.27.2': + resolution: {integrity: sha512-fO5toB6PVy7WFfAtXScY1xzwbTOgzxNw+eIiYpjPy9dNeTVscu59fX68JBz+iOZ/ZHsVBjQa4y7yent7eTDgXg==} engines: {node: '>=6.9.0'} - '@babel/template@7.26.9': - resolution: {integrity: sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA==} + '@babel/template@7.27.2': + resolution: {integrity: sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==} engines: {node: '>=6.9.0'} - '@babel/traverse@7.26.10': - resolution: {integrity: sha512-k8NuDrxr0WrPH5Aupqb2LCVURP/S0vBEn5mK6iH+GIYob66U5EtoZvcdudR2jQ4cmTwhEwW1DLB+Yyas9zjF6A==} + '@babel/traverse@7.27.1': + resolution: {integrity: sha512-ZCYtZciz1IWJB4U61UPu4KEaqyfj+r5T1Q5mqPo+IBpcG9kHv30Z0aD8LXPgC1trYa6rK0orRyAhqUgk4MjmEg==} engines: {node: '>=6.9.0'} - '@babel/types@7.26.10': - resolution: {integrity: sha512-emqcG3vHrpxUKTrxcblR36dcrcoRDvKmnL/dCL6ZsHaShW80qxCAcNhzQZrpeM765VzEos+xOi4s+r4IXzTwdQ==} + '@babel/types@7.27.1': + resolution: {integrity: sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==} engines: {node: '>=6.9.0'} '@bcoe/v8-coverage@1.0.2': resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==} engines: {node: '>=18'} - '@braidai/lang@1.1.0': - resolution: {integrity: sha512-xyJYkiyNQtTyCLeHxZmOs7rnB94D+N1IjKNArQIh8+8lTBOY7TFgwEV+Ow5a1uaBi5j2w9fLbWcJFTWLDItl5g==} + '@braidai/lang@1.1.1': + resolution: {integrity: sha512-5uM+no3i3DafVgkoW7ayPhEGHNNBZCSj5TrGDQt0ayEKQda5f3lAXlmQg0MR5E0gKgmTzUUEtSWHsEC3h9jUcg==} - '@changesets/apply-release-plan@7.0.10': - resolution: {integrity: sha512-wNyeIJ3yDsVspYvHnEz1xQDq18D9ifed3lI+wxRQRK4pArUcuHgCTrHv0QRnnwjhVCQACxZ+CBih3wgOct6UXw==} + '@changesets/apply-release-plan@7.0.12': + resolution: {integrity: sha512-EaET7As5CeuhTzvXTQCRZeBUcisoYPDDcXvgTE/2jmmypKp0RC7LxKj/yzqeh/1qFTZI7oDGFcL1PHRuQuketQ==} - '@changesets/assemble-release-plan@6.0.6': - resolution: {integrity: sha512-Frkj8hWJ1FRZiY3kzVCKzS0N5mMwWKwmv9vpam7vt8rZjLL1JMthdh6pSDVSPumHPshTTkKZ0VtNbE0cJHZZUg==} + '@changesets/assemble-release-plan@6.0.8': + resolution: {integrity: sha512-y8+8LvZCkKJdbUlpXFuqcavpzJR80PN0OIfn8HZdwK7Sh6MgLXm4hKY5vu6/NDoKp8lAlM4ERZCqRMLxP4m+MQ==} '@changesets/changelog-git@0.2.1': resolution: {integrity: sha512-x/xEleCFLH28c3bQeQIyeZf8lFXyDFVn1SgcBiR2Tw/r4IAWlk1fzxCEZ6NxQAjF2Nwtczoen3OA2qR+UawQ8Q==} @@ -1916,14 +1978,14 @@ packages: '@changesets/get-github-info@0.6.0': resolution: {integrity: sha512-v/TSnFVXI8vzX9/w3DU2Ol+UlTZcu3m0kXTjTT4KlAdwSvwutcByYwyYn9hwerPWfPkT2JfpoX0KgvCEi8Q/SA==} - '@changesets/get-release-plan@4.0.8': - resolution: {integrity: sha512-MM4mq2+DQU1ZT7nqxnpveDMTkMBLnwNX44cX7NSxlXmr7f8hO6/S2MXNiXG54uf/0nYnefv0cfy4Czf/ZL/EKQ==} + '@changesets/get-release-plan@4.0.12': + resolution: {integrity: sha512-KukdEgaafnyGryUwpHG2kZ7xJquOmWWWk5mmoeQaSvZTWH1DC5D/Sw6ClgGFYtQnOMSQhgoEbDxAbpIIayKH1g==} '@changesets/get-version-range-type@0.4.0': resolution: {integrity: sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ==} - '@changesets/git@3.0.2': - resolution: {integrity: sha512-r1/Kju9Y8OxRRdvna+nxpQIsMsRQn9dhhAZt94FLDeu0Hij2hnOozW8iqnHBgvu+KdnJppCveQwK4odwfw/aWQ==} + '@changesets/git@3.0.4': + resolution: {integrity: sha512-BXANzRFkX+XcC1q/d27NKvlJ1yf7PSAgi8JG6dt8EfbHFHi4neau7mufcSca5zRhwOL8j9s6EqsxmT+s+/E6Sw==} '@changesets/logger@0.1.1': resolution: {integrity: sha512-OQtR36ZlnuTxKqoW4Sv6x5YIhOmClRd5pWsjZsddYxpWs517R0HkyiefQPIytCVh4ZcC5x9XaG8KTdd5iRQUfg==} @@ -1934,8 +1996,8 @@ packages: '@changesets/pre@2.0.2': resolution: {integrity: sha512-HaL/gEyFVvkf9KFg6484wR9s0qjAXlZ8qWPDkTyKF6+zqjBe/I2mygg3MbpZ++hdi0ToqNUF8cjj7fBy0dg8Ug==} - '@changesets/read@0.6.3': - resolution: {integrity: sha512-9H4p/OuJ3jXEUTjaVGdQEhBdqoT2cO5Ts95JTFsQyawmKzpL8FnIeJSyhTDPW1MBRDnwZlHFEM9SpPwJDY5wIg==} + '@changesets/read@0.6.5': + resolution: {integrity: sha512-UPzNGhsSjHD3Veb0xO/MwvasGe8eMyNrR/sT9gR8Q3DhOQZirgKhhXv/8hVsI0QpPjR004Z9iFxoJU6in3uGMg==} '@changesets/should-skip-package@0.1.2': resolution: {integrity: sha512-qAK/WrqWLNCP22UDdBTMPH5f41elVDlsNyat180A33dWxuUDyNpg6fPi/FyTZwRriVjg0L8gnjJn2F9XAoF0qw==} @@ -1949,18 +2011,29 @@ packages: '@changesets/write@0.3.2': resolution: {integrity: sha512-kDxDrPNpUgsjDbWBvUo27PzKX4gqeKOlhibaOXDJA6kuBisGqNHv/HwGJrAu8U/dSf8ZEFIeHIPtvSlZI1kULw==} - '@cloudflare/kv-asset-handler@0.3.4': - resolution: {integrity: sha512-YLPHc8yASwjNkmcDMQMY35yiWjoKAKnhUbPRszBRS0YgH+IXtsMp61j+yTcnCE3oO2DgP0U3iejLC8FTtKDC8Q==} - engines: {node: '>=16.13'} + '@cloudflare/kv-asset-handler@0.4.0': + resolution: {integrity: sha512-+tv3z+SPp+gqTIcImN9o0hqE9xyfQjI1XD9pL6NuKjua9B1y7mNYv0S9cP+QEbA4ppVgGZEmKOvHX5G5Ei1CVA==} + engines: {node: '>=18.0.0'} '@colors/colors@1.5.0': resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==} engines: {node: '>=0.1.90'} + '@colors/colors@1.6.0': + resolution: {integrity: sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==} + engines: {node: '>=0.1.90'} + '@cspotcode/source-map-support@0.8.1': resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} + '@dabh/diagnostics@2.0.3': + resolution: {integrity: sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==} + + '@dependents/detective-less@4.1.0': + resolution: {integrity: sha512-KrkT6qO5NxqNfy68sBl6CTSoJ4SNDIS5iQArkibhlbGU4LaDukZ3q2HIkh8aUKDio6o4itU4xDR7t82Y2eP1Bg==} + engines: {node: '>=14'} + '@discoveryjs/json-ext@0.6.3': resolution: {integrity: sha512-4B4OijXeVNOPZlYA2oEwWOTkzyltLao+xbotHQeqN++Rv27Y6s818+n2Qkp8q+Fxhn0t/5lA5X1Mxktud8eayQ==} engines: {node: '>=14.17.0'} @@ -1988,8 +2061,14 @@ packages: search-insights: optional: true - '@emnapi/runtime@1.3.1': - resolution: {integrity: sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw==} + '@emnapi/core@1.4.3': + resolution: {integrity: sha512-4m62DuCE07lw01soJwPiBGC0nAww0Q+RY70VZ+n49yDIO13yyinhbWCeNnaob0lakDtWQzSdtNWzJeOJt2ma+g==} + + '@emnapi/runtime@1.4.3': + resolution: {integrity: sha512-pBPWdu6MLKROBX05wSNKcNb++m5Er+KQ9QkB+WVM+pW2Kx9hoSrVTnu3BdkI5eBLZoKu/J6mW/B6i6bJB2ytXQ==} + + '@emnapi/wasi-threads@1.0.2': + resolution: {integrity: sha512-5n3nTJblwRi8LlXkJ9eBzu+kZR8Yxcc7ubakyQTFzPMtIhFpUBRbsnc2Dv88IZDIbCDlBiWrknhB4Lsz7mg6BA==} '@esbuild/aix-ppc64@0.19.12': resolution: {integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==} @@ -2015,14 +2094,8 @@ packages: cpu: [ppc64] os: [aix] - '@esbuild/aix-ppc64@0.25.2': - resolution: {integrity: sha512-wCIboOL2yXZym2cgm6mlA742s9QeJ8DjGVaL39dLN4rRwrOgOyYSnOaFPhKZGLb2ngj4EyfAFjsNJwPXZvseag==} - engines: {node: '>=18'} - cpu: [ppc64] - os: [aix] - - '@esbuild/aix-ppc64@0.25.5': - resolution: {integrity: sha512-9o3TMmpmftaCMepOdA5k/yDw8SfInyzWWTjYTFCX3kPSDJMROQTb8jg+h9Cnwnmm1vOzvxN7gIfB5V2ewpjtGA==} + '@esbuild/aix-ppc64@0.25.4': + resolution: {integrity: sha512-1VCICWypeQKhVbE9oW/sJaAmjLxhVqacdkvPLEjwlttjfwENRSClS8EjBz0KzRyFSCPDIkuXW34Je/vk7zdB7Q==} engines: {node: '>=18'} cpu: [ppc64] os: [aix] @@ -2051,14 +2124,8 @@ packages: cpu: [arm64] os: [android] - '@esbuild/android-arm64@0.25.2': - resolution: {integrity: sha512-5ZAX5xOmTligeBaeNEPnPaeEuah53Id2tX4c2CVP3JaROTH+j4fnfHCkr1PjXMd78hMst+TlkfKcW/DlTq0i4w==} - engines: {node: '>=18'} - cpu: [arm64] - os: [android] - - '@esbuild/android-arm64@0.25.5': - resolution: {integrity: sha512-VGzGhj4lJO+TVGV1v8ntCZWJktV7SGCs3Pn1GRWI1SBFtRALoomm8k5E9Pmwg3HOAal2VDc2F9+PM/rEY6oIDg==} + '@esbuild/android-arm64@0.25.4': + resolution: {integrity: sha512-bBy69pgfhMGtCnwpC/x5QhfxAz/cBgQ9enbtwjf6V9lnPI/hMyT9iWpR1arm0l3kttTr4L0KSLpKmLp/ilKS9A==} engines: {node: '>=18'} cpu: [arm64] os: [android] @@ -2087,14 +2154,8 @@ packages: cpu: [arm] os: [android] - '@esbuild/android-arm@0.25.2': - resolution: {integrity: sha512-NQhH7jFstVY5x8CKbcfa166GoV0EFkaPkCKBQkdPJFvo5u+nGXLEH/ooniLb3QI8Fk58YAx7nsPLozUWfCBOJA==} - engines: {node: '>=18'} - cpu: [arm] - os: [android] - - '@esbuild/android-arm@0.25.5': - resolution: {integrity: sha512-AdJKSPeEHgi7/ZhuIPtcQKr5RQdo6OO2IL87JkianiMYMPbCtot9fxPbrMiBADOWWm3T2si9stAiVsGbTQFkbA==} + '@esbuild/android-arm@0.25.4': + resolution: {integrity: sha512-QNdQEps7DfFwE3hXiU4BZeOV68HHzYwGd0Nthhd3uCkkEKK7/R6MTgM0P7H7FAs5pU/DIWsviMmEGxEoxIZ+ZQ==} engines: {node: '>=18'} cpu: [arm] os: [android] @@ -2123,14 +2184,8 @@ packages: cpu: [x64] os: [android] - '@esbuild/android-x64@0.25.2': - resolution: {integrity: sha512-Ffcx+nnma8Sge4jzddPHCZVRvIfQ0kMsUsCMcJRHkGJ1cDmhe4SsrYIjLUKn1xpHZybmOqCWwB0zQvsjdEHtkg==} - engines: {node: '>=18'} - cpu: [x64] - os: [android] - - '@esbuild/android-x64@0.25.5': - resolution: {integrity: sha512-D2GyJT1kjvO//drbRT3Hib9XPwQeWd9vZoBJn+bu/lVsOZ13cqNdDeqIF/xQ5/VmWvMduP6AmXvylO/PIc2isw==} + '@esbuild/android-x64@0.25.4': + resolution: {integrity: sha512-TVhdVtQIFuVpIIR282btcGC2oGQoSfZfmBdTip2anCaVYcqWlZXGcdcKIUklfX2wj0JklNYgz39OBqh2cqXvcQ==} engines: {node: '>=18'} cpu: [x64] os: [android] @@ -2159,14 +2214,8 @@ packages: cpu: [arm64] os: [darwin] - '@esbuild/darwin-arm64@0.25.2': - resolution: {integrity: sha512-MpM6LUVTXAzOvN4KbjzU/q5smzryuoNjlriAIx+06RpecwCkL9JpenNzpKd2YMzLJFOdPqBpuub6eVRP5IgiSA==} - engines: {node: '>=18'} - cpu: [arm64] - os: [darwin] - - '@esbuild/darwin-arm64@0.25.5': - resolution: {integrity: sha512-GtaBgammVvdF7aPIgH2jxMDdivezgFu6iKpmT+48+F8Hhg5J/sfnDieg0aeG/jfSvkYQU2/pceFPDKlqZzwnfQ==} + '@esbuild/darwin-arm64@0.25.4': + resolution: {integrity: sha512-Y1giCfM4nlHDWEfSckMzeWNdQS31BQGs9/rouw6Ub91tkK79aIMTH3q9xHvzH8d0wDru5Ci0kWB8b3up/nl16g==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] @@ -2195,14 +2244,8 @@ packages: cpu: [x64] os: [darwin] - '@esbuild/darwin-x64@0.25.2': - resolution: {integrity: sha512-5eRPrTX7wFyuWe8FqEFPG2cU0+butQQVNcT4sVipqjLYQjjh8a8+vUTfgBKM88ObB85ahsnTwF7PSIt6PG+QkA==} - engines: {node: '>=18'} - cpu: [x64] - os: [darwin] - - '@esbuild/darwin-x64@0.25.5': - resolution: {integrity: sha512-1iT4FVL0dJ76/q1wd7XDsXrSW+oLoquptvh4CLR4kITDtqi2e/xwXwdCVH8hVHU43wgJdsq7Gxuzcs6Iq/7bxQ==} + '@esbuild/darwin-x64@0.25.4': + resolution: {integrity: sha512-CJsry8ZGM5VFVeyUYB3cdKpd/H69PYez4eJh1W/t38vzutdjEjtP7hB6eLKBoOdxcAlCtEYHzQ/PJ/oU9I4u0A==} engines: {node: '>=18'} cpu: [x64] os: [darwin] @@ -2231,14 +2274,8 @@ packages: cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-arm64@0.25.2': - resolution: {integrity: sha512-mLwm4vXKiQ2UTSX4+ImyiPdiHjiZhIaE9QvC7sw0tZ6HoNMjYAqQpGyui5VRIi5sGd+uWq940gdCbY3VLvsO1w==} - engines: {node: '>=18'} - cpu: [arm64] - os: [freebsd] - - '@esbuild/freebsd-arm64@0.25.5': - resolution: {integrity: sha512-nk4tGP3JThz4La38Uy/gzyXtpkPW8zSAmoUhK9xKKXdBCzKODMc2adkB2+8om9BDYugz+uGV7sLmpTYzvmz6Sw==} + '@esbuild/freebsd-arm64@0.25.4': + resolution: {integrity: sha512-yYq+39NlTRzU2XmoPW4l5Ifpl9fqSk0nAJYM/V/WUGPEFfek1epLHJIkTQM6bBs1swApjO5nWgvr843g6TjxuQ==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] @@ -2267,14 +2304,8 @@ packages: cpu: [x64] os: [freebsd] - '@esbuild/freebsd-x64@0.25.2': - resolution: {integrity: sha512-6qyyn6TjayJSwGpm8J9QYYGQcRgc90nmfdUb0O7pp1s4lTY+9D0H9O02v5JqGApUyiHOtkz6+1hZNvNtEhbwRQ==} - engines: {node: '>=18'} - cpu: [x64] - os: [freebsd] - - '@esbuild/freebsd-x64@0.25.5': - resolution: {integrity: sha512-PrikaNjiXdR2laW6OIjlbeuCPrPaAl0IwPIaRv+SMV8CiM8i2LqVUHFC1+8eORgWyY7yhQY+2U2fA55mBzReaw==} + '@esbuild/freebsd-x64@0.25.4': + resolution: {integrity: sha512-0FgvOJ6UUMflsHSPLzdfDnnBBVoCDtBTVyn/MrWloUNvq/5SFmh13l3dvgRPkDihRxb77Y17MbqbCAa2strMQQ==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] @@ -2303,14 +2334,8 @@ packages: cpu: [arm64] os: [linux] - '@esbuild/linux-arm64@0.25.2': - resolution: {integrity: sha512-gq/sjLsOyMT19I8obBISvhoYiZIAaGF8JpeXu1u8yPv8BE5HlWYobmlsfijFIZ9hIVGYkbdFhEqC0NvM4kNO0g==} - engines: {node: '>=18'} - cpu: [arm64] - os: [linux] - - '@esbuild/linux-arm64@0.25.5': - resolution: {integrity: sha512-Z9kfb1v6ZlGbWj8EJk9T6czVEjjq2ntSYLY2cw6pAZl4oKtfgQuS4HOq41M/BcoLPzrUbNd+R4BXFyH//nHxVg==} + '@esbuild/linux-arm64@0.25.4': + resolution: {integrity: sha512-+89UsQTfXdmjIvZS6nUnOOLoXnkUTB9hR5QAeLrQdzOSWZvNSAXAtcRDHWtqAUtAmv7ZM1WPOOeSxDzzzMogiQ==} engines: {node: '>=18'} cpu: [arm64] os: [linux] @@ -2339,14 +2364,8 @@ packages: cpu: [arm] os: [linux] - '@esbuild/linux-arm@0.25.2': - resolution: {integrity: sha512-UHBRgJcmjJv5oeQF8EpTRZs/1knq6loLxTsjc3nxO9eXAPDLcWW55flrMVc97qFPbmZP31ta1AZVUKQzKTzb0g==} - engines: {node: '>=18'} - cpu: [arm] - os: [linux] - - '@esbuild/linux-arm@0.25.5': - resolution: {integrity: sha512-cPzojwW2okgh7ZlRpcBEtsX7WBuqbLrNXqLU89GxWbNt6uIg78ET82qifUy3W6OVww6ZWobWub5oqZOVtwolfw==} + '@esbuild/linux-arm@0.25.4': + resolution: {integrity: sha512-kro4c0P85GMfFYqW4TWOpvmF8rFShbWGnrLqlzp4X1TNWjRY3JMYUfDCtOxPKOIY8B0WC8HN51hGP4I4hz4AaQ==} engines: {node: '>=18'} cpu: [arm] os: [linux] @@ -2375,14 +2394,8 @@ packages: cpu: [ia32] os: [linux] - '@esbuild/linux-ia32@0.25.2': - resolution: {integrity: sha512-bBYCv9obgW2cBP+2ZWfjYTU+f5cxRoGGQ5SeDbYdFCAZpYWrfjjfYwvUpP8MlKbP0nwZ5gyOU/0aUzZ5HWPuvQ==} - engines: {node: '>=18'} - cpu: [ia32] - os: [linux] - - '@esbuild/linux-ia32@0.25.5': - resolution: {integrity: sha512-sQ7l00M8bSv36GLV95BVAdhJ2QsIbCuCjh/uYrWiMQSUuV+LpXwIqhgJDcvMTj+VsQmqAHL2yYaasENvJ7CDKA==} + '@esbuild/linux-ia32@0.25.4': + resolution: {integrity: sha512-yTEjoapy8UP3rv8dB0ip3AfMpRbyhSN3+hY8mo/i4QXFeDxmiYbEKp3ZRjBKcOP862Ua4b1PDfwlvbuwY7hIGQ==} engines: {node: '>=18'} cpu: [ia32] os: [linux] @@ -2411,14 +2424,8 @@ packages: cpu: [loong64] os: [linux] - '@esbuild/linux-loong64@0.25.2': - resolution: {integrity: sha512-SHNGiKtvnU2dBlM5D8CXRFdd+6etgZ9dXfaPCeJtz+37PIUlixvlIhI23L5khKXs3DIzAn9V8v+qb1TRKrgT5w==} - engines: {node: '>=18'} - cpu: [loong64] - os: [linux] - - '@esbuild/linux-loong64@0.25.5': - resolution: {integrity: sha512-0ur7ae16hDUC4OL5iEnDb0tZHDxYmuQyhKhsPBV8f99f6Z9KQM02g33f93rNH5A30agMS46u2HP6qTdEt6Q1kg==} + '@esbuild/linux-loong64@0.25.4': + resolution: {integrity: sha512-NeqqYkrcGzFwi6CGRGNMOjWGGSYOpqwCjS9fvaUlX5s3zwOtn1qwg1s2iE2svBe4Q/YOG1q6875lcAoQK/F4VA==} engines: {node: '>=18'} cpu: [loong64] os: [linux] @@ -2447,14 +2454,8 @@ packages: cpu: [mips64el] os: [linux] - '@esbuild/linux-mips64el@0.25.2': - resolution: {integrity: sha512-hDDRlzE6rPeoj+5fsADqdUZl1OzqDYow4TB4Y/3PlKBD0ph1e6uPHzIQcv2Z65u2K0kpeByIyAjCmjn1hJgG0Q==} - engines: {node: '>=18'} - cpu: [mips64el] - os: [linux] - - '@esbuild/linux-mips64el@0.25.5': - resolution: {integrity: sha512-kB/66P1OsHO5zLz0i6X0RxlQ+3cu0mkxS3TKFvkb5lin6uwZ/ttOkP3Z8lfR9mJOBk14ZwZ9182SIIWFGNmqmg==} + '@esbuild/linux-mips64el@0.25.4': + resolution: {integrity: sha512-IcvTlF9dtLrfL/M8WgNI/qJYBENP3ekgsHbYUIzEzq5XJzzVEV/fXY9WFPfEEXmu3ck2qJP8LG/p3Q8f7Zc2Xg==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] @@ -2483,14 +2484,8 @@ packages: cpu: [ppc64] os: [linux] - '@esbuild/linux-ppc64@0.25.2': - resolution: {integrity: sha512-tsHu2RRSWzipmUi9UBDEzc0nLc4HtpZEI5Ba+Omms5456x5WaNuiG3u7xh5AO6sipnJ9r4cRWQB2tUjPyIkc6g==} - engines: {node: '>=18'} - cpu: [ppc64] - os: [linux] - - '@esbuild/linux-ppc64@0.25.5': - resolution: {integrity: sha512-UZCmJ7r9X2fe2D6jBmkLBMQetXPXIsZjQJCjgwpVDz+YMcS6oFR27alkgGv3Oqkv07bxdvw7fyB71/olceJhkQ==} + '@esbuild/linux-ppc64@0.25.4': + resolution: {integrity: sha512-HOy0aLTJTVtoTeGZh4HSXaO6M95qu4k5lJcH4gxv56iaycfz1S8GO/5Jh6X4Y1YiI0h7cRyLi+HixMR+88swag==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] @@ -2519,14 +2514,8 @@ packages: cpu: [riscv64] os: [linux] - '@esbuild/linux-riscv64@0.25.2': - resolution: {integrity: sha512-k4LtpgV7NJQOml/10uPU0s4SAXGnowi5qBSjaLWMojNCUICNu7TshqHLAEbkBdAszL5TabfvQ48kK84hyFzjnw==} - engines: {node: '>=18'} - cpu: [riscv64] - os: [linux] - - '@esbuild/linux-riscv64@0.25.5': - resolution: {integrity: sha512-kTxwu4mLyeOlsVIFPfQo+fQJAV9mh24xL+y+Bm6ej067sYANjyEw1dNHmvoqxJUCMnkBdKpvOn0Ahql6+4VyeA==} + '@esbuild/linux-riscv64@0.25.4': + resolution: {integrity: sha512-i8JUDAufpz9jOzo4yIShCTcXzS07vEgWzyX3NH2G7LEFVgrLEhjwL3ajFE4fZI3I4ZgiM7JH3GQ7ReObROvSUA==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] @@ -2555,14 +2544,8 @@ packages: cpu: [s390x] os: [linux] - '@esbuild/linux-s390x@0.25.2': - resolution: {integrity: sha512-GRa4IshOdvKY7M/rDpRR3gkiTNp34M0eLTaC1a08gNrh4u488aPhuZOCpkF6+2wl3zAN7L7XIpOFBhnaE3/Q8Q==} - engines: {node: '>=18'} - cpu: [s390x] - os: [linux] - - '@esbuild/linux-s390x@0.25.5': - resolution: {integrity: sha512-K2dSKTKfmdh78uJ3NcWFiqyRrimfdinS5ErLSn3vluHNeHVnBAFWC8a4X5N+7FgVE1EjXS1QDZbpqZBjfrqMTQ==} + '@esbuild/linux-s390x@0.25.4': + resolution: {integrity: sha512-jFnu+6UbLlzIjPQpWCNh5QtrcNfMLjgIavnwPQAfoGx4q17ocOU9MsQ2QVvFxwQoWpZT8DvTLooTvmOQXkO51g==} engines: {node: '>=18'} cpu: [s390x] os: [linux] @@ -2591,14 +2574,8 @@ packages: cpu: [x64] os: [linux] - '@esbuild/linux-x64@0.25.2': - resolution: {integrity: sha512-QInHERlqpTTZ4FRB0fROQWXcYRD64lAoiegezDunLpalZMjcUcld3YzZmVJ2H/Cp0wJRZ8Xtjtj0cEHhYc/uUg==} - engines: {node: '>=18'} - cpu: [x64] - os: [linux] - - '@esbuild/linux-x64@0.25.5': - resolution: {integrity: sha512-uhj8N2obKTE6pSZ+aMUbqq+1nXxNjZIIjCjGLfsWvVpy7gKCOL6rsY1MhRh9zLtUtAI7vpgLMK6DxjO8Qm9lJw==} + '@esbuild/linux-x64@0.25.4': + resolution: {integrity: sha512-6e0cvXwzOnVWJHq+mskP8DNSrKBr1bULBvnFLpc1KY+d+irZSgZ02TGse5FsafKS5jg2e4pbvK6TPXaF/A6+CA==} engines: {node: '>=18'} cpu: [x64] os: [linux] @@ -2615,14 +2592,8 @@ packages: cpu: [arm64] os: [netbsd] - '@esbuild/netbsd-arm64@0.25.2': - resolution: {integrity: sha512-talAIBoY5M8vHc6EeI2WW9d/CkiO9MQJ0IOWX8hrLhxGbro/vBXJvaQXefW2cP0z0nQVTdQ/eNyGFV1GSKrxfw==} - engines: {node: '>=18'} - cpu: [arm64] - os: [netbsd] - - '@esbuild/netbsd-arm64@0.25.5': - resolution: {integrity: sha512-pwHtMP9viAy1oHPvgxtOv+OkduK5ugofNTVDilIzBLpoWAM16r7b/mxBvfpuQDpRQFMfuVr5aLcn4yveGvBZvw==} + '@esbuild/netbsd-arm64@0.25.4': + resolution: {integrity: sha512-vUnkBYxZW4hL/ie91hSqaSNjulOnYXE1VSLusnvHg2u3jewJBz3YzB9+oCw8DABeVqZGg94t9tyZFoHma8gWZQ==} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] @@ -2651,14 +2622,8 @@ packages: cpu: [x64] os: [netbsd] - '@esbuild/netbsd-x64@0.25.2': - resolution: {integrity: sha512-voZT9Z+tpOxrvfKFyfDYPc4DO4rk06qamv1a/fkuzHpiVBMOhpjK+vBmWM8J1eiB3OLSMFYNaOaBNLXGChf5tg==} - engines: {node: '>=18'} - cpu: [x64] - os: [netbsd] - - '@esbuild/netbsd-x64@0.25.5': - resolution: {integrity: sha512-WOb5fKrvVTRMfWFNCroYWWklbnXH0Q5rZppjq0vQIdlsQKuw6mdSihwSo4RV/YdQ5UCKKvBy7/0ZZYLBZKIbwQ==} + '@esbuild/netbsd-x64@0.25.4': + resolution: {integrity: sha512-XAg8pIQn5CzhOB8odIcAm42QsOfa98SBeKUdo4xa8OvX8LbMZqEtgeWE9P/Wxt7MlG2QqvjGths+nq48TrUiKw==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] @@ -2675,14 +2640,8 @@ packages: cpu: [arm64] os: [openbsd] - '@esbuild/openbsd-arm64@0.25.2': - resolution: {integrity: sha512-dcXYOC6NXOqcykeDlwId9kB6OkPUxOEqU+rkrYVqJbK2hagWOMrsTGsMr8+rW02M+d5Op5NNlgMmjzecaRf7Tg==} - engines: {node: '>=18'} - cpu: [arm64] - os: [openbsd] - - '@esbuild/openbsd-arm64@0.25.5': - resolution: {integrity: sha512-7A208+uQKgTxHd0G0uqZO8UjK2R0DDb4fDmERtARjSHWxqMTye4Erz4zZafx7Di9Cv+lNHYuncAkiGFySoD+Mw==} + '@esbuild/openbsd-arm64@0.25.4': + resolution: {integrity: sha512-Ct2WcFEANlFDtp1nVAXSNBPDxyU+j7+tId//iHXU2f/lN5AmO4zLyhDcpR5Cz1r08mVxzt3Jpyt4PmXQ1O6+7A==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] @@ -2711,14 +2670,8 @@ packages: cpu: [x64] os: [openbsd] - '@esbuild/openbsd-x64@0.25.2': - resolution: {integrity: sha512-t/TkWwahkH0Tsgoq1Ju7QfgGhArkGLkF1uYz8nQS/PPFlXbP5YgRpqQR3ARRiC2iXoLTWFxc6DJMSK10dVXluw==} - engines: {node: '>=18'} - cpu: [x64] - os: [openbsd] - - '@esbuild/openbsd-x64@0.25.5': - resolution: {integrity: sha512-G4hE405ErTWraiZ8UiSoesH8DaCsMm0Cay4fsFWOOUcz8b8rC6uCvnagr+gnioEjWn0wC+o1/TAHt+It+MpIMg==} + '@esbuild/openbsd-x64@0.25.4': + resolution: {integrity: sha512-xAGGhyOQ9Otm1Xu8NT1ifGLnA6M3sJxZ6ixylb+vIUVzvvd6GOALpwQrYrtlPouMqd/vSbgehz6HaVk4+7Afhw==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] @@ -2747,14 +2700,8 @@ packages: cpu: [x64] os: [sunos] - '@esbuild/sunos-x64@0.25.2': - resolution: {integrity: sha512-cfZH1co2+imVdWCjd+D1gf9NjkchVhhdpgb1q5y6Hcv9TP6Zi9ZG/beI3ig8TvwT9lH9dlxLq5MQBBgwuj4xvA==} - engines: {node: '>=18'} - cpu: [x64] - os: [sunos] - - '@esbuild/sunos-x64@0.25.5': - resolution: {integrity: sha512-l+azKShMy7FxzY0Rj4RCt5VD/q8mG/e+mDivgspo+yL8zW7qEwctQ6YqKX34DTEleFAvCIUviCFX1SDZRSyMQA==} + '@esbuild/sunos-x64@0.25.4': + resolution: {integrity: sha512-Mw+tzy4pp6wZEK0+Lwr76pWLjrtjmJyUB23tHKqEDP74R3q95luY/bXqXZeYl4NYlvwOqoRKlInQialgCKy67Q==} engines: {node: '>=18'} cpu: [x64] os: [sunos] @@ -2783,14 +2730,8 @@ packages: cpu: [arm64] os: [win32] - '@esbuild/win32-arm64@0.25.2': - resolution: {integrity: sha512-7Loyjh+D/Nx/sOTzV8vfbB3GJuHdOQyrOryFdZvPHLf42Tk9ivBU5Aedi7iyX+x6rbn2Mh68T4qq1SDqJBQO5Q==} - engines: {node: '>=18'} - cpu: [arm64] - os: [win32] - - '@esbuild/win32-arm64@0.25.5': - resolution: {integrity: sha512-O2S7SNZzdcFG7eFKgvwUEZ2VG9D/sn/eIiz8XRZ1Q/DO5a3s76Xv0mdBzVM5j5R639lXQmPmSo0iRpHqUUrsxw==} + '@esbuild/win32-arm64@0.25.4': + resolution: {integrity: sha512-AVUP428VQTSddguz9dO9ngb+E5aScyg7nOeJDrF1HPYu555gmza3bDGMPhmVXL8svDSoqPCsCPjb265yG/kLKQ==} engines: {node: '>=18'} cpu: [arm64] os: [win32] @@ -2819,14 +2760,8 @@ packages: cpu: [ia32] os: [win32] - '@esbuild/win32-ia32@0.25.2': - resolution: {integrity: sha512-WRJgsz9un0nqZJ4MfhabxaD9Ft8KioqU3JMinOTvobbX6MOSUigSBlogP8QB3uxpJDsFS6yN+3FDBdqE5lg9kg==} - engines: {node: '>=18'} - cpu: [ia32] - os: [win32] - - '@esbuild/win32-ia32@0.25.5': - resolution: {integrity: sha512-onOJ02pqs9h1iMJ1PQphR+VZv8qBMQ77Klcsqv9CNW2w6yLqoURLcgERAIurY6QE63bbLuqgP9ATqajFLK5AMQ==} + '@esbuild/win32-ia32@0.25.4': + resolution: {integrity: sha512-i1sW+1i+oWvQzSgfRcxxG2k4I9n3O9NRqy8U+uugaT2Dy7kLO9Y7wI72haOahxceMX8hZAzgGou1FhndRldxRg==} engines: {node: '>=18'} cpu: [ia32] os: [win32] @@ -2855,20 +2790,14 @@ packages: cpu: [x64] os: [win32] - '@esbuild/win32-x64@0.25.2': - resolution: {integrity: sha512-kM3HKb16VIXZyIeVrM1ygYmZBKybX8N4p754bw390wGO3Tf2j4L2/WYL+4suWujpgf6GBYs3jv7TyUivdd05JA==} - engines: {node: '>=18'} - cpu: [x64] - os: [win32] - - '@esbuild/win32-x64@0.25.5': - resolution: {integrity: sha512-TXv6YnJ8ZMVdX+SXWVBo/0p8LTcrUYngpWjvm91TMjjBQii7Oz11Lw5lbDV5Y0TzuhSJHwiH4hEtC1I42mMS0g==} + '@esbuild/win32-x64@0.25.4': + resolution: {integrity: sha512-nOT2vZNw6hJ+z43oP1SPea/G/6AbN6X+bGNhNuq8NtRHy4wsMhw765IKLNmnjek7GvjWBYQ8Q5VBoYTFg9y1UQ==} engines: {node: '>=18'} cpu: [x64] os: [win32] - '@eslint-community/eslint-utils@4.5.0': - resolution: {integrity: sha512-RoV8Xs9eNwiDvhv7M+xcL4PWyRyIXRY/FLp3buU4h1EYfdF7unWUy3dOjPqb3C7rMUewIcqwW850PgS8h1o1yg==} + '@eslint-community/eslint-utils@4.7.0': + resolution: {integrity: sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 @@ -2881,16 +2810,16 @@ packages: resolution: {integrity: sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/core@0.12.0': - resolution: {integrity: sha512-cmrR6pytBuSMTaBweKoGMwu3EiHiEC+DoyupPmlZ0HxBJBtIxwe+j/E4XPIKNx+Q74c8lXKPwYawBf5glsTkHg==} + '@eslint/core@0.13.0': + resolution: {integrity: sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/core@0.9.1': resolution: {integrity: sha512-GuUdqkyyzQI5RMIWkHhvTWLCyLo1jNK3vzkSyaExH5kHPDHcuL2VOpHjmMY+y3+NC69qAKToBqldTBgYeLSr9Q==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/eslintrc@3.3.0': - resolution: {integrity: sha512-yaVPAiNAalnCZedKLdR21GOGILMLKPyqSLWaAjQFvYA2i/ciDi8ArYVr69Anohb6cH2Ukhqti4aFnYyPm8wdwQ==} + '@eslint/eslintrc@3.3.1': + resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/js@9.17.0': @@ -2901,27 +2830,30 @@ packages: resolution: {integrity: sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/plugin-kit@0.2.7': - resolution: {integrity: sha512-JubJ5B2pJ4k4yGxaNLdbjrnk9d/iDz6/q8wOilpIowd6PJPgaxCuHBnBszq7Ce2TyMrywm5r4PnKm6V3iiZF+g==} + '@eslint/plugin-kit@0.2.8': + resolution: {integrity: sha512-ZAoA40rNMPwSm+AeHpCq8STiNAwzWLJuP8Xv4CHIc9wv/PSuExjMrmjfYNj682vW0OOiZ1HKxzvjQr9XZIisQA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@fastify/ajv-compiler@4.0.2': resolution: {integrity: sha512-Rkiu/8wIjpsf46Rr+Fitd3HRP+VsxUFDDeag0hs9L0ksfnwx2g7SPQQTFL0E8Qv+rfXzQOxBJnjUB9ITUDjfWQ==} - '@fastify/error@4.0.0': - resolution: {integrity: sha512-OO/SA8As24JtT1usTUTKgGH7uLvhfwZPwlptRi2Dp5P4KKmJI3gvsZ8MIHnNwDs4sLf/aai5LzTyl66xr7qMxA==} + '@fastify/busboy@3.1.1': + resolution: {integrity: sha512-5DGmA8FTdB2XbDeEwc/5ZXBl6UbBAyBOOLlPuBnZ/N1SwdH9Ii+cOX3tBROlDgcTXxjOYnLMVoKk9+FXAw0CJw==} + + '@fastify/error@4.1.0': + resolution: {integrity: sha512-KeFcciOr1eo/YvIXHP65S94jfEEqn1RxTRBT1aJaHxY5FK0/GDXYozsQMMWlZoHgi8i0s+YtrLsgj/JkUUjSkQ==} - '@fastify/fast-json-stringify-compiler@5.0.2': - resolution: {integrity: sha512-YdR7gqlLg1xZAQa+SX4sMNzQHY5pC54fu9oC5aYSUqBhyn6fkLkrdtKlpVdCNPlwuUuXA1PjFTEmvMF6ZVXVGw==} + '@fastify/fast-json-stringify-compiler@5.0.3': + resolution: {integrity: sha512-uik7yYHkLr6fxd8hJSZ8c+xF4WafPK+XzneQDPU+D10r5X19GW8lJcom2YijX2+qtFF1ENJlHXKFM9ouXNJYgQ==} '@fastify/merge-json-schemas@0.2.1': resolution: {integrity: sha512-OA3KGBCy6KtIvLf8DINC5880o5iBlDX4SxzLQS8HorJAbqluzLRn80UXU0bxZn7UOFhFgpRJDasfwn9nG4FG4A==} - '@floating-ui/core@1.6.9': - resolution: {integrity: sha512-uMXCuQ3BItDUbAMhIXw7UPXRfAlOAvZzdK9BWpE60MCn+Svt3aLn9jsPTi/WNGlRUu2uI0v5S7JiIUsbsvh3fw==} + '@floating-ui/core@1.7.0': + resolution: {integrity: sha512-FRdBLykrPPA6P76GGGqlex/e7fbe0F1ykgxHYNXQsH/iTEtjMj/f9bpY5oQqbjt5VgZvgz/uKXbGuROijh3VLA==} - '@floating-ui/dom@1.6.13': - resolution: {integrity: sha512-umqzocjDgNRGTuO7Q8CU32dkHkECqI8ZdMZ5Swb6QAM0t5rnlrN3lGo1hdpscRd3WS8T6DKYK4ephgIH9iRh3w==} + '@floating-ui/dom@1.7.0': + resolution: {integrity: sha512-lGTor4VlXcesUMh1cupTUTDoCxMb0V6bm3CnxHzQcw8Eaf1jQbgQX4i02fYgT0vJ82tb5MZ4CZk1LRGkktJCzg==} '@floating-ui/react-dom@2.1.2': resolution: {integrity: sha512-06okr5cgPzMNBy+Ycse2A6udMi4bqwW/zgBF/rwjcNqWkyr82Mcg8b0vjX8OJpZFy/FKjJmw6wV7t44kK6kW7A==} @@ -2935,6 +2867,10 @@ packages: '@fontsource/fira-mono@5.0.0': resolution: {integrity: sha512-IsinH/oLYJyv/sQv7SbKmjoAXZsSjm6Q1Tz5GBBXCXi3Jg9MzXmKvWm9bSLC8lFI6CDsi8GkH/DAgZ98t8bhTQ==} + '@hey-api/json-schema-ref-parser@1.0.4': + resolution: {integrity: sha512-IaJ4yFgU5r63KZyeySHRKSM1bavFIda8KdwCFi5BxQCIklltzEByBksNOPms+yHXpWWfR+OopIusVZV8roycYg==} + engines: {node: '>= 16'} + '@hey-api/json-schema-ref-parser@1.0.6': resolution: {integrity: sha512-yktiFZoWPtEW8QKS65eqKwA5MTKp88CyiL8q72WynrBs/73SAaxlSWlA2zW/DZlywZ5hX1OYzrCC0wFdvO9c2w==} engines: {node: '>= 16'} @@ -2955,8 +2891,8 @@ packages: resolution: {integrity: sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==} engines: {node: '>=18.18'} - '@humanwhocodes/retry@0.4.2': - resolution: {integrity: sha512-xeO57FpIu4p1Ri3Jq/EXq4ClRm86dVF2z/+kvFnyqVYRavTZmaFaUBbWCOuuTh0o/g7DSsk6kc2vrS4Vl5oPOQ==} + '@humanwhocodes/retry@0.4.3': + resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} engines: {node: '>=18.18'} '@img/sharp-darwin-arm64@0.33.5': @@ -3064,8 +3000,8 @@ packages: cpu: [x64] os: [win32] - '@inquirer/checkbox@4.1.3': - resolution: {integrity: sha512-KU1MGwf24iABJjGESxhyj+/rlQYSRoCfcuHDEHXfZ1DENmbuSRfyrUb+LLjHoee5TNOFKwaFxDXc5/zRwJUPMQ==} + '@inquirer/checkbox@4.1.6': + resolution: {integrity: sha512-62u896rWCtKKE43soodq5e/QcRsA22I+7/4Ov7LESWnKRO6BVo2A1DFLDmXL9e28TB0CfHc3YtkbPm7iwajqkg==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -3073,8 +3009,8 @@ packages: '@types/node': optional: true - '@inquirer/confirm@5.1.6': - resolution: {integrity: sha512-6ZXYK3M1XmaVBZX6FCfChgtponnL0R6I7k8Nu+kaoNkT828FVZTcca1MqmWQipaW2oNREQl5AaPCUOOCVNdRMw==} + '@inquirer/confirm@5.1.10': + resolution: {integrity: sha512-FxbQ9giWxUWKUk2O5XZ6PduVnH2CZ/fmMKMBkH71MHJvWr7WL5AHKevhzF1L5uYWB2P548o1RzVxrNd3dpmk6g==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -3082,8 +3018,8 @@ packages: '@types/node': optional: true - '@inquirer/confirm@5.1.7': - resolution: {integrity: sha512-Xrfbrw9eSiHb+GsesO8TQIeHSMTP0xyvTCeeYevgZ4sKW+iz9w/47bgfG9b0niQm+xaLY2EWPBINUPldLwvYiw==} + '@inquirer/confirm@5.1.6': + resolution: {integrity: sha512-6ZXYK3M1XmaVBZX6FCfChgtponnL0R6I7k8Nu+kaoNkT828FVZTcca1MqmWQipaW2oNREQl5AaPCUOOCVNdRMw==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -3091,8 +3027,8 @@ packages: '@types/node': optional: true - '@inquirer/core@10.1.8': - resolution: {integrity: sha512-HpAqR8y715zPpM9e/9Q+N88bnGwqqL8ePgZ0SMv/s3673JLMv3bIkoivGmjPqXlEgisUksSXibweQccUwEx4qQ==} + '@inquirer/core@10.1.11': + resolution: {integrity: sha512-BXwI/MCqdtAhzNQlBEFE7CEflhPkl/BqvAuV/aK6lW3DClIfYVDWPP/kXuXHtBWC7/EEbNqd/1BGq2BGBBnuxw==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -3100,8 +3036,8 @@ packages: '@types/node': optional: true - '@inquirer/editor@4.2.8': - resolution: {integrity: sha512-UkGKbMFlQw5k4ZLjDwEi5z8NIVlP/3DAlLHta0o0pSsdpPThNmPtUL8mvGCHUaQtR+QrxR9yRYNWgKMsHkfIUA==} + '@inquirer/editor@4.2.11': + resolution: {integrity: sha512-YoZr0lBnnLFPpfPSNsQ8IZyKxU47zPyVi9NLjCWtna52//M/xuL0PGPAxHxxYhdOhnvY2oBafoM+BI5w/JK7jw==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -3109,8 +3045,8 @@ packages: '@types/node': optional: true - '@inquirer/expand@4.0.10': - resolution: {integrity: sha512-leyBouGJ77ggv51Jb/OJmLGGnU2HYc13MZ2iiPNLwe2VgFgZPVqsrRWSa1RAHKyazjOyvSNKLD1B2K7A/iWi1g==} + '@inquirer/expand@4.0.13': + resolution: {integrity: sha512-HgYNWuZLHX6q5y4hqKhwyytqAghmx35xikOGY3TcgNiElqXGPas24+UzNPOwGUZa5Dn32y25xJqVeUcGlTv+QQ==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -3122,8 +3058,8 @@ packages: resolution: {integrity: sha512-eOg92lvrn/aRUqbxRyvpEWnrvRuTYRifixHkYVpJiygTgVSBIHDqLh0SrMQXkafvULg3ck11V7xvR+zcgvpHFw==} engines: {node: '>=18'} - '@inquirer/input@4.1.7': - resolution: {integrity: sha512-rCQAipJNA14UTH84df/z4jDJ9LZ54H6zzuCAi7WZ0qVqx3CSqLjfXAMd5cpISIxbiHVJCPRB81gZksq6CZsqDg==} + '@inquirer/input@4.1.10': + resolution: {integrity: sha512-kV3BVne3wJ+j6reYQUZi/UN9NZGZLxgc/tfyjeK3mrx1QI7RXPxGp21IUTv+iVHcbP4ytZALF8vCHoxyNSC6qg==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -3131,8 +3067,8 @@ packages: '@types/node': optional: true - '@inquirer/number@3.0.10': - resolution: {integrity: sha512-GLsdnxzNefjCJUmWyjaAuNklHgDpCTL4RMllAVhVvAzBwRW9g38eZ5tWgzo1lirtSDTpsh593hqXVhxvdrjfwA==} + '@inquirer/number@3.0.13': + resolution: {integrity: sha512-IrLezcg/GWKS8zpKDvnJ/YTflNJdG0qSFlUM/zNFsdi4UKW/CO+gaJpbMgQ20Q58vNKDJbEzC6IebdkprwL6ew==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -3140,8 +3076,8 @@ packages: '@types/node': optional: true - '@inquirer/password@4.0.10': - resolution: {integrity: sha512-JC538ujqeYKkFqLoWZ0ILBteIUO2yajBMVEUZSxjl9x6fiEQtM+I5Rca7M2D8edMDbyHLnXifGH1hJZdh8V5rA==} + '@inquirer/password@4.0.13': + resolution: {integrity: sha512-NN0S/SmdhakqOTJhDwOpeBEEr8VdcYsjmZHDb0rblSh2FcbXQOr+2IApP7JG4WE3sxIdKytDn4ed3XYwtHxmJQ==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -3158,8 +3094,8 @@ packages: '@types/node': optional: true - '@inquirer/rawlist@4.0.10': - resolution: {integrity: sha512-vOQbQkmhaCsF2bUmjoyRSZJBz77UnIF/F3ZS2LMgwbgyaG2WgwKHh0WKNj0APDB72WDbZijhW5nObQbk+TnbcA==} + '@inquirer/rawlist@4.1.1': + resolution: {integrity: sha512-VBUC0jPN2oaOq8+krwpo/mf3n/UryDUkKog3zi+oIi8/e5hykvdntgHUB9nhDM78RubiyR1ldIOfm5ue+2DeaQ==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -3167,8 +3103,8 @@ packages: '@types/node': optional: true - '@inquirer/search@3.0.10': - resolution: {integrity: sha512-EAVKAz6P1LajZOdoL+R+XC3HJYSU261fbJzO4fCkJJ7UPFcm+nP+gzC+DDZWsb2WK9PQvKsnaKiNKsY8B6dBWQ==} + '@inquirer/search@3.0.13': + resolution: {integrity: sha512-9g89d2c5Izok/Gw/U7KPC3f9kfe5rA1AJ24xxNZG0st+vWekSk7tB9oE+dJv5JXd0ZSijomvW0KPMoBd8qbN4g==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -3176,8 +3112,8 @@ packages: '@types/node': optional: true - '@inquirer/select@4.0.10': - resolution: {integrity: sha512-Tg8S9nESnCfISu5tCZSuXpXq0wHuDVimj7xyHstABgR34zcJnLdq/VbjB2mdZvNAMAehYBnNzSjxB06UE8LLAA==} + '@inquirer/select@4.2.1': + resolution: {integrity: sha512-gt1Kd5XZm+/ddemcT3m23IP8aD8rC9drRckWoP/1f7OL46Yy2FGi8DSmNjEjQKtPl6SV96Kmjbl6p713KXJ/Jg==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -3189,8 +3125,8 @@ packages: resolution: {integrity: sha512-MzICLu4yS7V8AA61sANROZ9vT1H3ooca5dSmI1FjZkzq7o/koMsRfQSzRtFo+F3Ao4Sf1C0bpLKejpKB/+j6MA==} engines: {node: '>=18'} - '@inquirer/type@3.0.5': - resolution: {integrity: sha512-ZJpeIYYueOz/i/ONzrfof8g89kNdO2hjGuvULROo3O8rlB2CRtSseE5KeirnyE4t/thAn/EwvS/vuQeJCn+NZg==} + '@inquirer/type@3.0.6': + resolution: {integrity: sha512-/mKVCtVpyBu3IDarv0G+59KC4stsD5mDsGpYh+GKs1NZT88Jh52+cuoA1AtLk2Q0r/quNl+1cSUyLRHBFeD0XA==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -3213,6 +3149,10 @@ packages: resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} engines: {node: '>=8'} + '@jest/schemas@29.6.3': + resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jridgewell/gen-mapping@0.3.8': resolution: {integrity: sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==} engines: {node: '>=6.0.0'} @@ -3252,8 +3192,8 @@ packages: peerDependencies: tslib: '2' - '@jsonjoy.com/util@1.5.0': - resolution: {integrity: sha512-ojoNsrIuPI9g6o8UxhraZQSyF2ByJanAY4cTFbc8Mf2AXEF4aQRGY1dJxyJpuyav8r9FGflEt/Ff3u5Nt6YMPA==} + '@jsonjoy.com/util@1.6.0': + resolution: {integrity: sha512-sw/RMbehRhN68WRtcKCpQOPfnH6lLP4GJfqzi3iYej8tnzpZUDr6UkZYJjcjjC0FWEJOJbyM3PTIwxucUmDG2A==} engines: {node: '>=10.0'} peerDependencies: tslib: '2' @@ -3312,6 +3252,10 @@ packages: '@manypkg/get-packages@1.1.3': resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==} + '@mapbox/node-pre-gyp@1.0.11': + resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} + hasBin: true + '@mapbox/node-pre-gyp@2.0.0': resolution: {integrity: sha512-llMXd39jtP0HpQLVI37Bf1m2ADlEb35GYSh1SDSLsBhR+5iCxiNGlT31yqbNtVHygHAtMy6dWFERpU2JgufhPg==} engines: {node: '>=18'} @@ -3447,21 +3391,47 @@ packages: resolution: {integrity: sha512-zM0mVWSXE0a0h9aKACLwKmD6nHcRiKrPpCfvaKqG1CqDEyjEawId0ocXxVzPMCAm6kkWr2P025msfxXEnt8UGQ==} engines: {node: '>= 10'} + '@napi-rs/wasm-runtime@0.2.4': + resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} + + '@napi-rs/wasm-runtime@0.2.9': + resolution: {integrity: sha512-OKRBiajrrxB9ATokgEQoG87Z25c67pCpYcCwmXYX8PBftC9pBfN18gnm/fh1wurSLEKIAt+QRFLFCQISrb66Jg==} + '@neoconfetti/svelte@2.0.0': resolution: {integrity: sha512-n/Uu7/XmHc8w0uBci0QWBjgbRzLhfWsH8yPJ5pMaseIvzSwabXvB30nb3JjzEYNBp9uGt4eCeY7LUmxAjnJV8A==} - '@netlify/functions@3.0.0': - resolution: {integrity: sha512-XXf9mNw4+fkxUzukDpJtzc32bl1+YlXZwEhc5ZgMcTbJPLpgRLDs5WWSPJ4eY/Mv1ZFvtxmMwmfgoQYVt68Qog==} - engines: {node: '>=18.0.0'} + '@netlify/binary-info@1.0.0': + resolution: {integrity: sha512-4wMPu9iN3/HL97QblBsBay3E1etIciR84izI3U+4iALY+JHCrI+a2jO0qbAZ/nxKoegypYEaiiqWXylm+/zfrw==} + + '@netlify/blobs@9.1.1': + resolution: {integrity: sha512-hOrWBMOvdh9oa+8Z6ocvkY92q9YtfD+Vbh2i+Qs14cHsl9SYxRzPRQnBxU/H6PNtj6gtEJ7tv8RbBN8z7jH2jA==} + engines: {node: ^14.16.0 || >=16.0.0} - '@netlify/node-cookies@0.1.0': - resolution: {integrity: sha512-OAs1xG+FfLX0LoRASpqzVntVV/RpYkgpI0VrUnw2u0Q1qiZUzcPffxRK8HF3gc4GjuhG5ahOEMJ9bswBiZPq0g==} + '@netlify/dev-utils@2.1.1': + resolution: {integrity: sha512-0O4/eEcmZCNUkpSuN/yYRkX6BAcK/sbnH0YYNuK3HX193QXaSBT60TUpvTpiRxI6zvIfYCDRl3rz63w8m/lEMg==} engines: {node: ^14.16.0 || >=16.0.0} - '@netlify/serverless-functions-api@1.30.1': - resolution: {integrity: sha512-JkbaWFeydQdeDHz1mAy4rw+E3bl9YtbCgkntfTxq+IlNX/aIMv2/b1kZnQZcil4/sPoZGL831Dq6E374qRpU1A==} + '@netlify/functions@3.1.8': + resolution: {integrity: sha512-oAHPyybBx4oH8+3RfgihrTVhv6gseQw1pt0k4kZ/NDmGbEsgrr3gw+3ajzM5+fW5UnWiNuR5c+d7JgtRqjyMkw==} + engines: {node: '>=14.0.0'} + + '@netlify/open-api@2.37.0': + resolution: {integrity: sha512-zXnRFkxgNsalSgU8/vwTWnav3R+8KG8SsqHxqaoJdjjJtnZR7wo3f+qqu4z+WtZ/4V7fly91HFUwZ6Uz2OdW7w==} + engines: {node: '>=14.8.0'} + + '@netlify/runtime-utils@1.3.1': + resolution: {integrity: sha512-7/vIJlMYrPJPlEW84V2yeRuG3QBu66dmlv9neTmZ5nXzwylhBEOhy11ai+34A8mHCSZI4mKns25w3HM9kaDdJg==} + engines: {node: '>=16.0.0'} + + '@netlify/serverless-functions-api@1.41.1': + resolution: {integrity: sha512-swjyZEd8U1QVp01rZdHxpwWie7GkP1kS4+4n8kuNKA8+3G5tD0JXXf3a5d4tdwVvrU9k7a4GP1Bn792UPwecmw==} engines: {node: '>=18.0.0'} + '@netlify/zip-it-and-ship-it@10.1.1': + resolution: {integrity: sha512-MMXrty1NADxyMPgd7qZvDUYunhcPhxIA/jWP2joceOoPcAxOno/aS4jFuIHf2Dbb4HdhR+BlvgvDCy7QTXXyLQ==} + engines: {node: ^14.18.0 || >=16.0.0} + hasBin: true + '@next/env@15.2.4': resolution: {integrity: sha512-+SFtMgoiYP3WoSswuNmxJOCwi06TdWE733D+WPjpXIe4LXGULwEaofiiAy6kbS0+XjM5xF5n3lKuBwN2SnqD9g==} @@ -3569,8 +3539,8 @@ packages: resolution: {integrity: sha512-/bNJhjc+o6qL+Dwz/bqfTQClkEO5nTQ1ZEcdCkAQjhkZMHIh22LPG7fNh1enJP1NKWDqYiiABnjFCY7E0zHYtQ==} engines: {node: ^18.17.0 || >=20.5.0} - '@npmcli/redact@3.1.1': - resolution: {integrity: sha512-3Hc2KGIkrvJWJqTbvueXzBeZlmvoOxc2jyX00yzr3+sNFquJg0N8hH4SAPLPVrkWIRQICVpVgjrss971awXVnA==} + '@npmcli/redact@3.2.2': + resolution: {integrity: sha512-7VmYAmk4csGv08QzrDKScdzn11jHPFGyqJW39FyPgPuAp3zIaUmuCo1yxw9aGs+NEJuTGQ9Gwqpt93vtJubucg==} engines: {node: ^18.17.0 || >=20.5.0} '@npmcli/run-script@9.1.0': @@ -3603,8 +3573,8 @@ packages: resolution: {integrity: sha512-dr7I7eZOoRLl4uxdxeL2dQsH0OrbEiVPIyBHnBpA4co24CBnoJoF+JINuP9l3PAM3IhUzc5JIVq3/YY3lEc3Hw==} engines: {node: '>=18.12.0'} - '@nuxt/kit@3.16.2': - resolution: {integrity: sha512-K1SAUo2vweTfudKZzjKsZ5YJoxPLTspR5qz5+G61xtZreLpsdpDYfBseqsIAl5VFLJuszeRpWQ01jP9LfQ6Ksw==} + '@nuxt/kit@3.17.3': + resolution: {integrity: sha512-aw6u6mT3TnM/MmcCRDMv3i9Sbm5/ZMSJgDl+N+WsrWNDIQ2sWmsqdDkjb/HyXF20SNwc2891hRBkaQr3hG2mhA==} engines: {node: '>=18.12.0'} '@nuxt/module-builder@0.8.4': @@ -3622,8 +3592,8 @@ packages: resolution: {integrity: sha512-2HZPM372kuI/uw9VU/hOoYuzv803oZAtyoEKC5dQCQTKAQ293AjypF3WljMXUSReFS/hcbBSgGzYUPHr3Qo+pg==} engines: {node: ^14.18.0 || >=16.10.0} - '@nuxt/telemetry@2.6.5': - resolution: {integrity: sha512-lwMp9OHML/m0mjh7P5iz9PxINnk5smGkGebh88Wh8PjvnRooY1TBsbyq7mlSrNibpwD1BkwqhV5IAZOXWHLxMQ==} + '@nuxt/telemetry@2.6.6': + resolution: {integrity: sha512-Zh4HJLjzvm3Cq9w6sfzIFyH9ozK5ePYVfCUzzUQNiZojFsI2k1QkSBrVI9BGc6ArKXj/O6rkI6w7qQ+ouL8Cag==} engines: {node: '>=18.12.0'} hasBin: true @@ -3669,6 +3639,61 @@ packages: peerDependencies: vue: ^3.3.4 + '@nx/devkit@20.7.2': + resolution: {integrity: sha512-6qsQ49T1hWQ8s4JMvGX9k3tpjY4kwr+/2CE1ZCy1txJVFflDatJxdV3fMqUDqo6n81yB6AmVqoSQjQkO6fCRRQ==} + peerDependencies: + nx: '>= 19 <= 21' + + '@nx/nx-darwin-arm64@21.0.3': + resolution: {integrity: sha512-UQxDwhLcA1ERv4u1GiNgb2yhTHflWE8iOfayApPfYD0eSjBUMj30/s2E1RVq5Tx9TxYtmFVwz+C8DxOVWKu3OQ==} + cpu: [arm64] + os: [darwin] + + '@nx/nx-darwin-x64@21.0.3': + resolution: {integrity: sha512-ZR9a2ysE4nrQ2VTQxZa2w76rr9rA9kw61Oy7sp2rlKeqr8yyKynZgZmuCTnOOn3LCOUl072wtGCIS85SFSeGug==} + cpu: [x64] + os: [darwin] + + '@nx/nx-freebsd-x64@21.0.3': + resolution: {integrity: sha512-bJRFvhTOzewDM2HxeVDqbrR5357tAUpovcj9czzRGrEhhoelqCLP0/9Ric1V4j8yyPXmRpXa9REWq3weFaAcwg==} + cpu: [x64] + os: [freebsd] + + '@nx/nx-linux-arm-gnueabihf@21.0.3': + resolution: {integrity: sha512-7Mt/G0e3x9j83VuM1wflbAGTITO+VZBRKZpvhWS6Z6mNzNhc6T2PX2OvNMDC7PsUlTJeq7O4kb3M1fmkmk1DVA==} + cpu: [arm] + os: [linux] + + '@nx/nx-linux-arm64-gnu@21.0.3': + resolution: {integrity: sha512-3sUnzts/dquniJ+IXrJJcxnwl4jqbteJJhSXtrYlp+Kd2nNqgQIqdKvHy2hwUBDD0NvzpDdz6bTwcY2s1ghsAg==} + cpu: [arm64] + os: [linux] + + '@nx/nx-linux-arm64-musl@21.0.3': + resolution: {integrity: sha512-gBr2QXy5zmyut/UHbQLKV+wq6IKJ+5AACsczH4JdUvr58e0GunIVWTArgHMZwDJxbY4hAxtwgB8rFD4Bi6noxQ==} + cpu: [arm64] + os: [linux] + + '@nx/nx-linux-x64-gnu@21.0.3': + resolution: {integrity: sha512-hwm/ER8LC1Dkh1CNIx9D3GqYFdX99StyDMV1A+W9fnIehJmFq8Om0HrbLrJAFIFMvQpVxwMjDO39q6Kf/UWyhg==} + cpu: [x64] + os: [linux] + + '@nx/nx-linux-x64-musl@21.0.3': + resolution: {integrity: sha512-Rg0xjGoikWbhnEANSP3KwRtYHJmq1P1pv31zvPjeZI9nFNLyCRsJYSpnlE5BfP8a8XlzdqlLO0Df0XmL5Fdyew==} + cpu: [x64] + os: [linux] + + '@nx/nx-win32-arm64-msvc@21.0.3': + resolution: {integrity: sha512-LyxCffeta+4ad70043ZQ1/lFdOzpFpx8zmwVLhASTmZ6jdrePKPyxn+uSv0AWOiEVpGiZHr3Yh47YfrlWBO+wA==} + cpu: [arm64] + os: [win32] + + '@nx/nx-win32-x64-msvc@21.0.3': + resolution: {integrity: sha512-1lyRNwjDax8Nvemt8wpbYiyRjIvrnBrzZTEkm7z5rDV2RX2Ik06EOZHWWtqHmdfx1EPV2omvVWRmmqLHI98YLA==} + cpu: [x64] + os: [win32] + '@one-ini/wasm@0.1.1': resolution: {integrity: sha512-XuySG1E38YScSJoMlqovLru4KTUNSjgVTIjyh7qMX6aNN5HY5Ct5LhRJdxO79JtTzKfzV/bnWpz+zquYrISsvw==} @@ -3764,12 +3789,24 @@ packages: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} - '@pkgr/core@0.1.1': - resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} + '@pkgr/core@0.2.4': + resolution: {integrity: sha512-ROFF39F6ZrnzSUEmQQZUar0Jt4xVoP9WnDRdWwF4NNcXs3xBTLgBUDoOwW141y1jP+S8nahIbdxbFC7IShw9Iw==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - '@polka/url@1.0.0-next.28': - resolution: {integrity: sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==} + '@pnpm/config.env-replace@1.1.0': + resolution: {integrity: sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==} + engines: {node: '>=12.22.0'} + + '@pnpm/network.ca-file@1.0.2': + resolution: {integrity: sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==} + engines: {node: '>=12.22.0'} + + '@pnpm/npm-conf@2.3.1': + resolution: {integrity: sha512-c83qWb22rNRuB0UaVCI0uRPNRr8Z0FWnEIvT47jiHAmOIUHbBOg5XvV7pM5x+rKn9HRpjxquDbXYSXr3fAKFcw==} + engines: {node: '>=12'} + + '@polka/url@1.0.0-next.29': + resolution: {integrity: sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==} '@poppinss/colors@4.1.4': resolution: {integrity: sha512-FA+nTU8p6OcSH4tLDY5JilGYr1bVWHpNmcLr7xmMEdbWmKHa+3QZ+DqefrXKmdjO/brHTnQZo20lLSjaO7ydog==} @@ -3790,14 +3827,17 @@ packages: '@radix-ui/colors@3.0.0': resolution: {integrity: sha512-FUOsGBkHrYJwCSEtWRCIfQbZG7q1e6DgxCIOe1SUQzDe/7rXXeA47s8yCn6fuTNQAj1Zq4oTFi9Yjp3wzElcxg==} - '@radix-ui/number@1.1.0': - resolution: {integrity: sha512-V3gRzhVNU1ldS5XhAPTom1fOIo4ccrjjJgmE+LI2h/WaFpHmx0MQApT+KZHnx8abG6Avtfcz4WoEciMnpFT3HQ==} + '@radix-ui/number@1.1.1': + resolution: {integrity: sha512-MkKCwxlXTgz6CFoJx3pCwn07GKp36+aZyu/u2Ln2VrA5DcdyCZkASEDBTd8x5whTQQL5CiYf4prXKLcgQdv29g==} '@radix-ui/primitive@1.1.1': resolution: {integrity: sha512-SJ31y+Q/zAyShtXJc8x83i9TYdbAfHZ++tUZnvjJJqFjzsdUnKsxPL6IEtBlxKkU7yzer//GQtZSV4GbldL3YA==} - '@radix-ui/react-accessible-icon@1.1.2': - resolution: {integrity: sha512-+rnMO0SEfzkcHr93RshkQVpOA26MtGOv4pcS9QUnLg4F8+GDmCJ8c2FEPhPz5e7arf31EzbTqJxFbzg3qen14g==} + '@radix-ui/primitive@1.1.2': + resolution: {integrity: sha512-XnbHrrprsNqZKQhStrSwgRUQzoCI1glLzdw79xiZPoofhGICeZRSQ3dIxAKH1gb3OHfNf4d6f+vAv3kil2eggA==} + + '@radix-ui/react-accessible-icon@1.1.6': + resolution: {integrity: sha512-Eh+3JK1ApmX7DYGMquj6gctxmbLX4JD+5kn1Pi/VlFGdHvod+dtoFoAGEkz3Muy/E+MVC7P77MPC5zqAaxrHxg==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -3809,8 +3849,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-alert-dialog@1.1.6': - resolution: {integrity: sha512-p4XnPqgej8sZAAReCAKgz1REYZEBLR8hU9Pg27wFnCWIMc8g1ccCs0FjBcy05V15VTu8pAePw/VDYeOm/uZ6yQ==} + '@radix-ui/react-alert-dialog@1.1.13': + resolution: {integrity: sha512-/uPs78OwxGxslYOG5TKeUsv9fZC0vo376cXSADdKirTmsLJU2au6L3n34c3p6W26rFDDDze/hwy4fYeNd0qdGA==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -3822,8 +3862,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-arrow@1.1.2': - resolution: {integrity: sha512-G+KcpzXHq24iH0uGG/pF8LyzpFJYGD4RfLjCIBfGdSLXvjLHST31RUiRVrupIBMvIppMgSzQ6l66iAxl03tdlg==} + '@radix-ui/react-arrow@1.1.6': + resolution: {integrity: sha512-2JMfHJf/eVnwq+2dewT3C0acmCWD3XiVA1Da+jTDqo342UlU13WvXtqHhG+yJw5JeQmu4ue2eMy6gcEArLBlcw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -3835,8 +3875,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-aspect-ratio@1.1.2': - resolution: {integrity: sha512-TaJxYoCpxJ7vfEkv2PTNox/6zzmpKXT6ewvCuf2tTOIVN45/Jahhlld29Yw4pciOXS2Xq91/rSGEdmEnUWZCqA==} + '@radix-ui/react-aspect-ratio@1.1.6': + resolution: {integrity: sha512-cZvNiIKqWQjf3DsQk1+wktF3DD73kUbWQ2E/XSh8m2IcpFGwg4IiIvGlVNdovxuozK/9+4QXd2zVlzUMiexSDg==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -3848,8 +3888,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-avatar@1.1.3': - resolution: {integrity: sha512-Paen00T4P8L8gd9bNsRMw7Cbaz85oxiv+hzomsRZgFm2byltPFDtfcoqlWJ8GyZlIBWgLssJlzLCnKU0G0302g==} + '@radix-ui/react-avatar@1.1.9': + resolution: {integrity: sha512-10tQokfvZdFvnvDkcOJPjm2pWiP8A0R4T83MoD7tb15bC/k2GU7B1YBuzJi8lNQ8V1QqhP8ocNqp27ByZaNagQ==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -3861,8 +3901,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-checkbox@1.1.4': - resolution: {integrity: sha512-wP0CPAHq+P5I4INKe3hJrIa1WoNqqrejzW+zoU0rOvo1b9gDEJJFl2rYfO1PYJUQCc2H1WZxIJmyv9BS8i5fLw==} + '@radix-ui/react-checkbox@1.3.1': + resolution: {integrity: sha512-xTaLKAO+XXMPK/BpVTSaAAhlefmvMSACjIhK9mGsImvX2ljcTDm8VGR1CuS1uYcNdR5J+oiOhoJZc5un6bh3VQ==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -3874,8 +3914,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-collection@1.1.2': - resolution: {integrity: sha512-9z54IEKRxIa9VityapoEYMuByaG42iSy1ZXlY2KcuLSEtq8x4987/N6m15ppoMffgZX72gER2uHe1D9Y6Unlcw==} + '@radix-ui/react-collection@1.1.6': + resolution: {integrity: sha512-PbhRFK4lIEw9ADonj48tiYWzkllz81TM7KVYyyMMw2cwHO7D5h4XKEblL8NlaRisTK3QTe6tBEhDccFUryxHBQ==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -3896,8 +3936,17 @@ packages: '@types/react': optional: true - '@radix-ui/react-context-menu@2.2.6': - resolution: {integrity: sha512-aUP99QZ3VU84NPsHeaFt4cQUNgJqFsLLOt/RbbWXszZ6MP0DpDyjkFZORr4RpAEx3sUBk+Kc8h13yGtC5Qw8dg==} + '@radix-ui/react-compose-refs@1.1.2': + resolution: {integrity: sha512-z4eqJvfiNnFMHIIvXP3CY57y2WJs5g2v3X0zm9mEJkrkNv4rDxu+sg9Jh8EkXyeqBkB7SOcboo9dMVqhyrACIg==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-context-menu@2.2.14': + resolution: {integrity: sha512-RUHvrJE2qKAd9pQ50HZZsePio4SMWEh8v6FWQwg/4t6K1fuxfb4Ec40VEVvni6V7nFxmj9srU4UZc7aYp8x0LQ==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -3918,8 +3967,17 @@ packages: '@types/react': optional: true - '@radix-ui/react-dialog@1.1.6': - resolution: {integrity: sha512-/IVhJV5AceX620DUJ4uYVMymzsipdKBzo3edo+omeskCKGm9FRHM0ebIdbPnlQVJqyuHbuBltQUOG2mOTq2IYw==} + '@radix-ui/react-context@1.1.2': + resolution: {integrity: sha512-jCi/QKUM2r1Ju5a3J64TH2A5SpKAgh0LpknyqdQ4m6DCV0xJ2HG1xARRwNGPQfi1SLdLWZ1OJz6F4OMBBNiGJA==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-dialog@1.1.13': + resolution: {integrity: sha512-ARFmqUyhIVS3+riWzwGTe7JLjqwqgnODBUZdqpWar/z1WFs9z76fuOs/2BOWCR+YboRn4/WN9aoaGVwqNRr8VA==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -3931,8 +3989,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-direction@1.1.0': - resolution: {integrity: sha512-BUuBvgThEiAXh2DWu93XsT+a3aWrGqolGlqqw5VU1kG7p/ZH2cuDlM1sRLNnY3QcBS69UIz2mcKhMxDsdewhjg==} + '@radix-ui/react-direction@1.1.1': + resolution: {integrity: sha512-1UEWRX6jnOA2y4H5WczZ44gOOjTEmlqv1uNW4GAJEO5+bauCBhv8snY65Iw5/VOS/ghKN9gr2KjnLKxrsvoMVw==} peerDependencies: '@types/react': '*' react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc @@ -3940,8 +3998,8 @@ packages: '@types/react': optional: true - '@radix-ui/react-dismissable-layer@1.1.5': - resolution: {integrity: sha512-E4TywXY6UsXNRhFrECa5HAvE5/4BFcGyfTyK36gP+pAW1ed7UTK4vKwdr53gAJYwqbfCWC6ATvJa3J3R/9+Qrg==} + '@radix-ui/react-dismissable-layer@1.1.9': + resolution: {integrity: sha512-way197PiTvNp+WBP7svMJasHl+vibhWGQDb6Mgf5mhEWJkgb85z7Lfl9TUdkqpWsf8GRNmoopx9ZxCyDzmgRMQ==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -3953,8 +4011,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-dropdown-menu@2.1.6': - resolution: {integrity: sha512-no3X7V5fD487wab/ZYSHXq3H37u4NVeLDKI/Ks724X/eEFSSEFYZxWgsIlr1UBeEyDaM29HM5x9p1Nv8DuTYPA==} + '@radix-ui/react-dropdown-menu@2.1.14': + resolution: {integrity: sha512-lzuyNjoWOoaMFE/VC5FnAAYM16JmQA8ZmucOXtlhm2kKR5TSU95YLAueQ4JYuRmUJmBvSqXaVFGIfuukybwZJQ==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -3966,8 +4024,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-focus-guards@1.1.1': - resolution: {integrity: sha512-pSIwfrT1a6sIoDASCSpFwOasEwKTZWDw/iBdtnqKO7v6FeOzYJ7U53cPzYFVR3geGGXgVHaH+CdngrrAzqUGxg==} + '@radix-ui/react-focus-guards@1.1.2': + resolution: {integrity: sha512-fyjAACV62oPV925xFCrH8DR5xWhg9KYtJT4s3u54jxp+L/hbpTY2kIeEFFbFe+a/HCE94zGQMZLIpVTPVZDhaA==} peerDependencies: '@types/react': '*' react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc @@ -3975,8 +4033,8 @@ packages: '@types/react': optional: true - '@radix-ui/react-focus-scope@1.1.2': - resolution: {integrity: sha512-zxwE80FCU7lcXUGWkdt6XpTTCKPitG1XKOwViTxHVKIJhZl9MvIl2dVHeZENCWD9+EdWv05wlaEkRXUykU27RA==} + '@radix-ui/react-focus-scope@1.1.6': + resolution: {integrity: sha512-r9zpYNUQY+2jWHWZGyddQLL9YHkM/XvSFHVcWs7bdVuxMAnCwTAuy6Pf47Z4nw7dYcUou1vg/VgjjrrH03VeBw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -4001,8 +4059,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-hover-card@1.1.6': - resolution: {integrity: sha512-E4ozl35jq0VRlrdc4dhHrNSV0JqBb4Jy73WAhBEK7JoYnQ83ED5r0Rb/XdVKw89ReAJN38N492BAPBZQ57VmqQ==} + '@radix-ui/react-hover-card@1.1.13': + resolution: {integrity: sha512-Wtjvx0d/6Bgd/jAYS1mW6IPSUQ25y0hkUSOS1z5/4+U8+DJPwKroqJlM/AlVFl3LywGoruiPmcvB9Aks9mSOQw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -4028,6 +4086,15 @@ packages: '@types/react': optional: true + '@radix-ui/react-id@1.1.1': + resolution: {integrity: sha512-kGkGegYIdQsOb4XjsfM97rXsiHaBwco+hFI66oO4s9LU+PLAC5oJ7khdOVFxkhsmlbpUqDAvXw11CluXP+jkHg==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@radix-ui/react-label@2.1.1': resolution: {integrity: sha512-UUw5E4e/2+4kFMH7+YxORXGWggtY6sM8WIwh5RZchhLuUg2H1hc98Py+pr8HMz6rdaYrK2t296ZEjYLOCO5uUw==} peerDependencies: @@ -4041,8 +4108,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-menu@2.1.6': - resolution: {integrity: sha512-tBBb5CXDJW3t2mo9WlO7r6GTmWV0F0uzHZVFmlRmYpiSK1CDU5IKojP1pm7oknpBOrFZx/YgBRW9oorPO2S/Lg==} + '@radix-ui/react-menu@2.1.14': + resolution: {integrity: sha512-0zSiBAIFq9GSKoSH5PdEaQeRB3RnEGxC+H2P0egtnKoKKLNBH8VBHyVO6/jskhjAezhOIplyRUj7U2lds9A+Yg==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -4054,8 +4121,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-navigation-menu@1.2.5': - resolution: {integrity: sha512-myMHHQUZ3ZLTi8W381/Vu43Ia0NqakkQZ2vzynMmTUtQQ9kNkjzhOwkZC9TAM5R07OZUVIQyHC06f/9JZJpvvA==} + '@radix-ui/react-navigation-menu@1.2.12': + resolution: {integrity: sha512-iExvawdu7n6DidDJRU5pMTdi+Z3DaVPN4UZbAGuTs7nJA8P4RvvkEz+XYI2UJjb/Hh23RrH19DakgZNLdaq9Bw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -4067,8 +4134,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-popover@1.1.6': - resolution: {integrity: sha512-NQouW0x4/GnkFJ/pRqsIS3rM/k97VzKnVb2jB7Gq7VEGPy5g7uNV1ykySFt7eWSp3i2uSGFwaJcvIRJBAHmmFg==} + '@radix-ui/react-popover@1.1.13': + resolution: {integrity: sha512-84uqQV3omKDR076izYgcha6gdpN8m3z6w/AeJ83MSBJYVG/AbOHdLjAgsPZkeC/kt+k64moXFCnio8BbqXszlw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -4080,8 +4147,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-popper@1.2.2': - resolution: {integrity: sha512-Rvqc3nOpwseCyj/rgjlJDYAgyfw7OC1tTkKn2ivhaMGcYt8FSBlahHOZak2i3QwkRXUXgGgzeEe2RuqeEHuHgA==} + '@radix-ui/react-popper@1.2.6': + resolution: {integrity: sha512-7iqXaOWIjDBfIG7aq8CUEeCSsQMLFdn7VEE8TaFz704DtEzpPHR7w/uuzRflvKgltqSAImgcmxQ7fFX3X7wasg==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -4093,8 +4160,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-portal@1.1.4': - resolution: {integrity: sha512-sn2O9k1rPFYVyKd5LAJfo96JlSGVFpa1fS6UuBJfrZadudiw5tAmru+n1x7aMRQ84qDM71Zh1+SzK5QwU0tJfA==} + '@radix-ui/react-portal@1.1.8': + resolution: {integrity: sha512-hQsTUIn7p7fxCPvao/q6wpbxmCwgLrlz+nOrJgC+RwfZqWY/WN+UMqkXzrtKbPrF82P43eCTl3ekeKuyAQbFeg==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -4106,8 +4173,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-presence@1.1.2': - resolution: {integrity: sha512-18TFr80t5EVgL9x1SwF/YGtfG+l0BS0PRAlCWBDoBEiDQjeKgnNZRVJp/oVBl24sr3Gbfwc/Qpj4OcWTQMsAEg==} + '@radix-ui/react-presence@1.1.4': + resolution: {integrity: sha512-ueDqRbdc4/bkaQT3GIpLQssRlFgWaL/U2z/S31qRwwLWoxHLgry3SIfCwhxeQNbirEUXFa+lq3RL3oBYXtcmIA==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -4132,8 +4199,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-primitive@2.0.2': - resolution: {integrity: sha512-Ec/0d38EIuvDF+GZjcMU/Ze6MxntVJYO/fRlCPhCaVUyPY9WTalHJw54tp9sXeJo3tlShWpy41vQRgLRGOuz+w==} + '@radix-ui/react-primitive@2.1.2': + resolution: {integrity: sha512-uHa+l/lKfxuDD2zjN/0peM/RhhSmRjr5YWdk/37EnSv1nJ88uvG85DPexSm8HdFQROd2VdERJ6ynXbkCFi+APw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -4145,8 +4212,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-progress@1.1.2': - resolution: {integrity: sha512-u1IgJFQ4zNAUTjGdDL5dcl/U8ntOR6jsnhxKb5RKp5Ozwl88xKR9EqRZOe/Mk8tnx0x5tNUe2F+MzsyjqMg0MA==} + '@radix-ui/react-progress@1.1.6': + resolution: {integrity: sha512-QzN9a36nKk2eZKMf9EBCia35x3TT+SOgZuzQBVIHyRrmYYi73VYBRK3zKwdJ6az/F5IZ6QlacGJBg7zfB85liA==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -4158,8 +4225,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-radio-group@1.2.3': - resolution: {integrity: sha512-xtCsqt8Rp09FK50ItqEqTJ7Sxanz8EM8dnkVIhJrc/wkMMomSmXHvYbhv3E7Zx4oXh98aaLt9W679SUYXg4IDA==} + '@radix-ui/react-radio-group@1.3.6': + resolution: {integrity: sha512-1tfTAqnYZNVwSpFhCT273nzK8qGBReeYnNTPspCggqk1fvIrfVxJekIuBFidNivzpdiMqDwVGnQvHqXrRPM4Og==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -4171,8 +4238,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-roving-focus@1.1.2': - resolution: {integrity: sha512-zgMQWkNO169GtGqRvYrzb0Zf8NhMHS2DuEB/TiEmVnpr5OqPU3i8lfbxaAmC2J/KYuIQxyoQQ6DxepyXp61/xw==} + '@radix-ui/react-roving-focus@1.1.9': + resolution: {integrity: sha512-ZzrIFnMYHHCNqSNCsuN6l7wlewBEq0O0BCSBkabJMFXVO51LRUTq71gLP1UxFvmrXElqmPjA5VX7IqC9VpazAQ==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -4184,8 +4251,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-scroll-area@1.2.3': - resolution: {integrity: sha512-l7+NNBfBYYJa9tNqVcP2AGvxdE3lmE6kFTBXdvHgUaZuy+4wGCL1Cl2AfaR7RKyimj7lZURGLwFO59k4eBnDJQ==} + '@radix-ui/react-scroll-area@1.2.8': + resolution: {integrity: sha512-K5h1RkYA6M0Sn61BV5LQs686zqBsSC0sGzL4/Gw4mNnjzrQcGSc6YXfC6CRFNaGydSdv5+M8cb0eNsOGo0OXtQ==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -4197,8 +4264,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-select@2.1.6': - resolution: {integrity: sha512-T6ajELxRvTuAMWH0YmRJ1qez+x4/7Nq7QIx7zJ0VK3qaEWdnWpNbEDnmWldG1zBDwqrLy5aLMUWcoGirVj5kMg==} + '@radix-ui/react-select@2.2.4': + resolution: {integrity: sha512-/OOm58Gil4Ev5zT8LyVzqfBcij4dTHYdeyuF5lMHZ2bIp0Lk9oETocYiJ5QC0dHekEQnK6L/FNJCceeb4AkZ6Q==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -4210,8 +4277,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-slider@1.2.3': - resolution: {integrity: sha512-nNrLAWLjGESnhqBqcCNW4w2nn7LxudyMzeB6VgdyAnFLC6kfQgnAjSL2v6UkQTnDctJBlxrmxfplWS4iYjdUTw==} + '@radix-ui/react-slider@1.3.4': + resolution: {integrity: sha512-Cp6hEmQtRJFci285vkdIJ+HCDLTRDk+25VhFwa1fcubywjMUE3PynBgtN5RLudOgSCYMlT4jizCXdmV+8J7Y2w==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -4232,8 +4299,8 @@ packages: '@types/react': optional: true - '@radix-ui/react-slot@1.1.2': - resolution: {integrity: sha512-YAKxaiGsSQJ38VzKH86/BPRC4rh+b1Jpa+JneA5LRE7skmLPNAyeG8kPJj/oo4STLvlrs8vkf/iYyc3A5stYCQ==} + '@radix-ui/react-slot@1.2.2': + resolution: {integrity: sha512-y7TBO4xN4Y94FvcWIOIh18fM4R1A8S4q1jhoz4PNzOoHsFcN8pogcFmZrTYAm4F9VRUrWP/Mw7xSKybIeRI+CQ==} peerDependencies: '@types/react': '*' react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc @@ -4241,8 +4308,8 @@ packages: '@types/react': optional: true - '@radix-ui/react-switch@1.1.3': - resolution: {integrity: sha512-1nc+vjEOQkJVsJtWPSiISGT6OKm4SiOdjMo+/icLxo2G4vxz1GntC5MzfL4v8ey9OEfw787QCD1y3mUv0NiFEQ==} + '@radix-ui/react-switch@1.2.4': + resolution: {integrity: sha512-yZCky6XZFnR7pcGonJkr9VyNRu46KcYAbyg1v/gVVCZUr8UJ4x+RpncC27hHtiZ15jC+3WS8Yg/JSgyIHnYYsQ==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -4254,8 +4321,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-tabs@1.1.3': - resolution: {integrity: sha512-9mFyI30cuRDImbmFF6O2KUJdgEOsGh9Vmx9x/Dh9tOhL7BngmQPQfwW4aejKm5OHpfWIdmeV6ySyuxoOGjtNng==} + '@radix-ui/react-tabs@1.1.11': + resolution: {integrity: sha512-4FiKSVoXqPP/KfzlB7lwwqoFV6EPwkrrqGp9cUYXjwDYHhvpnqq79P+EPHKcdoTE7Rl8w/+6s9rTlsfXHES9GA==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -4267,8 +4334,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-toggle-group@1.1.2': - resolution: {integrity: sha512-JBm6s6aVG/nwuY5eadhU2zDi/IwYS0sDM5ZWb4nymv/hn3hZdkw+gENn0LP4iY1yCd7+bgJaCwueMYJIU3vk4A==} + '@radix-ui/react-toggle-group@1.1.9': + resolution: {integrity: sha512-HJ6gXdYVN38q/5KDdCcd+JTuXUyFZBMJbwXaU/82/Gi+V2ps6KpiZ2sQecAeZCV80POGRfkUBdUIj6hIdF6/MQ==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -4280,8 +4347,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-toggle@1.1.2': - resolution: {integrity: sha512-lntKchNWx3aCHuWKiDY+8WudiegQvBpDRAYL8dKLRvKEH8VOpl0XX6SSU/bUBqIRJbcTy4+MW06Wv8vgp10rzQ==} + '@radix-ui/react-toggle@1.1.8': + resolution: {integrity: sha512-hrpa59m3zDnsa35LrTOH5s/a3iGv/VD+KKQjjiCTo/W4r0XwPpiWQvAv6Xl1nupSoaZeNNxW6sJH9ZydsjKdYQ==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -4293,8 +4360,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-tooltip@1.1.8': - resolution: {integrity: sha512-YAA2cu48EkJZdAMHC0dqo9kialOcRStbtiY4nJPaht7Ptrhcvpo+eDChaM6BIs8kL6a8Z5l5poiqLnXcNduOkA==} + '@radix-ui/react-tooltip@1.2.6': + resolution: {integrity: sha512-zYb+9dc9tkoN2JjBDIIPLQtk3gGyz8FMKoqYTb8EMVQ5a5hBcdHPECrsZVI4NpPAUOixhkoqg7Hj5ry5USowfA==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -4306,8 +4373,26 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-use-callback-ref@1.1.0': - resolution: {integrity: sha512-CasTfvsy+frcFkbXtSJ2Zu9JHpN8TYKxkgJGWbjiZhFivxaeW7rMeZt7QELGVLaYVfFMsKHjb7Ak0nMEe+2Vfw==} + '@radix-ui/react-use-callback-ref@1.1.1': + resolution: {integrity: sha512-FkBMwD+qbGQeMu1cOHnuGB6x4yzPjho8ap5WtbEJ26umhgqVXbhekKUQO+hZEL1vU92a3wHwdp0HAcqAUF5iDg==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-use-controllable-state@1.2.2': + resolution: {integrity: sha512-BjasUjixPFdS+NKkypcyyN5Pmg83Olst0+c6vGov0diwTEo6mgdqVR6hxcEgFuh4QrAs7Rc+9KuGJ9TVCj0Zzg==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-use-effect-event@0.0.2': + resolution: {integrity: sha512-Qp8WbZOBe+blgpuUT+lw2xheLP8q0oatc9UpmiemEICxGvFLYmHm9QowVZGHtJlGbS6A6yJ3iViad/2cVjnOiA==} peerDependencies: '@types/react': '*' react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc @@ -4315,8 +4400,8 @@ packages: '@types/react': optional: true - '@radix-ui/react-use-controllable-state@1.1.0': - resolution: {integrity: sha512-MtfMVJiSr2NjzS0Aa90NPTnvTSg6C/JLCV7ma0W6+OMV78vd8OyRpID+Ng9LxzsPbLeuBnWBA1Nq30AtBIDChw==} + '@radix-ui/react-use-escape-keydown@1.1.1': + resolution: {integrity: sha512-Il0+boE7w/XebUHyBjroE+DbByORGR9KKmITzbR7MyQ4akpORYP/ZmbhAr0DG7RmmBqoOnZdy2QlvajJ2QA59g==} peerDependencies: '@types/react': '*' react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc @@ -4324,8 +4409,8 @@ packages: '@types/react': optional: true - '@radix-ui/react-use-escape-keydown@1.1.0': - resolution: {integrity: sha512-L7vwWlR1kTTQ3oh7g1O0CBF3YCyyTj8NmhLR+phShpyA50HCfBFKVJTpshm9PzLiKmehsrQzTYTpX9HvmC9rhw==} + '@radix-ui/react-use-is-hydrated@0.1.0': + resolution: {integrity: sha512-U+UORVEq+cTnRIaostJv9AGdV3G6Y+zbVd+12e18jQ5A3c0xL03IhnHuiU4UV69wolOQp5GfR58NW/EgdQhwOA==} peerDependencies: '@types/react': '*' react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc @@ -4342,8 +4427,17 @@ packages: '@types/react': optional: true - '@radix-ui/react-use-previous@1.1.0': - resolution: {integrity: sha512-Z/e78qg2YFnnXcW88A4JmTtm4ADckLno6F7OXotmkQfeuCVaKuYzqAATPhVzl3delXE7CxIV8shofPn3jPc5Og==} + '@radix-ui/react-use-layout-effect@1.1.1': + resolution: {integrity: sha512-RbJRS4UWQFkzHTTwVymMTUv8EqYhOp8dOOviLj2ugtTiXRaRQS7GLGxZTLL1jWhMeoSCf5zmcZkqTl9IiYfXcQ==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-use-previous@1.1.1': + resolution: {integrity: sha512-2dHfToCj/pzca2Ck724OZ5L0EVrr3eHRNsG/b3xQJLA2hZpVCS99bLAX+hm1IHXDEnzU6by5z/5MIY794/a8NQ==} peerDependencies: '@types/react': '*' react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc @@ -4351,8 +4445,8 @@ packages: '@types/react': optional: true - '@radix-ui/react-use-rect@1.1.0': - resolution: {integrity: sha512-0Fmkebhr6PiseyZlYAOtLS+nb7jLmpqTrJyv61Pe68MKYW6OWdRE2kI70TaYY27u7H0lajqM3hSMMLFq18Z7nQ==} + '@radix-ui/react-use-rect@1.1.1': + resolution: {integrity: sha512-QTYuDesS0VtuHNNvMh+CjlKJ4LJickCMUAqjlE3+j8w+RlRpwyX3apEQKGFzbZGdo7XNG1tXa+bQqIE7HIXT2w==} peerDependencies: '@types/react': '*' react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc @@ -4360,8 +4454,8 @@ packages: '@types/react': optional: true - '@radix-ui/react-use-size@1.1.0': - resolution: {integrity: sha512-XW3/vWuIXHa+2Uwcc2ABSfcCledmXhhQPlGbfcRXbiUQI5Icjcg19BGCZVKKInYbvUCut/ufbbLLPFC5cbb1hw==} + '@radix-ui/react-use-size@1.1.1': + resolution: {integrity: sha512-ewrXRDTAqAXlkl6t/fkXWNAhFX9I+CkKlw6zjEwk86RSPKwZr3xpBRso655aqYafwtnbpHLj6toFzmd6xdVptQ==} peerDependencies: '@types/react': '*' react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc @@ -4369,8 +4463,8 @@ packages: '@types/react': optional: true - '@radix-ui/react-visually-hidden@1.1.2': - resolution: {integrity: sha512-1SzA4ns2M1aRlvxErqhLHsBHoS5eI5UUcI2awAMgGUp4LoaoWOKYmvqDY2s/tltuPkh3Yk77YF/r3IRj+Amx4Q==} + '@radix-ui/react-visually-hidden@1.2.2': + resolution: {integrity: sha512-ORCmRUbNiZIv6uV5mhFrhsIKw4UX/N3syZtyqvry61tbGm4JlgQuSn0hk5TwCARsCjkcnuRkSdCE3xfb+ADHew==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -4382,8 +4476,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/rect@1.1.0': - resolution: {integrity: sha512-A9+lCBZoaMJlVKcRBz2YByCG+Cp2t6nAnMnNba+XiWxnj6r4JUFqfsgwocMBZU9LPtdxC6wB56ySYpc7LQIoJg==} + '@radix-ui/rect@1.1.1': + resolution: {integrity: sha512-HPwpGIzkl28mWyZqG52jiqDJ12waP11Pa1lGoiyUkIEuMLBP0oeK/C89esbXrxsky5we7dfd8U58nm0SgAWpVw==} '@radix-ui/themes@3.1.6': resolution: {integrity: sha512-4uaUK0E+3ZRURohKNqnzG8LciTJcpppuBbYxkp7miLyPiaXBwKTrEttdQpExsp/fP6J+ss+JHy5FJhU5lboQkg==} @@ -4398,16 +4492,6 @@ packages: '@types/react-dom': optional: true - '@redocly/ajv@8.11.2': - resolution: {integrity: sha512-io1JpnwtIcvojV7QKDUSIuMN/ikdOUd1ReEnUnMKGfDVridQZ31J0MmIuqwuRjWDZfmvr+Q0MqCcfHM2gTivOg==} - - '@redocly/config@0.22.1': - resolution: {integrity: sha512-1CqQfiG456v9ZgYBG9xRQHnpXjt8WoSnDwdkX6gxktuK69v2037hTAR1eh0DGIqpZ1p4k82cGH8yTNwt7/pI9g==} - - '@redocly/openapi-core@1.33.1': - resolution: {integrity: sha512-tL3v8FVwdcCAcruOZV77uxH2ZFtnY3DRPG+rgmlm9hsu5uoatofVSJIJHUroz54KJ8ryeo28wQHhOr8iReGGEQ==} - engines: {node: '>=18.17.0', npm: '>=9.5.0'} - '@rollup/plugin-alias@5.1.1': resolution: {integrity: sha512-PR9zDb+rOzkRb2VD+EuKB7UC41vU5DIwZ5qqCpk0KJudcWAyi8rvYOhS7+L5aZCspw1stTViLgN5v6FF1p5cgQ==} engines: {node: '>=14.0.0'} @@ -4517,13 +4601,8 @@ packages: cpu: [arm] os: [android] - '@rollup/rollup-android-arm-eabi@4.39.0': - resolution: {integrity: sha512-lGVys55Qb00Wvh8DMAocp5kIcaNzEFTmGhfFd88LfaogYTRKrdxgtlO5H6S49v2Nd8R2C6wLOal0qv6/kCkOwA==} - cpu: [arm] - os: [android] - - '@rollup/rollup-android-arm-eabi@4.41.1': - resolution: {integrity: sha512-NELNvyEWZ6R9QMkiytB4/L4zSEaBC03KIXEghptLGLZWJ6VPrL63ooZQCOnlx36aQPGhzuOMwDerC1Eb2VmrLw==} + '@rollup/rollup-android-arm-eabi@4.40.2': + resolution: {integrity: sha512-JkdNEq+DFxZfUwxvB58tHMHBHVgX23ew41g1OQinthJ+ryhdRk67O31S7sYw8u2lTjHUPFxwar07BBt1KHp/hg==} cpu: [arm] os: [android] @@ -4537,13 +4616,8 @@ packages: cpu: [arm64] os: [android] - '@rollup/rollup-android-arm64@4.39.0': - resolution: {integrity: sha512-It9+M1zE31KWfqh/0cJLrrsCPiF72PoJjIChLX+rEcujVRCb4NLQ5QzFkzIZW8Kn8FTbvGQBY5TkKBau3S8cCQ==} - cpu: [arm64] - os: [android] - - '@rollup/rollup-android-arm64@4.41.1': - resolution: {integrity: sha512-DXdQe1BJ6TK47ukAoZLehRHhfKnKg9BjnQYUu9gzhI8Mwa1d2fzxA1aw2JixHVl403bwp1+/o/NhhHtxWJBgEA==} + '@rollup/rollup-android-arm64@4.40.2': + resolution: {integrity: sha512-13unNoZ8NzUmnndhPTkWPWbX3vtHodYmy+I9kuLxN+F+l+x3LdVF7UCu8TWVMt1POHLh6oDHhnOA04n8oJZhBw==} cpu: [arm64] os: [android] @@ -4557,13 +4631,8 @@ packages: cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-arm64@4.39.0': - resolution: {integrity: sha512-lXQnhpFDOKDXiGxsU9/l8UEGGM65comrQuZ+lDcGUx+9YQ9dKpF3rSEGepyeR5AHZ0b5RgiligsBhWZfSSQh8Q==} - cpu: [arm64] - os: [darwin] - - '@rollup/rollup-darwin-arm64@4.41.1': - resolution: {integrity: sha512-5afxvwszzdulsU2w8JKWwY8/sJOLPzf0e1bFuvcW5h9zsEg+RQAojdW0ux2zyYAz7R8HvvzKCjLNJhVq965U7w==} + '@rollup/rollup-darwin-arm64@4.40.2': + resolution: {integrity: sha512-Gzf1Hn2Aoe8VZzevHostPX23U7N5+4D36WJNHK88NZHCJr7aVMG4fadqkIf72eqVPGjGc0HJHNuUaUcxiR+N/w==} cpu: [arm64] os: [darwin] @@ -4577,13 +4646,8 @@ packages: cpu: [x64] os: [darwin] - '@rollup/rollup-darwin-x64@4.39.0': - resolution: {integrity: sha512-mKXpNZLvtEbgu6WCkNij7CGycdw9cJi2k9v0noMb++Vab12GZjFgUXD69ilAbBh034Zwn95c2PNSz9xM7KYEAQ==} - cpu: [x64] - os: [darwin] - - '@rollup/rollup-darwin-x64@4.41.1': - resolution: {integrity: sha512-egpJACny8QOdHNNMZKf8xY0Is6gIMz+tuqXlusxquWu3F833DcMwmGM7WlvCO9sB3OsPjdC4U0wHw5FabzCGZg==} + '@rollup/rollup-darwin-x64@4.40.2': + resolution: {integrity: sha512-47N4hxa01a4x6XnJoskMKTS8XZ0CZMd8YTbINbi+w03A2w4j1RTlnGHOz/P0+Bg1LaVL6ufZyNprSg+fW5nYQQ==} cpu: [x64] os: [darwin] @@ -4597,13 +4661,8 @@ packages: cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-arm64@4.39.0': - resolution: {integrity: sha512-jivRRlh2Lod/KvDZx2zUR+I4iBfHcu2V/BA2vasUtdtTN2Uk3jfcZczLa81ESHZHPHy4ih3T/W5rPFZ/hX7RtQ==} - cpu: [arm64] - os: [freebsd] - - '@rollup/rollup-freebsd-arm64@4.41.1': - resolution: {integrity: sha512-DBVMZH5vbjgRk3r0OzgjS38z+atlupJ7xfKIDJdZZL6sM6wjfDNo64aowcLPKIx7LMQi8vybB56uh1Ftck/Atg==} + '@rollup/rollup-freebsd-arm64@4.40.2': + resolution: {integrity: sha512-8t6aL4MD+rXSHHZUR1z19+9OFJ2rl1wGKvckN47XFRVO+QL/dUSpKA2SLRo4vMg7ELA8pzGpC+W9OEd1Z/ZqoQ==} cpu: [arm64] os: [freebsd] @@ -4617,13 +4676,8 @@ packages: cpu: [x64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.39.0': - resolution: {integrity: sha512-8RXIWvYIRK9nO+bhVz8DwLBepcptw633gv/QT4015CpJ0Ht8punmoHU/DuEd3iw9Hr8UwUV+t+VNNuZIWYeY7Q==} - cpu: [x64] - os: [freebsd] - - '@rollup/rollup-freebsd-x64@4.41.1': - resolution: {integrity: sha512-3FkydeohozEskBxNWEIbPfOE0aqQgB6ttTkJ159uWOFn42VLyfAiyD9UK5mhu+ItWzft60DycIN1Xdgiy8o/SA==} + '@rollup/rollup-freebsd-x64@4.40.2': + resolution: {integrity: sha512-C+AyHBzfpsOEYRFjztcYUFsH4S7UsE9cDtHCtma5BK8+ydOZYgMmWg1d/4KBytQspJCld8ZIujFMAdKG1xyr4Q==} cpu: [x64] os: [freebsd] @@ -4637,13 +4691,8 @@ packages: cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-gnueabihf@4.39.0': - resolution: {integrity: sha512-mz5POx5Zu58f2xAG5RaRRhp3IZDK7zXGk5sdEDj4o96HeaXhlUwmLFzNlc4hCQi5sGdR12VDgEUqVSHer0lI9g==} - cpu: [arm] - os: [linux] - - '@rollup/rollup-linux-arm-gnueabihf@4.41.1': - resolution: {integrity: sha512-wC53ZNDgt0pqx5xCAgNunkTzFE8GTgdZ9EwYGVcg+jEjJdZGtq9xPjDnFgfFozQI/Xm1mh+D9YlYtl+ueswNEg==} + '@rollup/rollup-linux-arm-gnueabihf@4.40.2': + resolution: {integrity: sha512-de6TFZYIvJwRNjmW3+gaXiZ2DaWL5D5yGmSYzkdzjBDS3W+B9JQ48oZEsmMvemqjtAFzE16DIBLqd6IQQRuG9Q==} cpu: [arm] os: [linux] @@ -4657,13 +4706,8 @@ packages: cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.39.0': - resolution: {integrity: sha512-+YDwhM6gUAyakl0CD+bMFpdmwIoRDzZYaTWV3SDRBGkMU/VpIBYXXEvkEcTagw/7VVkL2vA29zU4UVy1mP0/Yw==} - cpu: [arm] - os: [linux] - - '@rollup/rollup-linux-arm-musleabihf@4.41.1': - resolution: {integrity: sha512-jwKCca1gbZkZLhLRtsrka5N8sFAaxrGz/7wRJ8Wwvq3jug7toO21vWlViihG85ei7uJTpzbXZRcORotE+xyrLA==} + '@rollup/rollup-linux-arm-musleabihf@4.40.2': + resolution: {integrity: sha512-urjaEZubdIkacKc930hUDOfQPysezKla/O9qV+O89enqsqUmQm8Xj8O/vh0gHg4LYfv7Y7UsE3QjzLQzDYN1qg==} cpu: [arm] os: [linux] @@ -4677,13 +4721,8 @@ packages: cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.39.0': - resolution: {integrity: sha512-EKf7iF7aK36eEChvlgxGnk7pdJfzfQbNvGV/+l98iiMwU23MwvmV0Ty3pJ0p5WQfm3JRHOytSIqD9LB7Bq7xdQ==} - cpu: [arm64] - os: [linux] - - '@rollup/rollup-linux-arm64-gnu@4.41.1': - resolution: {integrity: sha512-g0UBcNknsmmNQ8V2d/zD2P7WWfJKU0F1nu0k5pW4rvdb+BIqMm8ToluW/eeRmxCared5dD76lS04uL4UaNgpNA==} + '@rollup/rollup-linux-arm64-gnu@4.40.2': + resolution: {integrity: sha512-KlE8IC0HFOC33taNt1zR8qNlBYHj31qGT1UqWqtvR/+NuCVhfufAq9fxO8BMFC22Wu0rxOwGVWxtCMvZVLmhQg==} cpu: [arm64] os: [linux] @@ -4697,13 +4736,8 @@ packages: cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.39.0': - resolution: {integrity: sha512-vYanR6MtqC7Z2SNr8gzVnzUul09Wi1kZqJaek3KcIlI/wq5Xtq4ZPIZ0Mr/st/sv/NnaPwy/D4yXg5x0B3aUUA==} - cpu: [arm64] - os: [linux] - - '@rollup/rollup-linux-arm64-musl@4.41.1': - resolution: {integrity: sha512-XZpeGB5TKEZWzIrj7sXr+BEaSgo/ma/kCgrZgL0oo5qdB1JlTzIYQKel/RmhT6vMAvOdM2teYlAaOGJpJ9lahg==} + '@rollup/rollup-linux-arm64-musl@4.40.2': + resolution: {integrity: sha512-j8CgxvfM0kbnhu4XgjnCWJQyyBOeBI1Zq91Z850aUddUmPeQvuAy6OiMdPS46gNFgy8gN1xkYyLgwLYZG3rBOg==} cpu: [arm64] os: [linux] @@ -4717,13 +4751,8 @@ packages: cpu: [loong64] os: [linux] - '@rollup/rollup-linux-loongarch64-gnu@4.39.0': - resolution: {integrity: sha512-NMRUT40+h0FBa5fb+cpxtZoGAggRem16ocVKIv5gDB5uLDgBIwrIsXlGqYbLwW8YyO3WVTk1FkFDjMETYlDqiw==} - cpu: [loong64] - os: [linux] - - '@rollup/rollup-linux-loongarch64-gnu@4.41.1': - resolution: {integrity: sha512-bkCfDJ4qzWfFRCNt5RVV4DOw6KEgFTUZi2r2RuYhGWC8WhCA8lCAJhDeAmrM/fdiAH54m0mA0Vk2FGRPyzI+tw==} + '@rollup/rollup-linux-loongarch64-gnu@4.40.2': + resolution: {integrity: sha512-Ybc/1qUampKuRF4tQXc7G7QY9YRyeVSykfK36Y5Qc5dmrIxwFhrOzqaVTNoZygqZ1ZieSWTibfFhQ5qK8jpWxw==} cpu: [loong64] os: [linux] @@ -4737,13 +4766,8 @@ packages: cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-powerpc64le-gnu@4.39.0': - resolution: {integrity: sha512-0pCNnmxgduJ3YRt+D+kJ6Ai/r+TaePu9ZLENl+ZDV/CdVczXl95CbIiwwswu4L+K7uOIGf6tMo2vm8uadRaICQ==} - cpu: [ppc64] - os: [linux] - - '@rollup/rollup-linux-powerpc64le-gnu@4.41.1': - resolution: {integrity: sha512-3mr3Xm+gvMX+/8EKogIZSIEF0WUu0HL9di+YWlJpO8CQBnoLAEL/roTCxuLncEdgcfJcvA4UMOf+2dnjl4Ut1A==} + '@rollup/rollup-linux-powerpc64le-gnu@4.40.2': + resolution: {integrity: sha512-3FCIrnrt03CCsZqSYAOW/k9n625pjpuMzVfeI+ZBUSDT3MVIFDSPfSUgIl9FqUftxcUXInvFah79hE1c9abD+Q==} cpu: [ppc64] os: [linux] @@ -4757,23 +4781,13 @@ packages: cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.39.0': - resolution: {integrity: sha512-t7j5Zhr7S4bBtksT73bO6c3Qa2AV/HqiGlj9+KB3gNF5upcVkx+HLgxTm8DK4OkzsOYqbdqbLKwvGMhylJCPhQ==} - cpu: [riscv64] - os: [linux] - - '@rollup/rollup-linux-riscv64-gnu@4.41.1': - resolution: {integrity: sha512-3rwCIh6MQ1LGrvKJitQjZFuQnT2wxfU+ivhNBzmxXTXPllewOF7JR1s2vMX/tWtUYFgphygxjqMl76q4aMotGw==} - cpu: [riscv64] - os: [linux] - - '@rollup/rollup-linux-riscv64-musl@4.39.0': - resolution: {integrity: sha512-m6cwI86IvQ7M93MQ2RF5SP8tUjD39Y7rjb1qjHgYh28uAPVU8+k/xYWvxRO3/tBN2pZkSMa5RjnPuUIbrwVxeA==} + '@rollup/rollup-linux-riscv64-gnu@4.40.2': + resolution: {integrity: sha512-QNU7BFHEvHMp2ESSY3SozIkBPaPBDTsfVNGx3Xhv+TdvWXFGOSH2NJvhD1zKAT6AyuuErJgbdvaJhYVhVqrWTg==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-riscv64-musl@4.41.1': - resolution: {integrity: sha512-LdIUOb3gvfmpkgFZuccNa2uYiqtgZAz3PTzjuM5bH3nvuy9ty6RGc/Q0+HDFrHrizJGVpjnTZ1yS5TNNjFlklw==} + '@rollup/rollup-linux-riscv64-musl@4.40.2': + resolution: {integrity: sha512-5W6vNYkhgfh7URiXTO1E9a0cy4fSgfE4+Hl5agb/U1sa0kjOLMLC1wObxwKxecE17j0URxuTrYZZME4/VH57Hg==} cpu: [riscv64] os: [linux] @@ -4787,13 +4801,8 @@ packages: cpu: [s390x] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.39.0': - resolution: {integrity: sha512-iRDJd2ebMunnk2rsSBYlsptCyuINvxUfGwOUldjv5M4tpa93K8tFMeYGpNk2+Nxl+OBJnBzy2/JCscGeO507kA==} - cpu: [s390x] - os: [linux] - - '@rollup/rollup-linux-s390x-gnu@4.41.1': - resolution: {integrity: sha512-oIE6M8WC9ma6xYqjvPhzZYk6NbobIURvP/lEbh7FWplcMO6gn7MM2yHKA1eC/GvYwzNKK/1LYgqzdkZ8YFxR8g==} + '@rollup/rollup-linux-s390x-gnu@4.40.2': + resolution: {integrity: sha512-B7LKIz+0+p348JoAL4X/YxGx9zOx3sR+o6Hj15Y3aaApNfAshK8+mWZEf759DXfRLeL2vg5LYJBB7DdcleYCoQ==} cpu: [s390x] os: [linux] @@ -4807,13 +4816,8 @@ packages: cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.39.0': - resolution: {integrity: sha512-t9jqYw27R6Lx0XKfEFe5vUeEJ5pF3SGIM6gTfONSMb7DuG6z6wfj2yjcoZxHg129veTqU7+wOhY6GX8wmf90dA==} - cpu: [x64] - os: [linux] - - '@rollup/rollup-linux-x64-gnu@4.41.1': - resolution: {integrity: sha512-cWBOvayNvA+SyeQMp79BHPK8ws6sHSsYnK5zDcsC3Hsxr1dgTABKjMnMslPq1DvZIp6uO7kIWhiGwaTdR4Og9A==} + '@rollup/rollup-linux-x64-gnu@4.40.2': + resolution: {integrity: sha512-lG7Xa+BmBNwpjmVUbmyKxdQJ3Q6whHjMjzQplOs5Z+Gj7mxPtWakGHqzMqNER68G67kmCX9qX57aRsW5V0VOng==} cpu: [x64] os: [linux] @@ -4832,13 +4836,8 @@ packages: cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.39.0': - resolution: {integrity: sha512-ThFdkrFDP55AIsIZDKSBWEt/JcWlCzydbZHinZ0F/r1h83qbGeenCt/G/wG2O0reuENDD2tawfAj2s8VK7Bugg==} - cpu: [x64] - os: [linux] - - '@rollup/rollup-linux-x64-musl@4.41.1': - resolution: {integrity: sha512-y5CbN44M+pUCdGDlZFzGGBSKCA4A/J2ZH4edTYSSxFg7ce1Xt3GtydbVKWLlzL+INfFIZAEg1ZV6hh9+QQf9YQ==} + '@rollup/rollup-linux-x64-musl@4.40.2': + resolution: {integrity: sha512-tD46wKHd+KJvsmije4bUskNuvWKFcTOIM9tZ/RrmIvcXnbi0YK/cKS9FzFtAm7Oxi2EhV5N2OpfFB348vSQRXA==} cpu: [x64] os: [linux] @@ -4852,13 +4851,8 @@ packages: cpu: [arm64] os: [win32] - '@rollup/rollup-win32-arm64-msvc@4.39.0': - resolution: {integrity: sha512-jDrLm6yUtbOg2TYB3sBF3acUnAwsIksEYjLeHL+TJv9jg+TmTwdyjnDex27jqEMakNKf3RwwPahDIt7QXCSqRQ==} - cpu: [arm64] - os: [win32] - - '@rollup/rollup-win32-arm64-msvc@4.41.1': - resolution: {integrity: sha512-lZkCxIrjlJlMt1dLO/FbpZbzt6J/A8p4DnqzSa4PWqPEUUUnzXLeki/iyPLfV0BmHItlYgHUqJe+3KiyydmiNQ==} + '@rollup/rollup-win32-arm64-msvc@4.40.2': + resolution: {integrity: sha512-Bjv/HG8RRWLNkXwQQemdsWw4Mg+IJ29LK+bJPW2SCzPKOUaMmPEppQlu/Fqk1d7+DX3V7JbFdbkh/NMmurT6Pg==} cpu: [arm64] os: [win32] @@ -4872,13 +4866,8 @@ packages: cpu: [ia32] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.39.0': - resolution: {integrity: sha512-6w9uMuza+LbLCVoNKL5FSLE7yvYkq9laSd09bwS0tMjkwXrmib/4KmoJcrKhLWHvw19mwU+33ndC69T7weNNjQ==} - cpu: [ia32] - os: [win32] - - '@rollup/rollup-win32-ia32-msvc@4.41.1': - resolution: {integrity: sha512-+psFT9+pIh2iuGsxFYYa/LhS5MFKmuivRsx9iPJWNSGbh2XVEjk90fmpUEjCnILPEPJnikAU6SFDiEUyOv90Pg==} + '@rollup/rollup-win32-ia32-msvc@4.40.2': + resolution: {integrity: sha512-dt1llVSGEsGKvzeIO76HToiYPNPYPkmjhMHhP00T9S4rDern8P2ZWvWAQUEJ+R1UdMWJ/42i/QqJ2WV765GZcA==} cpu: [ia32] os: [win32] @@ -4892,13 +4881,8 @@ packages: cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.39.0': - resolution: {integrity: sha512-yAkUOkIKZlK5dl7u6dg897doBgLXmUHhIINM2c+sND3DZwnrdQkkSiDh7N75Ll4mM4dxSkYfXqU9fW3lLkMFug==} - cpu: [x64] - os: [win32] - - '@rollup/rollup-win32-x64-msvc@4.41.1': - resolution: {integrity: sha512-Wq2zpapRYLfi4aKxf2Xff0tN+7slj2d4R87WEzqw7ZLsVvO5zwYCIuEGSZYiK41+GlwUo1HiR+GdkLEJnCKTCw==} + '@rollup/rollup-win32-x64-msvc@4.40.2': + resolution: {integrity: sha512-bwspbWB04XJpeElvsp+DCylKfF4trJDa2Y9Go8O6A7YLX2LIKGcNK/CYImJN6ZP4DcuOHB4Utl3iCbnR62DudA==} cpu: [x64] os: [win32] @@ -4915,8 +4899,8 @@ packages: '@sec-ant/readable-stream@0.4.1': resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==} - '@seriousme/openapi-schema-validator@2.3.1': - resolution: {integrity: sha512-szUXBZJUhq+Yw+vUro2QeltSIoZvMDQi3MLqJhIKcRcRYyFt9B6dyjMD1RVf3nFvNAHkWqa48NJA46ti2P8smA==} + '@seriousme/openapi-schema-validator@2.4.1': + resolution: {integrity: sha512-OX15CKLV2JFGcoXxFVD/CMtWzys+r6G9gArKY8iaUqOkIEqp80ispclk5c8j5i1iEIIlyCRJ0R0N5MddHFg2xg==} hasBin: true '@shikijs/core@1.29.2': @@ -4951,22 +4935,25 @@ packages: resolution: {integrity: sha512-nYxaSb/MtlSI+JWcwTHQxyNmWeWrUXJJ/G4liLrGG7+tS4vAz6LF3xRXqLH6wPIVUoZQel2Fs4ddLx4NCpiIYg==} engines: {node: ^18.17.0 || >=20.5.0} - '@sigstore/protobuf-specs@0.4.0': - resolution: {integrity: sha512-o09cLSIq9EKyRXwryWDOJagkml9XgQCoCSRjHOnHLnvsivaW7Qznzz6yjfV7PHJHhIvyp8OH7OX8w0Dc5bQK7A==} + '@sigstore/protobuf-specs@0.4.1': + resolution: {integrity: sha512-7MJXQhIm7dWF9zo7rRtMYh8d2gSnc3+JddeQOTIg6gUN7FjcuckZ9EwGq+ReeQtbbl3Tbf5YqRrWxA1DMfIn+w==} engines: {node: ^18.17.0 || >=20.5.0} '@sigstore/sign@3.1.0': resolution: {integrity: sha512-knzjmaOHOov1Ur7N/z4B1oPqZ0QX5geUfhrVaqVlu+hl0EAoL4o+l0MSULINcD5GCWe3Z0+YJO8ues6vFlW0Yw==} engines: {node: ^18.17.0 || >=20.5.0} - '@sigstore/tuf@3.1.0': - resolution: {integrity: sha512-suVMQEA+sKdOz5hwP9qNcEjX6B45R+hFFr4LAWzbRc5O+U2IInwvay/bpG5a4s+qR35P/JK/PiKiRGjfuLy1IA==} + '@sigstore/tuf@3.1.1': + resolution: {integrity: sha512-eFFvlcBIoGwVkkwmTi/vEQFSva3xs5Ot3WmBcjgjVdiaoelBLQaQ/ZBfhlG0MnG0cmTYScPpk7eDdGDWUcFUmg==} engines: {node: ^18.17.0 || >=20.5.0} - '@sigstore/verify@2.1.0': - resolution: {integrity: sha512-kAAM06ca4CzhvjIZdONAL9+MLppW3K48wOFy1TbuaWFW/OMfl8JuTgW0Bm02JB1WJGT/ET2eqav0KTEKmxqkIA==} + '@sigstore/verify@2.1.1': + resolution: {integrity: sha512-hVJD77oT67aowHxwT4+M6PGOp+E2LtLdTK3+FC0lBO9T7sYwItDMXZ7Z07IDCvR1M717a4axbIWckrW67KMP/w==} engines: {node: ^18.17.0 || >=20.5.0} + '@sinclair/typebox@0.27.8': + resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} + '@sindresorhus/is@4.6.0': resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} engines: {node: '>=10'} @@ -5109,17 +5096,20 @@ packages: resolution: {integrity: sha512-UUYHISyhCU3ZgN8yaear3cGATHb3SMuKHsQ/nVbHXcmnBf+LzQ/cQfhNG+rfaSHgqGKNEm2cOCLVLELStUQ1JA==} engines: {node: ^18.17.0 || >=20.5.0} + '@tybys/wasm-util@0.9.0': + resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} + '@types/babel__core@7.20.5': resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} - '@types/babel__generator@7.6.8': - resolution: {integrity: sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==} + '@types/babel__generator@7.27.0': + resolution: {integrity: sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==} '@types/babel__template@7.4.4': resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} - '@types/babel__traverse@7.20.6': - resolution: {integrity: sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==} + '@types/babel__traverse@7.20.7': + resolution: {integrity: sha512-dkO5fhS7+/oos4ciWxyEyjWe48zmG6wbCheo/G2ZnHx4fs3EU6YC6UM8rk56gAjNJ9P3MTH2jo5jb92/K6wbng==} '@types/body-parser@1.19.5': resolution: {integrity: sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==} @@ -5139,8 +5129,8 @@ packages: '@types/cookie@0.6.0': resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==} - '@types/cors@2.8.17': - resolution: {integrity: sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==} + '@types/cors@2.8.18': + resolution: {integrity: sha512-nX3d0sxJW41CqQvfOzVG1NCTXfFDrDWIghCZncpHeWlVFd81zxB/DLhg7avFg6eHLCRX7ckBmoIIcqa++upvJA==} '@types/cross-spawn@6.0.6': resolution: {integrity: sha512-fXRhhUkG4H3TQk5dBhQ7m/JDdSNHKwR2BBia62lhwEIq9xGiQKLxd6LymNhn47SjXhsUEPmxi+PKw2OkW4LLjA==} @@ -5175,8 +5165,8 @@ packages: '@types/http-proxy@1.17.16': resolution: {integrity: sha512-sdWoUajOB1cd0A8cRRQ1cfyWNbmFKLAqBB89Y8x5iYyG/mkJHc0YUH8pdWBy2omi9qtCpiIgGjuwO0dQST2l5w==} - '@types/jasmine@5.1.7': - resolution: {integrity: sha512-DVOfk9FaClQfNFpSfaML15jjB5cjffDMvjtph525sroR5BEAW2uKnTOYUTqTFuZFjNvH0T5XMIydvIctnUKufw==} + '@types/jasmine@5.1.8': + resolution: {integrity: sha512-u7/CnvRdh6AaaIzYjCgUuVbREFgulhX05Qtf6ZtW+aOcjCKKVvKgpkPYJBFTZSHtFBYimzU4zP0V2vrEsq9Wcg==} '@types/jsdom@21.1.7': resolution: {integrity: sha512-yOriVnggzrnQ3a9OKOCxaVuSug3w3/SbOj5i7VwXWZEyUNl3bLF9V3MfxGbZKuwqJOQyRfqXyROBB1CoZLFWzA==} @@ -5211,8 +5201,12 @@ packages: '@types/node@22.10.5': resolution: {integrity: sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ==} - '@types/parse-path@7.0.3': - resolution: {integrity: sha512-LriObC2+KYZD3FzCrgWGv/qufdUy4eXrxcLgQMfYXgPbLIecKIsVBaQgUPmxSSLcjmYbDTQbMgr6qr6l/eb7Bg==} + '@types/normalize-package-data@2.4.4': + resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} + + '@types/parse-path@7.1.0': + resolution: {integrity: sha512-EULJ8LApcVEPbrfND0cRQqutIOdiIgJ1Mgrhpy755r14xMohPTEpkV/k28SJvuOs9bHRFW8x+KeDAEPiGQPB9Q==} + deprecated: This is a stub types definition. parse-path provides its own type definitions, so you do not need this installed. '@types/qs@6.9.18': resolution: {integrity: sha512-kK7dgTYDyGqS+e2Q4aK9X3D7q234CIZ1Bv0q/7Z5IwRDoADNU81xXJK/YVyLbLTZCoIwUoDoffFeF+p/eIklAA==} @@ -5250,14 +5244,17 @@ packages: '@types/tough-cookie@4.0.5': resolution: {integrity: sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==} + '@types/triple-beam@1.3.5': + resolution: {integrity: sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==} + '@types/unist@3.0.3': resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} '@types/web-bluetooth@0.0.20': resolution: {integrity: sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==} - '@types/ws@8.18.0': - resolution: {integrity: sha512-8svvI3hMyvN0kKCJMvTJP/x6Y/EoQbepff882wL+Sn5QsXb3etnamgrJq4isrBxSJj5L2AuXcI0+bgkoAXGUJw==} + '@types/ws@8.18.1': + resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==} '@types/yauzl@2.10.3': resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} @@ -5362,8 +5359,98 @@ packages: peerDependencies: vue: '>=2.7 || >=3' - '@vercel/nft@0.29.2': - resolution: {integrity: sha512-A/Si4mrTkQqJ6EXJKv5EYCDQ3NL6nJXxG8VGXePsaiQigsomHYQC9xSpX8qGk7AEZk4b1ssbYIqJ0ISQQ7bfcA==} + '@unrs/resolver-binding-darwin-arm64@1.7.2': + resolution: {integrity: sha512-vxtBno4xvowwNmO/ASL0Y45TpHqmNkAaDtz4Jqb+clmcVSSl8XCG/PNFFkGsXXXS6AMjP+ja/TtNCFFa1QwLRg==} + cpu: [arm64] + os: [darwin] + + '@unrs/resolver-binding-darwin-x64@1.7.2': + resolution: {integrity: sha512-qhVa8ozu92C23Hsmv0BF4+5Dyyd5STT1FolV4whNgbY6mj3kA0qsrGPe35zNR3wAN7eFict3s4Rc2dDTPBTuFQ==} + cpu: [x64] + os: [darwin] + + '@unrs/resolver-binding-freebsd-x64@1.7.2': + resolution: {integrity: sha512-zKKdm2uMXqLFX6Ac7K5ElnnG5VIXbDlFWzg4WJ8CGUedJryM5A3cTgHuGMw1+P5ziV8CRhnSEgOnurTI4vpHpg==} + cpu: [x64] + os: [freebsd] + + '@unrs/resolver-binding-linux-arm-gnueabihf@1.7.2': + resolution: {integrity: sha512-8N1z1TbPnHH+iDS/42GJ0bMPLiGK+cUqOhNbMKtWJ4oFGzqSJk/zoXFzcQkgtI63qMcUI7wW1tq2usZQSb2jxw==} + cpu: [arm] + os: [linux] + + '@unrs/resolver-binding-linux-arm-musleabihf@1.7.2': + resolution: {integrity: sha512-tjYzI9LcAXR9MYd9rO45m1s0B/6bJNuZ6jeOxo1pq1K6OBuRMMmfyvJYval3s9FPPGmrldYA3mi4gWDlWuTFGA==} + cpu: [arm] + os: [linux] + + '@unrs/resolver-binding-linux-arm64-gnu@1.7.2': + resolution: {integrity: sha512-jon9M7DKRLGZ9VYSkFMflvNqu9hDtOCEnO2QAryFWgT6o6AXU8du56V7YqnaLKr6rAbZBWYsYpikF226v423QA==} + cpu: [arm64] + os: [linux] + + '@unrs/resolver-binding-linux-arm64-musl@1.7.2': + resolution: {integrity: sha512-c8Cg4/h+kQ63pL43wBNaVMmOjXI/X62wQmru51qjfTvI7kmCy5uHTJvK/9LrF0G8Jdx8r34d019P1DVJmhXQpA==} + cpu: [arm64] + os: [linux] + + '@unrs/resolver-binding-linux-ppc64-gnu@1.7.2': + resolution: {integrity: sha512-A+lcwRFyrjeJmv3JJvhz5NbcCkLQL6Mk16kHTNm6/aGNc4FwPHPE4DR9DwuCvCnVHvF5IAd9U4VIs/VvVir5lg==} + cpu: [ppc64] + os: [linux] + + '@unrs/resolver-binding-linux-riscv64-gnu@1.7.2': + resolution: {integrity: sha512-hQQ4TJQrSQW8JlPm7tRpXN8OCNP9ez7PajJNjRD1ZTHQAy685OYqPrKjfaMw/8LiHCt8AZ74rfUVHP9vn0N69Q==} + cpu: [riscv64] + os: [linux] + + '@unrs/resolver-binding-linux-riscv64-musl@1.7.2': + resolution: {integrity: sha512-NoAGbiqrxtY8kVooZ24i70CjLDlUFI7nDj3I9y54U94p+3kPxwd2L692YsdLa+cqQ0VoqMWoehDFp21PKRUoIQ==} + cpu: [riscv64] + os: [linux] + + '@unrs/resolver-binding-linux-s390x-gnu@1.7.2': + resolution: {integrity: sha512-KaZByo8xuQZbUhhreBTW+yUnOIHUsv04P8lKjQ5otiGoSJ17ISGYArc+4vKdLEpGaLbemGzr4ZeUbYQQsLWFjA==} + cpu: [s390x] + os: [linux] + + '@unrs/resolver-binding-linux-x64-gnu@1.7.2': + resolution: {integrity: sha512-dEidzJDubxxhUCBJ/SHSMJD/9q7JkyfBMT77Px1npl4xpg9t0POLvnWywSk66BgZS/b2Hy9Y1yFaoMTFJUe9yg==} + cpu: [x64] + os: [linux] + + '@unrs/resolver-binding-linux-x64-musl@1.7.2': + resolution: {integrity: sha512-RvP+Ux3wDjmnZDT4XWFfNBRVG0fMsc+yVzNFUqOflnDfZ9OYujv6nkh+GOr+watwrW4wdp6ASfG/e7bkDradsw==} + cpu: [x64] + os: [linux] + + '@unrs/resolver-binding-wasm32-wasi@1.7.2': + resolution: {integrity: sha512-y797JBmO9IsvXVRCKDXOxjyAE4+CcZpla2GSoBQ33TVb3ILXuFnMrbR/QQZoauBYeOFuu4w3ifWLw52sdHGz6g==} + engines: {node: '>=14.0.0'} + cpu: [wasm32] + + '@unrs/resolver-binding-win32-arm64-msvc@1.7.2': + resolution: {integrity: sha512-gtYTh4/VREVSLA+gHrfbWxaMO/00y+34htY7XpioBTy56YN2eBjkPrY1ML1Zys89X3RJDKVaogzwxlM1qU7egg==} + cpu: [arm64] + os: [win32] + + '@unrs/resolver-binding-win32-ia32-msvc@1.7.2': + resolution: {integrity: sha512-Ywv20XHvHTDRQs12jd3MY8X5C8KLjDbg/jyaal/QLKx3fAShhJyD4blEANInsjxW3P7isHx1Blt56iUDDJO3jg==} + cpu: [ia32] + os: [win32] + + '@unrs/resolver-binding-win32-x64-msvc@1.7.2': + resolution: {integrity: sha512-friS8NEQfHaDbkThxopGk+LuE5v3iY0StruifjQEt7SLbA46OnfgMO15sOTkbpJkol6RB+1l1TYPXh0sCddpvA==} + cpu: [x64] + os: [win32] + + '@vercel/nft@0.27.7': + resolution: {integrity: sha512-FG6H5YkP4bdw9Ll1qhmbxuE8KwW2E/g8fJpM183fWQLeVDGqzeywMIeJ9h2txdWZ03psgWMn6QymTxaDLmdwUg==} + engines: {node: '>=16'} + hasBin: true + + '@vercel/nft@0.29.3': + resolution: {integrity: sha512-aVV0E6vJpuvImiMwU1/5QKkw2N96BRFE7mBYGS7FhXUoS6V7SarQ+8tuj33o7ofECz8JtHpmQ9JW+oVzOoB7MA==} engines: {node: '>=18'} hasBin: true @@ -5419,6 +5506,9 @@ packages: '@vitest/pretty-format@3.1.1': resolution: {integrity: sha512-dg0CIzNx+hMMYfNmSqJlLSXEmnNhMswcn3sXO7Tpldr0LiGmg3eXdLLhwkv2ZqgHb/d5xg5F7ezNFRA1fA13yA==} + '@vitest/pretty-format@3.1.3': + resolution: {integrity: sha512-i6FDiBeJUGLDKADw2Gb01UtUNb12yyXAqC/mmRWuYl+m/U9GS7s8us5ONmGkGpUUo7/iAYzI2ePVfOZTYvUifA==} + '@vitest/runner@3.1.1': resolution: {integrity: sha512-X/d46qzJuEDO8ueyjtKfxffiXraPRfmYasoC4i5+mlLEJ10UvPb0XH5M9C3gWuxd7BAQhpK42cJgJtq53YnWVA==} @@ -5431,14 +5521,14 @@ packages: '@vitest/utils@3.1.1': resolution: {integrity: sha512-1XIjflyaU2k3HMArJ50bwSh3wKWPD6Q47wz/NUSmRV0zNywPc4w79ARjg/i/aNINHwA+mIALhUVqD9/aUvZNgg==} - '@volar/language-core@2.4.12': - resolution: {integrity: sha512-RLrFdXEaQBWfSnYGVxvR2WrO6Bub0unkdHYIdC31HzIEqATIuuhRRzYu76iGPZ6OtA4Au1SnW0ZwIqPP217YhA==} + '@volar/language-core@2.4.13': + resolution: {integrity: sha512-MnQJ7eKchJx5Oz+YdbqyFUk8BN6jasdJv31n/7r6/WwlOOv7qzvot6B66887l2ST3bUW4Mewml54euzpJWA6bg==} - '@volar/source-map@2.4.12': - resolution: {integrity: sha512-bUFIKvn2U0AWojOaqf63ER0N/iHIBYZPpNGogfLPQ68F5Eet6FnLlyho7BS0y2HJ1jFhSif7AcuTx1TqsCzRzw==} + '@volar/source-map@2.4.13': + resolution: {integrity: sha512-l/EBcc2FkvHgz2ZxV+OZK3kMSroMr7nN3sZLF2/f6kWW66q8+tEL4giiYyFjt0BcubqJhBt6soYIrAPhg/Yr+Q==} - '@volar/typescript@2.4.12': - resolution: {integrity: sha512-HJB73OTJDgPc80K30wxi3if4fSsZZAOScbj2fcicMuOPoOkcf9NNAINb33o+DzhBdF9xTKC1gnPmIRDous5S0g==} + '@volar/typescript@2.4.13': + resolution: {integrity: sha512-Ukz4xv84swJPupZeoFsQoeJEOm7U9pqsEnaGGgt5ni3SCTa22m8oJP5Nng3Wed7Uw5RBELdLxxORX8YhJPyOgQ==} '@vue-macros/common@1.16.1': resolution: {integrity: sha512-Pn/AWMTjoMYuquepLZP813BIcq8DTZiNCoaceuNlvaYuOTd8DqBZWc5u0uOMQZMInwME1mdSmmBAcTluiV9Jtg==} @@ -5483,27 +5573,27 @@ packages: '@vue/devtools-api@6.6.4': resolution: {integrity: sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==} - '@vue/devtools-api@7.7.2': - resolution: {integrity: sha512-1syn558KhyN+chO5SjlZIwJ8bV/bQ1nOVTG66t2RbG66ZGekyiYNmRO7X9BJCXQqPsFHlnksqvPhce2qpzxFnA==} + '@vue/devtools-api@7.7.6': + resolution: {integrity: sha512-b2Xx0KvXZObePpXPYHvBRRJLDQn5nhKjXh7vUhMEtWxz1AYNFOVIsh5+HLP8xDGL7sy+Q7hXeUxPHB/KgbtsPw==} '@vue/devtools-core@7.6.8': resolution: {integrity: sha512-8X4roysTwzQ94o7IobjVcOd1aZF5iunikrMrHPI2uUdigZCi2kFTQc7ffYiFiTNaLElCpjOhCnM7bo7aK1yU7A==} peerDependencies: vue: ^3.0.0 - '@vue/devtools-core@7.7.2': - resolution: {integrity: sha512-lexREWj1lKi91Tblr38ntSsy6CvI8ba7u+jmwh2yruib/ltLUcsIzEjCnrkh1yYGGIKXbAuYV2tOG10fGDB9OQ==} + '@vue/devtools-core@7.7.6': + resolution: {integrity: sha512-ghVX3zjKPtSHu94Xs03giRIeIWlb9M+gvDRVpIZ/cRIxKHdW6HE/sm1PT3rUYS3aV92CazirT93ne+7IOvGUWg==} peerDependencies: vue: ^3.0.0 '@vue/devtools-kit@7.6.8': resolution: {integrity: sha512-JhJ8M3sPU+v0P2iZBF2DkdmR9L0dnT5RXJabJqX6o8KtFs3tebdvfoXV2Dm3BFuqeECuMJIfF1aCzSt+WQ4wrw==} - '@vue/devtools-kit@7.7.2': - resolution: {integrity: sha512-CY0I1JH3Z8PECbn6k3TqM1Bk9ASWxeMtTCvZr7vb+CHi+X/QwQm5F1/fPagraamKMAHVfuuCbdcnNg1A4CYVWQ==} + '@vue/devtools-kit@7.7.6': + resolution: {integrity: sha512-geu7ds7tem2Y7Wz+WgbnbZ6T5eadOvozHZ23Atk/8tksHMFOFylKi1xgGlQlVn0wlkEf4hu+vd5ctj1G4kFtwA==} - '@vue/devtools-shared@7.7.2': - resolution: {integrity: sha512-uBFxnp8gwW2vD6FrJB8JZLUzVb6PNRG0B0jBnHsOH8uKyva2qINY8PTF5Te4QlTbMDqU5K6qtJDr6cNsKWhbOA==} + '@vue/devtools-shared@7.7.6': + resolution: {integrity: sha512-yFEgJZ/WblEsojQQceuyK6FzpFDx4kqrz2ohInxNj5/DnhoX023upTv4OD6lNPLAA5LLkbwPVb10o/7b+Y4FVA==} '@vue/eslint-config-prettier@10.1.0': resolution: {integrity: sha512-J6wV91y2pXc0Phha01k0WOHBTPsoSTf4xlmMjoKaeSxBpAdsgTppGF5RZRdOHM7OA74zAXD+VLANrtYXpiPKkQ==} @@ -5656,6 +5746,26 @@ packages: '@webassemblyjs/wast-printer@1.14.1': resolution: {integrity: sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==} + '@whatwg-node/disposablestack@0.0.6': + resolution: {integrity: sha512-LOtTn+JgJvX8WfBVJtF08TGrdjuFzGJc4mkP8EdDI8ADbvO7kiexYep1o8dwnt0okb0jYclCDXF13xU7Ge4zSw==} + engines: {node: '>=18.0.0'} + + '@whatwg-node/fetch@0.10.7': + resolution: {integrity: sha512-sL31zX8BqZovZc38ovBFmKEfao9AzZ/24sWSHKNhDhcnzIO/PYAX2xF6vYtgU9hinrEGlvScTTyKSMynHGdfEA==} + engines: {node: '>=18.0.0'} + + '@whatwg-node/node-fetch@0.7.19': + resolution: {integrity: sha512-ippPt75epj7Tg6H5znI9lBBQ4gi+x23QsIF7UN1Z02MUqzhbkjhGsUtNnYGS3osrqvyKtbGKmEya6IqIPRmtdw==} + engines: {node: '>=18.0.0'} + + '@whatwg-node/promise-helpers@1.3.2': + resolution: {integrity: sha512-Nst5JdK47VIl9UcGwtv2Rcgyn5lWtZ0/mhRQ4G8NN2isxpq2TO30iqHzmwoJycjWuyUfg3GFXqP/gFHXeV57IA==} + engines: {node: '>=16.0.0'} + + '@whatwg-node/server@0.9.71': + resolution: {integrity: sha512-ueFCcIPaMgtuYDS9u0qlUoEvj6GiSsKrwnOLPp9SshqjtcRaR1IEHRjoReq3sXNydsF5i0ZnmuYgXq9dV53t0g==} + engines: {node: '>=18.0.0'} + '@xtuc/ieee754@1.2.0': resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} @@ -5665,12 +5775,23 @@ packages: '@yarnpkg/lockfile@1.1.0': resolution: {integrity: sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==} + '@yarnpkg/parsers@3.0.2': + resolution: {integrity: sha512-/HcYgtUSiJiot/XWGLOlGxPYUG65+/31V8oqk17vZLW1xlCoR4PampyePljOxY2n8/3jz9+tIFzICsyGujJZoA==} + engines: {node: '>=18.12.0'} + + '@zkochan/js-yaml@0.0.7': + resolution: {integrity: sha512-nrUSn7hzt7J6JWgWGz78ZYI8wj+gdIJdk0Ynjpp8l+trkn58Uqsf6RYrYkEK+3X18EX+TNdtJI0WxAtc+L84SQ==} + hasBin: true + + abbrev@1.1.1: + resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} + abbrev@2.0.0: resolution: {integrity: sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - abbrev@3.0.0: - resolution: {integrity: sha512-+/kfrslGQ7TNV2ecmQwMJj/B65g5KVq1/L3SGVZ3tCYGqlzFuFCGBZJtMP99wH3NpEUyAjn0zPdPUg0D+DwrOA==} + abbrev@3.0.1: + resolution: {integrity: sha512-AO2ac6pjRB3SJmGJo+v5/aK6Omggp6fsLrs6wN9bd35ulu4cCwaAU9+7ZhXjeqHVkaHThLuzH0nZr0YpCDhygg==} engines: {node: ^18.17.0 || >=20.5.0} abort-controller@3.0.0: @@ -5722,6 +5843,10 @@ packages: resolution: {integrity: sha512-OXwN5b9pCUXNQHJpwwD2qP40byEmSgzj8B4ydSN0uMNYWiFmJ6x6KwUllMmfk8Rwu/HJDFR7U8ubsWBoN0Xp0A==} engines: {node: '>=8.9'} + agent-base@6.0.2: + resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} + engines: {node: '>= 6.0.0'} + agent-base@7.1.3: resolution: {integrity: sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==} engines: {node: '>= 14'} @@ -5761,8 +5886,8 @@ packages: ajv@8.17.1: resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} - algoliasearch@5.21.0: - resolution: {integrity: sha512-hexLq2lSO1K5SW9j21Ubc+q9Ptx7dyRTY7se19U8lhIlVMLCNXWCyQ6C22p9ez8ccX0v7QVmwkl2l1CnuGoO2Q==} + algoliasearch@5.25.0: + resolution: {integrity: sha512-n73BVorL4HIwKlfJKb4SEzAYkR3Buwfwbh+MYxg2mloFph2fFGV58E90QTzdbfzWrLn4HE5Czx/WTjI8fcHaMg==} engines: {node: '>= 14.0.0'} alien-signals@0.4.14: @@ -5797,6 +5922,10 @@ packages: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} + ansi-styles@5.2.0: + resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} + engines: {node: '>=10'} + ansi-styles@6.2.1: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} @@ -5808,14 +5937,34 @@ packages: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} + aproba@2.0.0: + resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} + + archiver-utils@2.1.0: + resolution: {integrity: sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==} + engines: {node: '>= 6'} + + archiver-utils@3.0.4: + resolution: {integrity: sha512-KVgf4XQVrTjhyWmx6cte4RxonPLR9onExufI1jhvw/MQ4BB6IsZD5gT8Lq+u/+pRkWna/6JoHpiQioaqFP5Rzw==} + engines: {node: '>= 10'} + archiver-utils@5.0.2: resolution: {integrity: sha512-wuLJMmIBQYCsGZgYLTy5FIB2pF6Lfb6cXMSF8Qywwk3t20zWnAi7zLcQFdKQmIB8wyZpY5ER38x08GbwtR2cLA==} engines: {node: '>= 14'} + archiver@5.3.2: + resolution: {integrity: sha512-+25nxyyznAXF7Nef3y0EbBeqmGZgeN/BxHX29Rs39djAfaFalmQ89SE6CWyDCHzGL0yt/ycBtNOmGTW0FyGWNw==} + engines: {node: '>= 10'} + archiver@7.0.1: resolution: {integrity: sha512-ZcbTaIqJOfCc03QwD468Unz/5Ir8ATtvAHsK+FdXbDIbGfihqh9mrvdcYunQzqn4HrvWWaFyaxJhGZagaJJpPQ==} engines: {node: '>= 14'} + are-we-there-yet@2.0.0: + resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} + engines: {node: '>=10'} + deprecated: This package is no longer supported. + arg@4.1.3: resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} @@ -5855,8 +6004,8 @@ packages: resolution: {integrity: sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==} engines: {node: '>= 0.4'} - array.prototype.findlastindex@1.2.5: - resolution: {integrity: sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==} + array.prototype.findlastindex@1.2.6: + resolution: {integrity: sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==} engines: {node: '>= 0.4'} array.prototype.flat@1.3.3: @@ -5875,14 +6024,22 @@ packages: resolution: {integrity: sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==} engines: {node: '>= 0.4'} + assert-plus@1.0.0: + resolution: {integrity: sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==} + engines: {node: '>=0.8'} + assertion-error@2.0.1: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} - ast-kit@1.4.2: - resolution: {integrity: sha512-lvGehj1XsrIoQrD5CfPduIzQbcpuX2EPjlk/vDMDQF9U9HLRB6WwMTdighj5n52hdhh8xg9VgPTU7Q25MuJ/rw==} + ast-kit@1.4.3: + resolution: {integrity: sha512-MdJqjpodkS5J149zN0Po+HPshkTdUyrvF7CKTafUgv69vBSPtncrj+3IiUgqdd7ElIEkbeXCsEouBUwLrw9Ilg==} engines: {node: '>=16.14.0'} + ast-module-types@5.0.0: + resolution: {integrity: sha512-JvqziE0Wc0rXQfma0HZC/aY7URXHFuZV84fJRtP8u+lhp0JYCNd5wJzVXP45t0PH0Mej3ynlzvdyITYIu0G4LQ==} + engines: {node: '>=14'} + ast-types-flow@0.0.8: resolution: {integrity: sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==} @@ -5939,6 +6096,9 @@ packages: axios@1.8.2: resolution: {integrity: sha512-ls4GYBm5aig9vWx8AWDSGLpnpDQRtWAfrjU+EuytuODrFBkqesN2RkOQCBzrA1RQNHw1SmRMSDDDSwzNAYQ6Rg==} + axios@1.9.0: + resolution: {integrity: sha512-re4CqKTJaURpzbLHtIi6XpDv20/CnpXOtjRY5/CU32L8gU8ek9UIivcfvSWvmKEngmVbrUtPpdDwWDWL7DNHvg==} + axobject-query@4.1.0: resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==} engines: {node: '>= 0.4'} @@ -5953,8 +6113,8 @@ packages: '@babel/core': ^7.12.0 webpack: '>=5' - babel-plugin-polyfill-corejs2@0.4.12: - resolution: {integrity: sha512-CPWT6BwvhrTO2d8QVorhTCQw9Y43zOu7G9HigcfxvepOU6b8o3tcWad6oVgZIsZCTt42FFv97aA7ZJsbM4+8og==} + babel-plugin-polyfill-corejs2@0.4.13: + resolution: {integrity: sha512-3sX/eOms8kd3q2KZ6DAhKPc0dgm525Gqq5NtWKZ7QYYZEv57OQ54KtblzJzH1lQF/eQxO8KjWGIK9IPUJNus5g==} peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 @@ -5968,8 +6128,8 @@ packages: peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 - babel-plugin-polyfill-regenerator@0.6.3: - resolution: {integrity: sha512-LiWSbl4CRSIa5x/JAU6jZiG9eit9w6mz+yVMFwDE83LAWvt0AfGBoZ7HS/mkhrKuh2ZlzfVZYKoLjXdqw6Yt7Q==} + babel-plugin-polyfill-regenerator@0.6.4: + resolution: {integrity: sha512-7gD3pRadPrbjhjLyxebmx/WrFYcuSjZ0XbdUujQMZ/fcE9oeewk2U/7PCvez84UeuK3oSjmPZ0Ch0dlupQvGzw==} peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 @@ -6034,6 +6194,9 @@ packages: birpc@0.2.19: resolution: {integrity: sha512-5WeXXAvTmitV1RqJFppT5QtUiz2p1mRSYU000Jkft5ZUCLJIk4uQriYNO50HknxKwM6jd8utNc66K1qGIwwWBQ==} + birpc@2.3.0: + resolution: {integrity: sha512-ijbtkn/F3Pvzb6jHypHRyve2QApOCZDR25D/VnkY2G/lBNcXCTsnsCxgY4k4PkVB7zfwzYbY3O9Lcqe3xufS5g==} + bl@4.1.0: resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} @@ -6057,8 +6220,8 @@ packages: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} - browserslist@4.24.4: - resolution: {integrity: sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==} + browserslist@4.24.5: + resolution: {integrity: sha512-FDToo4Wo82hIdgc1CQ+NQD0hEhmpPjrZ3hiUgwgOG6IuTdlpr8jdjyG24P6cNP1yJpTLzS5OcGgSw0xmDU1/Tw==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true @@ -6078,6 +6241,10 @@ packages: buffer@6.0.3: resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} + builtin-modules@3.3.0: + resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} + engines: {node: '>=6'} + bun-types@1.2.19: resolution: {integrity: sha512-uAOTaZSPuYsWIXRpj7o56Let0g/wjihKCkeRqUBhlLVM/Bt+Fj9xTo+LhC1OV1XDaGkz4hNC80et5xgy+9KTHQ==} peerDependencies: @@ -6109,8 +6276,8 @@ packages: magicast: optional: true - c12@3.0.2: - resolution: {integrity: sha512-6Tzk1/TNeI3WBPpK0j/Ss4+gPj3PUJYbWl/MWDJBThFvwNGNkXtd7Cz8BJtD4aRwoGHtzQD0SnxamgUiBH0/Nw==} + c12@3.0.3: + resolution: {integrity: sha512-uC3MacKBb0Z15o5QWCHvHWj5Zv34pGQj9P+iXKSpTuSGFS0KKhUWf4t9AJ+gWjYOdmWCPEGpEzm8sS0iqbpo1w==} peerDependencies: magicast: ^0.3.5 peerDependenciesMeta: @@ -6137,6 +6304,12 @@ packages: resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} engines: {node: '>= 0.4'} + call-me-maybe@1.0.2: + resolution: {integrity: sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==} + + callsite@1.0.0: + resolution: {integrity: sha512-0vdNRFXn5q+dtOqjfFtmtlI9N2eVZ7LMyEV2iKC5mEEFvSg/69Ml6b/WU2qF8W1nLRa0wiSrDT3Y5jOHZCwKPQ==} + callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -6148,11 +6321,8 @@ packages: caniuse-api@3.0.0: resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==} - caniuse-lite@1.0.30001703: - resolution: {integrity: sha512-kRlAGTRWgPsOj7oARC9m1okJEXdL/8fekFVcxA8Hl7GH4r/sN4OJn/i6Flde373T50KS7Y37oFbMwlE8+F42kQ==} - - caniuse-lite@1.0.30001709: - resolution: {integrity: sha512-NgL3vUTnDrPCZ3zTahp4fsugQ4dc7EKTSzwQDPEel6DMoMnfH2jhry9n2Zm8onbSR+f/QtKHFOA+iAQu4kbtWA==} + caniuse-lite@1.0.30001718: + resolution: {integrity: sha512-AflseV1ahcSunK53NfEs9gFWgOEmzr0f+kaMFA4xiLZlr9Hzt7HxcSpIFcnNCUkz6R6dWKa54rUz3HUmI3nVcw==} ccount@2.0.1: resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} @@ -6169,9 +6339,6 @@ packages: resolution: {integrity: sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - change-case@5.4.4: - resolution: {integrity: sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==} - char-regex@1.0.2: resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} engines: {node: '>=10'} @@ -6243,6 +6410,10 @@ packages: engines: {node: '>=8.0.0', npm: '>=5.0.0'} hasBin: true + cli-spinners@2.6.1: + resolution: {integrity: sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==} + engines: {node: '>=6'} + cli-spinners@2.9.2: resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} engines: {node: '>=6'} @@ -6289,10 +6460,16 @@ packages: resolution: {integrity: sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==} engines: {node: '>=0.10.0'} + color-convert@1.9.3: + resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} + color-name@1.1.3: + resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} @@ -6303,6 +6480,9 @@ packages: resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} hasBin: true + color@3.2.1: + resolution: {integrity: sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==} + color@4.2.3: resolution: {integrity: sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==} engines: {node: '>=12.5.0'} @@ -6310,12 +6490,12 @@ packages: colord@2.9.3: resolution: {integrity: sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==} - colorette@1.4.0: - resolution: {integrity: sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==} - colorette@2.0.20: resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} + colorspace@1.1.4: + resolution: {integrity: sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==} + combined-stream@1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} @@ -6350,6 +6530,10 @@ packages: resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} engines: {node: '>= 12'} + commander@9.5.0: + resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==} + engines: {node: ^12.20.0 || >=14} + common-path-prefix@3.0.0: resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} @@ -6359,6 +6543,13 @@ packages: compatx@0.1.8: resolution: {integrity: sha512-jcbsEAR81Bt5s1qOFymBufmCbXCXbk0Ql+K5ouj6gCyx2yHlu6AgmGIi9HxfKixpUDO5bCFJUHQ5uM6ecbTebw==} + compatx@0.2.0: + resolution: {integrity: sha512-6gLRNt4ygsi5NyMVhceOCFv14CIdDFN7fQjX1U4+47qVE/+kjPoXMK65KWK+dWxmFzMTuKazoQ9sch6pM0p5oA==} + + compress-commons@4.1.2: + resolution: {integrity: sha512-D3uMHtGc/fcO1Gt1/L7i1e33VOvD4A9hfQLP+6ewd+BvG/gQ84Yh4oftEhAdjSMgBgwGL+jsppT7JYNpo6MHHg==} + engines: {node: '>= 10'} + compress-commons@6.0.2: resolution: {integrity: sha512-6FqVXeETqWPoGcfzrXb37E50NP0LXT8kAMu5ooZayhWWdgEY4lBEEcbQNXtkuKQsGduxiIcI4gOTsxTmuq/bSg==} engines: {node: '>= 14'} @@ -6377,8 +6568,8 @@ packages: confbox@0.1.8: resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==} - confbox@0.2.1: - resolution: {integrity: sha512-hkT3yDPFbs95mNCy1+7qNKC6Pro+/ibzYxtM2iqEigpf0sVw+bg4Zh9/snjsBcf990vfIsg5+1U7VyiyBb3etg==} + confbox@0.2.2: + resolution: {integrity: sha512-1NB+BKqhtNipMsov4xI/NnhCKp9XG9NamYp5PVm9klAT0fsrNPjaFICsCFhNhwZJKNh7zB/3q8qXz0E9oaMNtQ==} config-chain@1.1.13: resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} @@ -6391,14 +6582,13 @@ packages: resolution: {integrity: sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==} engines: {node: '>= 0.10.0'} - consola@3.4.0: - resolution: {integrity: sha512-EiPU8G6dQG0GFHNR8ljnZFki/8a+cQwEQ+7wpxdChl02Q8HXlwEZWD5lqAF8vC2sEC3Tehr8hy7vErz88LHyUA==} - engines: {node: ^14.18.0 || >=16.10.0} - consola@3.4.2: resolution: {integrity: sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==} engines: {node: ^14.18.0 || >=16.10.0} + console-control-strings@1.1.0: + resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} + content-disposition@0.5.4: resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} engines: {node: '>= 0.6'} @@ -6413,6 +6603,10 @@ packages: convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + convict@6.2.4: + resolution: {integrity: sha512-qN60BAwdMVdofckX7AlohVJ2x9UvjTNoKVXCL2LxFk1l7757EJqf1nySdMkPQer0bt8kQ5lQiyZ9/2NvrFBuwQ==} + engines: {node: '>=6'} + cookie-es@1.2.2: resolution: {integrity: sha512-+W7VmiVINB+ywl1HGXJXmrqkOhpKrIiVZV6tQuV54ZyQC7MMuBt81Vc336GMLoHBq5hV/F9eXgt5Mnx0Rha5Fg==} @@ -6451,8 +6645,11 @@ packages: peerDependencies: webpack: ^5.1.0 - core-js-compat@3.41.0: - resolution: {integrity: sha512-RFsU9LySVue9RTwdDVX/T0e2Y6jRYWXERKElIjpuEOEnxaXffI0X7RUwVzfYLfzuLXSNJDYoRYUAmRUcyln20A==} + core-js-compat@3.42.0: + resolution: {integrity: sha512-bQasjMfyDGyaeWKBIu33lHh9qlSR0MFE/Nmc6nMjf/iU9b3rSMdAYz1Baxrv4lPdGUsTqZudHA4jIGSJy0SWZQ==} + + core-util-is@1.0.2: + resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==} core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} @@ -6470,11 +6667,19 @@ packages: typescript: optional: true + cp-file@10.0.0: + resolution: {integrity: sha512-vy2Vi1r2epK5WqxOLnskeKeZkdZvTKfFZQCplE3XWsP+SUJyd5XAUFC9lFgTjjXJF2GMne/UML14iEmkAaDfFg==} + engines: {node: '>=14.16'} + crc-32@1.2.2: resolution: {integrity: sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==} engines: {node: '>=0.8'} hasBin: true + crc32-stream@4.0.3: + resolution: {integrity: sha512-NT7w2JVU7DFroFdYkeq8cywxrgjPHWkdX1wjpRQXPX5Asews3tA+Ght6lddQO5Mkumffp3X7GEqku3epj2toIw==} + engines: {node: '>= 10'} + crc32-stream@6.0.0: resolution: {integrity: sha512-piICUB6ei4IlTv1+653yq5+KoqfBYmj9bw6LqXoOneTMDXk5nM1qt12mFW1caG3LlJXEKW1Bp0WggEmIfQB34g==} engines: {node: '>= 14'} @@ -6482,12 +6687,17 @@ packages: create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + cron-parser@4.9.0: + resolution: {integrity: sha512-p0SaNjrHOnQeR8/VnfGbmg9te2kfyYSQ7Sc/j/6DtPL3JQvKxmjO9TSjNFpujqV3vEYYBvNNvXSxzyksBWAx1Q==} + engines: {node: '>=12.0.0'} + croner@9.0.0: resolution: {integrity: sha512-onMB0OkDjkXunhdW9htFjEhqrD54+M94i6ackoUkjHKbRnXdyEyKRelp4nJ1kAz32+s27jP1FsebpJCVl0BsvA==} engines: {node: '>=18.0'} - cronstrue@2.56.0: - resolution: {integrity: sha512-/YC3b4D/E/S8ToQ7f676A2fqoC3vVpXKjJ4SMsP0jYsvRYJdZ6h9+Fq/Y7FoFDEUFCqLTca+G2qTV227lyyFZg==} + cronstrue@2.61.0: + resolution: {integrity: sha512-ootN5bvXbIQI9rW94+QsXN5eROtXWwew6NkdGxIRpS/UFWRggL0G5Al7a9GTBFEsuvVhJ2K3CntIIVt7L2ILhA==} + deprecated: Non-backwards compatible Breaking changes hasBin: true cross-spawn@5.1.0: @@ -6501,8 +6711,8 @@ packages: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} - crossws@0.3.4: - resolution: {integrity: sha512-uj0O1ETYX1Bh6uSgktfPvwDiPYGQ3aI4qVsaC/LWpkIzGj1nUYm5FK3K+t11oOlpN01lGbprFCH4wBlKdJjVgw==} + crossws@0.3.5: + resolution: {integrity: sha512-ojKiDvcmByhwa8YYqbQI/hg7MEU0NC03+pSdEq4ZUnZR9xXpwk7E43SMNGkn+JxJGPFtNvQ48+vV2p+P1ml5PA==} css-declaration-sorter@7.2.0: resolution: {integrity: sha512-h70rUM+3PNFuaBDTLe8wF/cdWu+dOZmb7pJt8Z2sedYbAcQVQV/tEchueg3GWxwqS0cxtbxmaHEdkNACqcvsow==} @@ -6542,23 +6752,23 @@ packages: engines: {node: '>=4'} hasBin: true - cssnano-preset-default@7.0.6: - resolution: {integrity: sha512-ZzrgYupYxEvdGGuqL+JKOY70s7+saoNlHSCK/OGn1vB2pQK8KSET8jvenzItcY+kA7NoWvfbb/YhlzuzNKjOhQ==} + cssnano-preset-default@7.0.7: + resolution: {integrity: sha512-jW6CG/7PNB6MufOrlovs1TvBTEVmhY45yz+bd0h6nw3h6d+1e+/TX+0fflZ+LzvZombbT5f+KC063w9VoHeHow==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - cssnano-utils@5.0.0: - resolution: {integrity: sha512-Uij0Xdxc24L6SirFr25MlwC2rCFX6scyUmuKpzI+JQ7cyqDEwD42fJ0xfB3yLfOnRDU5LKGgjQ9FA6LYh76GWQ==} + cssnano-utils@5.0.1: + resolution: {integrity: sha512-ZIP71eQgG9JwjVZsTPSqhc6GHgEr53uJ7tK5///VfyWj6Xp2DBmixWHqJgPno+PqATzn48pL42ww9x5SSGmhZg==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - cssnano@7.0.6: - resolution: {integrity: sha512-54woqx8SCbp8HwvNZYn68ZFAepuouZW4lTwiMVnBErM3VkO7/Sd4oTOt3Zz3bPx3kxQ36aISppyXj2Md4lg8bw==} + cssnano@7.0.7: + resolution: {integrity: sha512-evKu7yiDIF7oS+EIpwFlMF730ijRyLFaM2o5cTxRGJR9OKHKkc+qP443ZEVR9kZG0syaAJJCPJyfv5pbrxlSng==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 csso@5.0.5: resolution: {integrity: sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==} @@ -6608,8 +6818,8 @@ packages: resolution: {integrity: sha512-39BOQLs9ZjKh0/patS9nrT8wc3ioX3/eA/zgbKNopnF2wCqJEoxywwwElATYvRsXdnOxA/OQeQoFZ3rFjVajhg==} engines: {node: '>=4.0'} - db0@0.3.1: - resolution: {integrity: sha512-3RogPLE2LLq6t4YiFCREyl572aBjkfMvfwPyN51df00TbPbryL3XqBYuJ/j6mgPssPK8AKfYdLxizaO5UG10sA==} + db0@0.3.2: + resolution: {integrity: sha512-xzWNQ6jk/+NtdfLyXEipbX55dmDSeteLFt/ayF+wZUU5bzKgmrDOxmInUTbyVRp46YwnJdkDA1KhB7WIXFofJw==} peerDependencies: '@electric-sql/pglite': '*' '@libsql/client': '*' @@ -6668,8 +6878,8 @@ packages: supports-color: optional: true - debug@4.4.0: - resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==} + debug@4.4.1: + resolution: {integrity: sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' @@ -6677,6 +6887,9 @@ packages: supports-color: optional: true + decache@4.6.2: + resolution: {integrity: sha512-2LPqkLeu8XWHU8qNCS3kcF6sCcb5zIzvWaAHYSvPfwhdd7mHuah29NssMzrTYyHN4F5oFy2ko9OBYxegtU0FEw==} + decimal.js@10.5.0: resolution: {integrity: sha512-8vDa8Qxvr/+d94hSh5P3IJwI5t8/c0KsMp+g8bNw9cY2icONa5aPfvKeieW1WlG0WQYwwhJ7mjui2xtiePQSXw==} @@ -6684,6 +6897,10 @@ packages: resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} engines: {node: '>=6'} + deep-extend@0.6.0: + resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} + engines: {node: '>=4.0.0'} + deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} @@ -6729,6 +6946,9 @@ packages: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} + delegates@1.0.0: + resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} + denque@2.1.0: resolution: {integrity: sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==} engines: {node: '>=0.10'} @@ -6745,8 +6965,8 @@ packages: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} - destr@2.0.3: - resolution: {integrity: sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ==} + destr@2.0.5: + resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} destroy@1.2.0: resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} @@ -6761,8 +6981,8 @@ packages: engines: {node: '>=0.10'} hasBin: true - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} + detect-libc@2.0.4: + resolution: {integrity: sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==} engines: {node: '>=8'} detect-node-es@1.1.0: @@ -6771,6 +6991,39 @@ packages: detect-node@2.1.0: resolution: {integrity: sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==} + detective-amd@5.0.2: + resolution: {integrity: sha512-XFd/VEQ76HSpym80zxM68ieB77unNuoMwopU2TFT/ErUk5n4KvUTwW4beafAVUugrjV48l4BmmR0rh2MglBaiA==} + engines: {node: '>=14'} + hasBin: true + + detective-cjs@5.0.1: + resolution: {integrity: sha512-6nTvAZtpomyz/2pmEmGX1sXNjaqgMplhQkskq2MLrar0ZAIkHMrDhLXkRiK2mvbu9wSWr0V5/IfiTrZqAQMrmQ==} + engines: {node: '>=14'} + + detective-es6@4.0.1: + resolution: {integrity: sha512-k3Z5tB4LQ8UVHkuMrFOlvb3GgFWdJ9NqAa2YLUU/jTaWJIm+JJnEh4PsMc+6dfT223Y8ACKOaC0qcj7diIhBKw==} + engines: {node: '>=14'} + + detective-postcss@6.1.3: + resolution: {integrity: sha512-7BRVvE5pPEvk2ukUWNQ+H2XOq43xENWbH0LcdCE14mwgTBEAMoAx+Fc1rdp76SmyZ4Sp48HlV7VedUnP6GA1Tw==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + + detective-sass@5.0.3: + resolution: {integrity: sha512-YsYT2WuA8YIafp2RVF5CEfGhhyIVdPzlwQgxSjK+TUm3JoHP+Tcorbk3SfG0cNZ7D7+cYWa0ZBcvOaR0O8+LlA==} + engines: {node: '>=14'} + + detective-scss@4.0.3: + resolution: {integrity: sha512-VYI6cHcD0fLokwqqPFFtDQhhSnlFWvU614J42eY6G0s8c+MBhi9QAWycLwIOGxlmD8I/XvGSOUV1kIDhJ70ZPg==} + engines: {node: '>=14'} + + detective-stylus@4.0.0: + resolution: {integrity: sha512-TfPotjhszKLgFBzBhTOxNHDsutIxx9GTWjrL5Wh7Qx/ydxKhwUrlSFeLIn+ZaHPF+h0siVBkAQSuy6CADyTxgQ==} + engines: {node: '>=14'} + + detective-typescript@11.2.0: + resolution: {integrity: sha512-ARFxjzizOhPqs1fYC/2NMC3N4jrQ6HvVflnXBTRqNEqJuXwyKLRr9CrJwkRcV/SnZt1sNXgsF6FPm0x57Tq0rw==} + engines: {node: ^14.14.0 || >=16.0.0} + devalue@5.1.1: resolution: {integrity: sha512-maua5KUiapvEwiEAe+XnlZ3Rh0GD+qI1J/nb9vrJc3muPXvcF/8gXYTWF76+5DAqHyDUtOIImEuo0YKE9mshVw==} @@ -6786,6 +7039,10 @@ packages: didyoumean@1.2.2: resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} + diff-sequences@29.6.3: + resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + diff@4.0.2: resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} engines: {node: '>=0.3.1'} @@ -6829,10 +7086,18 @@ packages: resolution: {integrity: sha512-1gxPBJpI/pcjQhKgIU91II6Wkay+dLcN3M6rf2uwP8hRur3HtQXjVrdAK3sjC0piaEuxzMwjXChcETiJl47lAQ==} engines: {node: '>=18'} + dotenv-expand@11.0.7: + resolution: {integrity: sha512-zIHwmZPRshsCdpMDyVsqGmgyP0yT8GAgXUnkdAoJisxvf33k7yO6OuoKmcTGuXPWSsm8Oh88nZicRLA9Y0rUeA==} + engines: {node: '>=12'} + dotenv@16.4.7: resolution: {integrity: sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==} engines: {node: '>=12'} + dotenv@16.5.0: + resolution: {integrity: sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg==} + engines: {node: '>=12'} + dotenv@8.6.0: resolution: {integrity: sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==} engines: {node: '>=10'} @@ -6855,8 +7120,13 @@ packages: ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - electron-to-chromium@1.5.114: - resolution: {integrity: sha512-DFptFef3iktoKlFQK/afbo274/XNWD00Am0xa7M8FZUepHlHT8PEuiNBoRfFHbH1okqN58AlhbJ4QTkcnXorjA==} + ejs@3.1.10: + resolution: {integrity: sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==} + engines: {node: '>=0.10.0'} + hasBin: true + + electron-to-chromium@1.5.152: + resolution: {integrity: sha512-xBOfg/EBaIlVsHipHl2VdTPJRSvErNUaqW8ejTq5OlOlIYx1wOllCHsAvAIrr55jD1IYEfdR86miUEt8H5IeJg==} emoji-regex-xs@1.0.0: resolution: {integrity: sha512-LRlerrMYoIDrT6jgpeZ2YYl/L8EulRTt5hQcYjy5AInh7HWXKimpqx68aknBFpGL2+/IcogTcaydJEgaTmOpDg==} @@ -6877,6 +7147,9 @@ packages: resolution: {integrity: sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==} engines: {node: '>= 4'} + enabled@2.0.0: + resolution: {integrity: sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==} + encodeurl@1.0.2: resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} engines: {node: '>= 0.8'} @@ -6888,8 +7161,8 @@ packages: encoding@0.1.13: resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==} - end-of-stream@1.4.5: - resolution: {integrity: sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==} + end-of-stream@1.4.4: + resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} engine.io-parser@5.2.3: resolution: {integrity: sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==} @@ -6903,6 +7176,10 @@ packages: resolution: {integrity: sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg==} engines: {node: '>=10.13.0'} + enquirer@2.3.6: + resolution: {integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==} + engines: {node: '>=8.6'} + enquirer@2.4.1: resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} engines: {node: '>=8.6'} @@ -6915,10 +7192,18 @@ packages: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} + entities@6.0.0: + resolution: {integrity: sha512-aKstq2TDOndCn4diEyp9Uq/Flu2i1GlLkc6XIDQSDMuaFE3OPW5OphLCyQ5SpSJZTb4reN+kTcYru5yIfXoRPw==} + engines: {node: '>=0.12'} + env-paths@2.2.1: resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} engines: {node: '>=6'} + env-paths@3.0.0: + resolution: {integrity: sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + environment@1.1.0: resolution: {integrity: sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==} engines: {node: '>=18'} @@ -6958,8 +7243,8 @@ packages: resolution: {integrity: sha512-uDn+FE1yrDzyC0pCo961B2IHbdM8y/ACZsKD4dG6WqrjV53BADjwa7D+1aom2rsNVfLyDgU/eigvlJGJ08OQ4w==} engines: {node: '>= 0.4'} - es-module-lexer@1.6.0: - resolution: {integrity: sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==} + es-module-lexer@1.7.0: + resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} es-object-atoms@1.1.1: resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} @@ -7002,13 +7287,8 @@ packages: engines: {node: '>=18'} hasBin: true - esbuild@0.25.2: - resolution: {integrity: sha512-16854zccKPnC+toMywC+uKNeYSv+/eXkevRAfwRD/G9Cleq66m8XFIrigkbvauLLlCfDL45Q2cWegSg53gGBnQ==} - engines: {node: '>=18'} - hasBin: true - - esbuild@0.25.5: - resolution: {integrity: sha512-P8OtKZRv/5J5hhz0cUAdu/cLuPIKXpQl1R9pZtvmHWQvrAUVd0UNIPT4IB4W3rNOqVO0rlqHmCIbSwxh/c9yUQ==} + esbuild@0.25.4: + resolution: {integrity: sha512-8pgjLUcUjcgDg+2Q4NYXnPbo/vncAY4UmyaCm0jZevERqCHZIaWwdJHkf8XQtu4AxSKCdvrUbT0XUr1IdZzI8Q==} engines: {node: '>=18'} hasBin: true @@ -7019,6 +7299,10 @@ packages: escape-html@1.0.3: resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + escape-string-regexp@1.0.5: + resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} + engines: {node: '>=0.8.0'} + escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} @@ -7056,8 +7340,8 @@ packages: eslint-import-resolver-node@0.3.9: resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} - eslint-import-resolver-typescript@3.8.5: - resolution: {integrity: sha512-0ZRnzOqKc7TRm85w6REOUkVLHevN6nWd/xZsmKhSD/dcDktoxQaQAg59e5EK/QEsGFf7o5JSpE6qTwCEz0WjTw==} + eslint-import-resolver-typescript@3.10.1: + resolution: {integrity: sha512-A1rHYb06zjMGAxdLSkN2fXPBwuSaQ0iO5M/hdyS0Ajj1VBaRp0sPD3dn1FhME3c/JluGFbwSxyCfqdSbtQLAHQ==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: eslint: '*' @@ -7106,13 +7390,13 @@ packages: peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9 - eslint-plugin-prettier@5.2.3: - resolution: {integrity: sha512-qJ+y0FfCp/mQYQ/vWQ3s7eUlFEL4PyKfAJxsnYTJ4YT73nsJBWqmEpFryxV9OeUiqmsTsYJ5Y+KDNaeP31wrRw==} + eslint-plugin-prettier@5.4.0: + resolution: {integrity: sha512-BvQOvUhkVQM1i63iMETK9Hjud9QhqBnbtT1Zc642p9ynzBuCe5pybkOnvqZIBypXmMlsGcnU4HZ8sCTPfpAexA==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: '@types/eslint': '>=8.0.0' eslint: '>=8.0.0' - eslint-config-prettier: '*' + eslint-config-prettier: '>= 7.0.0 <10.0.0 || >=10.1.0' prettier: '>=3.0.0' peerDependenciesMeta: '@types/eslint': @@ -7131,8 +7415,8 @@ packages: peerDependencies: eslint: '>=7' - eslint-plugin-react@7.37.4: - resolution: {integrity: sha512-BGP0jRmfYyvOyvMoRX/uoUeW+GqNj9y16bPQzqAHf3AYII/tDs+jMN0dBVkl88/OZwNGwrVFxE7riHsXVfy/LQ==} + eslint-plugin-react@7.37.5: + resolution: {integrity: sha512-Qteup0SqU15kdocexFNAJMvCJEfa2xUKNV4CC1xsVMrIIqEy3SQ/rqyxCWNzfrd3/ldy6HMlD2e0JDVpDg2qIA==} engines: {node: '>=4'} peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7 @@ -7234,8 +7518,8 @@ packages: resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} engines: {node: '>=0.10'} - esrap@1.4.5: - resolution: {integrity: sha512-CjNMjkBWWZeHn+VX+gS8YvFwJ5+NDhg8aWZBSFJPR8qQduDNjbJodA2WcwCm7uQa5Rjqj+nZvVmceg1RbHFB9g==} + esrap@1.4.6: + resolution: {integrity: sha512-F/D2mADJ9SHY3IwksD4DAXjTt7qt7GWUf3/8RhCNWmC/67tyb55dpimHmy7EplakFaflV0R/PC+fdSPqrRHAQw==} esrecurse@4.3.0: resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} @@ -7285,8 +7569,8 @@ packages: resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} engines: {node: '>=16.17'} - execa@9.5.2: - resolution: {integrity: sha512-EHlpxMCpHWSAh1dgS6bVeoLAXGnJNdR93aabr4QCGbzOM73o5XmRfM/e5FUqsw3aagP8S8XEWUWFAxnRBnAF0Q==} + execa@9.5.3: + resolution: {integrity: sha512-QFNnTvU3UjgWFy8Ef9iDHvIdcgZ344ebkwYx4/KLbR+CKQA4xBaHzv+iRpp86QfMHP8faFQLh8iOc57215y4Rg==} engines: {node: ^18.19.0 || >=20.5.0} expect-type@1.2.1: @@ -7304,8 +7588,8 @@ packages: resolution: {integrity: sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==} engines: {node: '>= 0.10.0'} - exsolve@1.0.4: - resolution: {integrity: sha512-xsZH6PXaER4XoV+NiT7JHp1bJodJVT+cxeSH1G0f0tlT0lJqYuHUP3bUx2HtfTDvOagMINYp8rsqusxud3RXhw==} + exsolve@1.0.5: + resolution: {integrity: sha512-pz5dvkYYKQ1AHVrgOzBKWeP4u4FRb3a6DNK2ucr0OoNwYIU4QWsJ+NM36LLzORT+z845MzKHHhpXiUF5nvQoJg==} extend@3.0.2: resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} @@ -7325,8 +7609,12 @@ packages: engines: {node: '>= 10.17.0'} hasBin: true - fake-indexeddb@6.0.0: - resolution: {integrity: sha512-YEboHE5VfopUclOck7LncgIqskAqnv4q0EWbYCaxKKjAvO93c+TJIaBuGy8CBFdbg9nKdpN3AuPRwVBJ4k7NrQ==} + extsprintf@1.4.1: + resolution: {integrity: sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA==} + engines: {'0': node >=0.6.0} + + fake-indexeddb@6.0.1: + resolution: {integrity: sha512-He2AjQGHe46svIFq5+L2Nx/eHDTI1oKgoevBP+TthnjymXiKkeJQ3+ITeWey99Y5+2OaPFbI1qEsx/5RsGtWnQ==} engines: {node: '>=18'} fast-decode-uri-component@1.0.1: @@ -7392,14 +7680,17 @@ packages: fd-slicer@1.1.0: resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==} - fdir@6.4.3: - resolution: {integrity: sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==} + fdir@6.4.4: + resolution: {integrity: sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==} peerDependencies: picomatch: ^3 || ^4 peerDependenciesMeta: picomatch: optional: true + fecha@4.2.3: + resolution: {integrity: sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==} + fetch-blob@3.2.0: resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==} engines: {node: ^12.20 || >= 14.13} @@ -7407,6 +7698,10 @@ packages: fflate@0.8.2: resolution: {integrity: sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==} + figures@3.2.0: + resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} + engines: {node: '>=8'} + figures@6.1.0: resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} engines: {node: '>=18'} @@ -7418,10 +7713,17 @@ packages: file-uri-to-path@1.0.0: resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} + filelist@1.0.4: + resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==} + fill-range@7.1.1: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} + filter-obj@5.1.0: + resolution: {integrity: sha512-qWeTREPoT7I0bifpPUXtxkZJ1XJzxWtfoWWkdVGqa+eCr3SHW/Ocp89o8vLvbUuQnadybJpjOKu4V+RwO6sGng==} + engines: {node: '>=14.16'} + finalhandler@1.1.2: resolution: {integrity: sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==} engines: {node: '>= 0.8'} @@ -7438,6 +7740,10 @@ packages: resolution: {integrity: sha512-d3uCir8Hmg7W1Ywp8nKf2lJJYU9Nwinvo+1D39Dn09nz65UKXIxUh7j7K8zeWhxqe1WrkS7FJyON/Q/3lPoc6w==} engines: {node: '>=14'} + find-up-simple@1.0.1: + resolution: {integrity: sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ==} + engines: {node: '>=18'} + find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -7450,6 +7756,10 @@ packages: resolution: {integrity: sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + find-up@7.0.0: + resolution: {integrity: sha512-YyZM99iHrqLKjmt4LJDj58KI+fYyufRLBSYcqycxf//KpBk9FoewoGX0450m9nB44qrZnovzC2oeP5hUibxc/g==} + engines: {node: '>=18'} + flat-cache@4.0.1: resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} engines: {node: '>=16'} @@ -7461,6 +7771,9 @@ packages: flatted@3.3.3: resolution: {integrity: sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==} + fn.name@1.1.0: + resolution: {integrity: sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==} + focus-trap@7.6.4: resolution: {integrity: sha512-xx560wGBk7seZ6y933idtjJQc1l+ck+pI3sKvhKozdBV1dRZoKhkW5xoCaFv9tQiX5RH1xfSxjuNu6g+lmN/gw==} @@ -7500,6 +7813,16 @@ packages: resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} engines: {node: '>= 0.6'} + fresh@2.0.0: + resolution: {integrity: sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==} + engines: {node: '>= 0.8'} + + front-matter@4.0.2: + resolution: {integrity: sha512-I8ZuJ/qG92NWX8i5x1Y8qyj3vizhXS31OxjKDu3LKP+7/qBgfIKValiZIEwoVoJKUHlhWtYrktkxV1XsX+pPlg==} + + fs-constants@1.0.0: + resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} + fs-extra@11.3.0: resolution: {integrity: sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==} engines: {node: '>=14.14'} @@ -7538,10 +7861,19 @@ packages: functions-have-names@1.2.3: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} + gauge@3.0.2: + resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} + engines: {node: '>=10'} + deprecated: This package is no longer supported. + gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} + get-amd-module-type@5.0.1: + resolution: {integrity: sha512-jb65zDeHyDjFR1loOVk0HQGM5WNwoGB8aLWy3LKCieMKol0/ProHkhO2X1JxojuN10vbz1qNn09MJ7tNp7qMzw==} + engines: {node: '>=14'} + get-caller-file@2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} @@ -7588,8 +7920,8 @@ packages: get-tsconfig@4.10.0: resolution: {integrity: sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A==} - get-uri@6.0.5: - resolution: {integrity: sha512-b1O07XYq8eRuVzBNgJLstU6FYc1tS6wnMtF1I1D9lE8LxZSOGZ7LhxN54yPP6mGw5f2CkXY2BQUL9Fx41qvcIg==} + get-uri@6.0.4: + resolution: {integrity: sha512-E1b1lFFLvLgak2whF2xDBcOy6NLVGZBqqjJjsIhvopKfWWEi64pLVTWWehV8KlLerZkfNTA95sTe2OdJKm1OzQ==} engines: {node: '>= 14'} giget@1.2.5: @@ -7600,15 +7932,11 @@ packages: resolution: {integrity: sha512-L5bGsVkxJbJgdnwyuheIunkGatUF/zssUoxxjACCseZYAVbaqdh9Tsmmlkl8vYan09H7sbvKt4pS8GqKLBrEzA==} hasBin: true - git-config-path@2.0.0: - resolution: {integrity: sha512-qc8h1KIQbJpp+241id3GuAtkdyJ+IK+LIVtkiFTRKRrmddDzs3SI9CvP1QYmWBFvm1I/PWRwj//of8bgAc0ltA==} - engines: {node: '>=4'} - - git-up@8.0.1: - resolution: {integrity: sha512-2XFu1uNZMSjkyetaF+8rqn6P0XqpMq/C+2ycjI6YwrIKcszZ5/WR4UubxjN0lILOKqLkLaHDaCr2B6fP1cke6g==} + git-up@8.1.1: + resolution: {integrity: sha512-FDenSF3fVqBYSaJoYy1KSc2wosx0gCvKP+c+PRBht7cAaiCeQlBtfBDX9vgnNOHmdePlSFITVcn4pFfcgNvx3g==} - git-url-parse@16.0.1: - resolution: {integrity: sha512-mcD36GrhAzX5JVOsIO52qNpgRyFzYWRbU1VSRFCvJt1IJvqfvH427wWw/CFqkWvjVPtdG5VTx4MKUeC5GeFPDQ==} + git-url-parse@16.1.0: + resolution: {integrity: sha512-cPLz4HuK86wClEW7iDdeAKcCVlWXmrLpb2L+G9goW0Z1dtpNS6BXXSOckUTlJT/LDQViE1QZKstNORzHsLnobw==} glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} @@ -7675,10 +8003,18 @@ packages: resolution: {integrity: sha512-0Ia46fDOaT7k4og1PDW4YbodWWr3scS2vAr2lTbsplOt2WkKp0vQbkI9wKis/T5LV/dqPjO3bpS/z6GTJB82LA==} engines: {node: '>=18'} + gonzales-pe@4.3.0: + resolution: {integrity: sha512-otgSPpUmdWJ43VXyiNgEYE4luzHCL2pz4wQ0OnDluC6Eg4Ko3Vexy/SrSynglw/eR+OhkzmqFCZa/OFa/RgAOQ==} + engines: {node: '>=0.6.0'} + hasBin: true + gopd@1.2.0: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} engines: {node: '>= 0.4'} + graceful-fs@4.2.10: + resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} + graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} @@ -7689,8 +8025,8 @@ packages: resolution: {integrity: sha512-O1Ld7Dr+nqPnmGpdhzLmMTQ4vAsD+rHwMm1NLUmoUFFymBOMKxCCrtDxqdBRYXdeEPEi3SyoR4TizJLQrnKBNA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - h3@1.15.1: - resolution: {integrity: sha512-+ORaOBttdUm1E2Uu/obAyCguiI7MbBvsLTndc3gyK3zU+SYLoZXlyCP9Xgy0gikkGufFLTZXCXD6+4BsufnmHA==} + h3@1.15.3: + resolution: {integrity: sha512-z6GknHqyX0h9aQaTx22VZDf6QyZn+0Nh+Ym8O/u0SGSkyF5cuTJYKlc8MkzW3Nzf9LE1ivcpmYC3FUGpywhuUQ==} handle-thing@2.0.1: resolution: {integrity: sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==} @@ -7723,6 +8059,9 @@ packages: resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} engines: {node: '>= 0.4'} + has-unicode@2.0.1: + resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} + hash-sum@2.0.0: resolution: {integrity: sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==} @@ -7746,8 +8085,12 @@ packages: hookable@5.5.3: resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} - hosted-git-info@8.0.2: - resolution: {integrity: sha512-sYKnA7eGln5ov8T8gnYlkSOxFJvywzEx9BueN6xo/GKO8PGiI6uK6xx+DIGe45T3bdVjLAQDQW1aicT8z8JwQg==} + hosted-git-info@7.0.2: + resolution: {integrity: sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w==} + engines: {node: ^16.14.0 || >=18.0.0} + + hosted-git-info@8.1.0: + resolution: {integrity: sha512-Rw/B2DNQaPBICNXEm8balFz9a6WpZrkCGpcWFpy7nCj+NyhSdqXipmfvtmWt9xGfp0wZnBxB+iVpLmQMYt47Tw==} engines: {node: ^18.17.0 || >=20.5.0} hpack.js@2.1.6: @@ -7766,8 +8109,8 @@ packages: htmlparser2@9.1.0: resolution: {integrity: sha512-5zfg6mHUoaer/97TxnGpxmbR7zJtPwIYFMZ/H5ucTlPZhKvtum05yiPK3Mgai3a0DyVxv7qYqoweaEd2nrYQzQ==} - http-cache-semantics@4.1.1: - resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} + http-cache-semantics@4.2.0: + resolution: {integrity: sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==} http-deceiver@1.2.7: resolution: {integrity: sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw==} @@ -7780,15 +8123,15 @@ packages: resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} engines: {node: '>= 0.8'} - http-parser-js@0.5.9: - resolution: {integrity: sha512-n1XsPy3rXVxlqxVioEWdC+0+M+SQw0DpJynwtOPo1X+ZlvdzTLtDBIJJlDQTnwZIFJrZSzSGmIOUdP8tu+SgLw==} + http-parser-js@0.5.10: + resolution: {integrity: sha512-Pysuw9XpUq5dVc/2SMHpuTY01RFl8fttgcyunjL7eEMhGM3cI4eOmiCycJDVCo/7O7ClfQD3SaI6ftDzqOXYMA==} http-proxy-agent@7.0.2: resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==} engines: {node: '>= 14'} - http-proxy-middleware@2.0.7: - resolution: {integrity: sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA==} + http-proxy-middleware@2.0.9: + resolution: {integrity: sha512-c1IyJYLYppU574+YI7R4QyX2ystMtVXZwIdzazUIPIJsHuWNd+mho2j+bKoHftndicGj9yh+xjd+l0yj7VeT1Q==} engines: {node: '>=12.0.0'} peerDependencies: '@types/express': ^4.17.13 @@ -7808,6 +8151,10 @@ packages: resolution: {integrity: sha512-S9wWkJ/VSY9/k4qcjG318bqJNruzE4HySUhFYknwmu6LBP97KLLfwNf+n4V1BHurvFNkSKLFnK/RsuUnRTf9Vw==} engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} + https-proxy-agent@5.0.1: + resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} + engines: {node: '>= 6'} + https-proxy-agent@7.0.6: resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==} engines: {node: '>= 14'} @@ -7826,8 +8173,8 @@ packages: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} - human-signals@8.0.0: - resolution: {integrity: sha512-/1/GPCpDUCCYwlERiYjxoczfP0zfvZMU/OWgQPMya9AbAE24vseigFdhAMObpc8Q4lc/kjutPfUddDYyAmejnA==} + human-signals@8.0.1: + resolution: {integrity: sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ==} engines: {node: '>=18.18.0'} husky@9.1.7: @@ -7868,8 +8215,8 @@ packages: resolution: {integrity: sha512-InwqeHHN2XpumIkMvpl/DCJVrAHgCsG5+cn1XlnLWGwtZBm8QJfSusItfrwx81CTp5agNZqpKU2J/ccC5nGT4A==} engines: {node: '>= 4'} - ignore@7.0.3: - resolution: {integrity: sha512-bAH5jbK/F3T3Jls4I0SO1hmPR0dKU0a7+SY6n1yzRtG54FLO8d6w/nxLFX2Nb7dBu6cCWXPaAME6cYqFUMmuCA==} + ignore@7.0.4: + resolution: {integrity: sha512-gJzzk+PQNznz8ysRrC0aOkBNVRBDtE1n53IqyqEf3PXrYwomFs5q4pGMizBMJF+ykh03insJ27hB8gSrD2Hn8A==} engines: {node: '>= 4'} image-meta@0.2.1: @@ -7880,8 +8227,8 @@ packages: engines: {node: '>=0.10.0'} hasBin: true - immutable@5.0.3: - resolution: {integrity: sha512-P8IdPQHq3lA1xVeBRi5VPqUm5HDgKnx0Ru51wZz5mjxHr5n3RWhjIpOFU7ybkUxfB+5IToy+OLaHYDBIWsv+uw==} + immutable@5.1.2: + resolution: {integrity: sha512-qHKXW1q6liAk1Oys6umoaZbDRqjcjgSrbnrifHsfsttza7zcvRAsL7mMV6xWcyhwQy7Xj5v4hhbr6b+iDYwlmQ==} import-fresh@3.3.1: resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} @@ -7897,8 +8244,8 @@ packages: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} - index-to-position@0.1.2: - resolution: {integrity: sha512-MWDKS3AS1bGCHLBA2VLImJz42f7bJh8wQsTGCzI3j519/CASStoDONUBVz2I/VID0MpiX3SGSnbOD2xUalbE5g==} + index-to-position@1.1.0: + resolution: {integrity: sha512-XPdx9Dq4t9Qk1mTMbWONJqU7boCoumEH7fRET37HX5+khDUl3J2W6PdALxhILYlIYx2amlwYcRPp28p0tSiojg==} engines: {node: '>=18'} inflight@1.0.6: @@ -7926,8 +8273,8 @@ packages: resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} engines: {node: '>= 0.4'} - ioredis@5.6.0: - resolution: {integrity: sha512-tBZlIIWbndeWBWCXWZiqtOF/yxf6yZX3tAlTJ7nfo5jhd6dctNxF7QnYlZLZ1a0o0pDoen7CgZqO+zjNaFbJAg==} + ioredis@5.6.1: + resolution: {integrity: sha512-UxC0Yv1Y4WRJiGQxQkP0hfdL0/5/6YvdfOOClRgJ0qppSarkhneSa6UvkMkms0AkdGimSH3Ikqm+6mkMmX7vGA==} engines: {node: '>=12.22.0'} ip-address@9.0.5: @@ -7971,8 +8318,12 @@ packages: resolution: {integrity: sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==} engines: {node: '>= 0.4'} - is-bun-module@1.3.0: - resolution: {integrity: sha512-DgXeu5UWI0IsMQundYb5UAOzm6G2eVnarJ0byP6Tm55iZNKceD59LNPA2L4VvsScTtHcw0yEkVwSf7PC+QoLSA==} + is-builtin-module@3.2.1: + resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} + engines: {node: '>=6'} + + is-bun-module@2.0.0: + resolution: {integrity: sha512-gNCGbnnnnFAUGKeZ9PdbyeGYJqewpmc2aKHUEMO5nQPWU9lOmv7jcmQIv+qHD8fXW6W7qfuCwX4rY9LNRjXrkQ==} is-callable@1.2.7: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} @@ -8064,6 +8415,10 @@ packages: resolution: {integrity: sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==} engines: {node: '>=12'} + is-plain-obj@2.1.0: + resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} + engines: {node: '>=8'} + is-plain-obj@3.0.0: resolution: {integrity: sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==} engines: {node: '>=10'} @@ -8140,6 +8495,13 @@ packages: resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} engines: {node: '>=18'} + is-url-superb@4.0.0: + resolution: {integrity: sha512-GI+WjezhPPcbM+tqE9LnmsY5qqjwHzTvjJ36wxYX5ujNXefSUJ/T17r5bqDV8yLhcgB59KTPNOc9O9cmHTPWsA==} + engines: {node: '>=10'} + + is-url@1.2.4: + resolution: {integrity: sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==} + is-weakmap@2.0.2: resolution: {integrity: sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==} engines: {node: '>= 0.4'} @@ -8231,12 +8593,25 @@ packages: jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + jake@10.9.2: + resolution: {integrity: sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==} + engines: {node: '>=10'} + hasBin: true + jasmine-core@4.6.1: resolution: {integrity: sha512-VYz/BjjmC3klLJlLwA4Kw8ytk0zDSmbbDLNs794VnWmkcCB7I9aAL/D48VNQtmITyPvea2C3jdUMfc3kAoy0PQ==} jasmine-core@5.2.0: resolution: {integrity: sha512-tSAtdrvWybZkQmmaIoDgnvHG8ORUNw5kEVlO5CvrXj02Jjr9TZrmjFq7FUiOUzJiOP2wLGYT6PgrQgQF4R1xiw==} + jest-diff@29.7.0: + resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-get-type@29.6.3: + resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-worker@27.5.1: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} @@ -8262,10 +8637,6 @@ packages: resolution: {integrity: sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==} engines: {node: '>=14'} - js-levenshtein@1.1.6: - resolution: {integrity: sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==} - engines: {node: '>=0.10.0'} - js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -8316,9 +8687,22 @@ packages: resolution: {integrity: sha512-lR4MXjGNgkJc7tkQ97kb2nuEMnNCyU//XYVH0MKTGcXEiSudQ5MKGKen3C5QubYy0vmq+JGitUg92uuywGEwIA==} engines: {node: ^18.17.0 || >=20.5.0} + json-schema-diff@0.18.1: + resolution: {integrity: sha512-lLP/kbwXN85yKWwBGtraxVrJnK/v31D7UZIkSg68BrO+Qeai+aeW1u9b5H1h9uF/Uzzsa8PeaQPTYRaUcdAgWQ==} + engines: {node: '>=v10.24.1'} + hasBin: true + + json-schema-ref-parser@9.0.9: + resolution: {integrity: sha512-qcP2lmGy+JUoQJ4DOQeLaZDqH9qSkeGCK3suKWxJXS82dg728Mn3j97azDMaOUmJAN4uCq91LdPx4K7E8F1a7Q==} + engines: {node: '>=10'} + deprecated: Please switch to @apidevtools/json-schema-ref-parser + json-schema-ref-resolver@2.0.1: resolution: {integrity: sha512-HG0SIB9X4J8bwbxCbnd5FfPEbcXAJYTi1pBJeP/QPON+w8ovSME8iRG+ElHNxZNX2Qh6eYn1GdzJFS4cDFfx0Q==} + json-schema-spec-types@0.1.2: + resolution: {integrity: sha512-MDl8fA8ONckmQOm2+eXKJaFJNvxk7eGin+XFofNjS3q3PRKSoEvgMVb0ehOpCAYkUiLoMiqdU7obV7AmzAmyLw==} + json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} @@ -8340,6 +8724,9 @@ packages: engines: {node: '>=6'} hasBin: true + jsonc-parser@3.2.0: + resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} + jsonc-parser@3.3.1: resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} @@ -8353,10 +8740,22 @@ packages: resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} engines: {'0': node >= 0.2.0} + jsonpointer@5.0.1: + resolution: {integrity: sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==} + engines: {node: '>=0.10.0'} + jsx-ast-utils@3.3.5: resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==} engines: {node: '>=4.0'} + junk@4.0.1: + resolution: {integrity: sha512-Qush0uP+G8ZScpGMZvHUiRfI0YBWuB3gVBYlI0v0vvOJt5FLicco+IkP0a50LqTTQhmts/m6tP5SWE+USyIvcQ==} + engines: {node: '>=12.20'} + + jwt-decode@4.0.0: + resolution: {integrity: sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==} + engines: {node: '>=18'} + karma-chrome-launcher@3.2.0: resolution: {integrity: sha512-rE9RkUPI7I9mAxByQWkGJFXfFD6lE4gC5nPuZdobf/QdTEJI6EU4yIay/cfU/xV4ZxlM5JiTv7zWYgA64NpS5Q==} @@ -8413,6 +8812,18 @@ packages: kolorist@1.8.0: resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==} + kuler@2.0.0: + resolution: {integrity: sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==} + + ky@1.8.1: + resolution: {integrity: sha512-7Bp3TpsE+L+TARSnnDpk3xg8Idi8RwSLdj6CMbNWoOARIrGrbuLGusV0dYwbZOm4bB3jHNxSw8Wk/ByDqJEnDw==} + engines: {node: '>=18'} + + lambda-local@2.2.0: + resolution: {integrity: sha512-bPcgpIXbHnVGfI/omZIlgucDqlf4LrsunwoKue5JdZeGybt8L6KyJz2Zu19ffuZwIwLj2NAI2ZyaqNT6/cetcg==} + engines: {node: '>=8'} + hasBin: true + language-subtag-registry@0.3.23: resolution: {integrity: sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==} @@ -8420,6 +8831,10 @@ packages: resolution: {integrity: sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==} engines: {node: '>=0.10'} + latest-version@9.0.0: + resolution: {integrity: sha512-7W0vV3rqv5tokqkBAFV1LbR7HPOWzXQDpDgEuib/aJ1jsZZx6x3c2mBI+TJhJzOhkGeaLbCKEHXEXLfirtG2JA==} + engines: {node: '>=18'} + launch-editor@2.10.0: resolution: {integrity: sha512-D7dBRJo/qcGX9xlvt/6wUYzQxjh5G1RvZPgPv8vi4KRU99DVQL/oW7tnVOCCTm2HGeo3C5HvGE5Yrh6UBoZ0vA==} @@ -8471,6 +8886,10 @@ packages: lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + lines-and-columns@2.0.3: + resolution: {integrity: sha512-cNOjgCnLB+FnvWWtyRTzmB3POJ+cXxTA81LoW7u8JdmhfXzriropYwpjShnz1QLLWsQwY7nIxoDmcPTwphDK9w==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + lint-staged@15.3.0: resolution: {integrity: sha512-vHFahytLoF2enJklgtOtCtIjZrKD/LoxlaUusd5nh7dWv/dkKQJY74ndFSzxCdv7g0ueGg1ORgTSt4Y9LPZn9A==} engines: {node: '>=18.12.0'} @@ -8527,15 +8946,38 @@ packages: resolution: {integrity: sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + lodash-es@4.17.21: + resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} + + lodash.clonedeep@4.5.0: + resolution: {integrity: sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==} + lodash.debounce@4.0.8: resolution: {integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==} lodash.defaults@4.2.0: resolution: {integrity: sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==} + lodash.difference@4.5.0: + resolution: {integrity: sha512-dS2j+W26TQ7taQBGN8Lbbq04ssV3emRw4NY58WErlTO29pIqS0HmoT5aJ9+TUQ1N3G+JOZSji4eugsWwGp9yPA==} + + lodash.flatten@4.4.0: + resolution: {integrity: sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==} + + lodash.get@4.4.2: + resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==} + deprecated: This package is deprecated. Use the optional chaining (?.) operator instead. + lodash.isarguments@3.1.0: resolution: {integrity: sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==} + lodash.isequal@4.5.0: + resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==} + deprecated: This package is deprecated. Use require('node:util').isDeepStrictEqual instead. + + lodash.isplainobject@4.0.6: + resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==} + lodash.memoize@4.1.2: resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} @@ -8548,6 +8990,9 @@ packages: lodash.startcase@4.4.0: resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} + lodash.union@4.6.0: + resolution: {integrity: sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw==} + lodash.uniq@4.5.0: resolution: {integrity: sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==} @@ -8566,6 +9011,10 @@ packages: resolution: {integrity: sha512-1somDdy9sChrr9/f4UlzhdaGfDR2c/SaD2a4T7qEkG4jTS57/B3qmnjLYePwQ8cqWnUHZI0iAKxMBpCZICiZ2g==} engines: {node: '>=8.0'} + logform@2.7.0: + resolution: {integrity: sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ==} + engines: {node: '>= 12.0.0'} + loose-envify@1.4.0: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true @@ -8590,6 +9039,10 @@ packages: resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} engines: {node: '>=12'} + luxon@3.6.1: + resolution: {integrity: sha512-tJLxrKJhO2ukZ5z0gyjY1zPh3Rh88Ej9P7jNrZiHMUXHae1yvI2imgOZtL1TO8TW6biMMKfTtAOoEJANgtWBMQ==} + engines: {node: '>=12'} + magic-regexp@0.8.0: resolution: {integrity: sha512-lOSLWdE156csDYwCTIGiAymOLN7Epu/TU5e/oAnISZfU6qP+pgjkE+xbVjVn3yLPKN8n1G2yIAYTAM5KRk6/ow==} @@ -8607,6 +9060,10 @@ packages: resolution: {integrity: sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==} engines: {node: '>=6'} + make-dir@3.1.0: + resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} + engines: {node: '>=8'} + make-dir@4.0.0: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} @@ -8649,8 +9106,8 @@ packages: resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} engines: {node: '>= 0.6'} - memfs@4.17.0: - resolution: {integrity: sha512-4eirfZ7thblFmqFjywlTmuWVSvccHAJbn1r8qQLzmTO11qcqpohOjmY2mFce6x7x7WtskzRqApPD0hv+Oa74jg==} + memfs@4.17.1: + resolution: {integrity: sha512-thuTRd7F4m4dReCIy7vv4eNYnU6XI/tHMLSMMHLiortw/Y0QxqKtinG523U2aerzwYWGi606oBP4oMPy4+edag==} engines: {node: '>= 4.0.0'} memorystream@0.3.1: @@ -8660,6 +9117,10 @@ packages: merge-descriptors@1.0.3: resolution: {integrity: sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==} + merge-options@3.0.4: + resolution: {integrity: sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==} + engines: {node: '>=10'} + merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} @@ -8671,6 +9132,9 @@ packages: resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} engines: {node: '>= 0.6'} + micro-api-client@3.3.0: + resolution: {integrity: sha512-y0y6CUB9RLVsy3kfgayU28746QrNMpSm9O/AYGNsBgOkJr/X/Jk0VLGoO8Ude7Bpa8adywzF+MzXNZRFRsNPhg==} + micromark-util-character@2.1.1: resolution: {integrity: sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==} @@ -8702,6 +9166,10 @@ packages: resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} engines: {node: '>= 0.6'} + mime-types@3.0.1: + resolution: {integrity: sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==} + engines: {node: '>= 0.6'} + mime@1.6.0: resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} engines: {node: '>=4'} @@ -8717,8 +9185,8 @@ packages: engines: {node: '>=10.0.0'} hasBin: true - mime@4.0.6: - resolution: {integrity: sha512-4rGt7rvQHBbaSOF9POGkk1ocRP16Md1x36Xma8sz8h8/vfCUI2OtEIeCqe4Ofes853x4xDoPiFLIT47J5fI/7A==} + mime@4.0.7: + resolution: {integrity: sha512-2OfDPL+e03E0LrXaGYOtTFIYhiuzep94NSsuhrNULq+stylcJedcHdzHtz0atMUuGwJfFYs0YL5xeC/Ca2x0eQ==} engines: {node: '>=16'} hasBin: true @@ -8754,6 +9222,10 @@ packages: resolution: {integrity: sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==} engines: {node: '>=16 || 14 >=14.17'} + minimatch@9.0.3: + resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} + engines: {node: '>=16 || 14 >=14.17'} + minimatch@9.0.5: resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} engines: {node: '>=16 || 14 >=14.17'} @@ -8800,8 +9272,8 @@ packages: resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} engines: {node: '>= 8'} - minizlib@3.0.1: - resolution: {integrity: sha512-umcy022ILvb5/3Djuu8LWeqUa8D68JaBzlttKeMWen48SjabqS3iY5w/vzeMzMUNhLDifyhbOwKDSznB1vvrwg==} + minizlib@3.0.2: + resolution: {integrity: sha512-oG62iEk+CYt5Xj2YqI5Xi9xWUeZhDI8jjQmC5oThVH5JGCTgIjr7ciJDzC7MBzYd//WvR1OTmP5Q38Q8ShQtVA==} engines: {node: '>= 18'} mitt@3.0.1: @@ -8842,6 +9314,11 @@ packages: mocked-exports@0.1.1: resolution: {integrity: sha512-aF7yRQr/Q0O2/4pIXm6PZ5G+jAd7QS4Yu8m+WEeEHGnbo+7mE36CbLSDQiXYV8bVL3NfmdeqPJct0tUlnjVSnA==} + module-definition@5.0.1: + resolution: {integrity: sha512-kvw3B4G19IXk+BOXnYq/D/VeO9qfHaapMeuS7w7sNUqmGaA6hywdFHMi+VWeR9wUScXM7XjoryTffCZ5B0/8IA==} + engines: {node: '>=14'} + hasBin: true + mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} @@ -8889,16 +9366,6 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - nanoid@3.3.9: - resolution: {integrity: sha512-SppoicMGpZvbF1l3z4x7No3OlIjP7QJvC9XR7AhZr1kL133KHnKPztkKDc+Ir4aJ/1VhTySrtKhrsycmrMQfvg==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - nanoid@5.1.3: - resolution: {integrity: sha512-zAbEOEr7u2CbxwoMRlz/pNSpRP0FdAU4pRaYunCdEezWohXFs+a0Xw7RfkKaezMsmSM1vttcLthJtwRnVtOfHQ==} - engines: {node: ^18 || >=20} - hasBin: true - nanoid@5.1.5: resolution: {integrity: sha512-Ir/+ZpE9fDsNH0hQ3C68uyThDXzYcim2EqcZ8zn8Chtt1iylPT9xXJB0kPCnqzgcEGikO9RxSrh63MsmVCU7Fw==} engines: {node: ^18 || >=20} @@ -8907,6 +9374,11 @@ packages: nanotar@0.1.1: resolution: {integrity: sha512-AiJsGsSF3O0havL1BydvI4+wR76sKT+okKRwWIaK96cZUnXqH0uNBOsHlbwZq3+m2BR1VKqHDVudl3gO4mYjpQ==} + napi-postinstall@0.2.4: + resolution: {integrity: sha512-ZEzHJwBhZ8qQSbknHqYcdtQVr8zUgGyM/q6h6qAyhtyVMNrSgDhrC4disf03dYW0e+czXyLnZINnCTEkWy0eJg==} + engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} + hasBin: true + natural-compare-lite@1.4.0: resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} @@ -8933,6 +9405,13 @@ packages: neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} + nested-error-stacks@2.1.1: + resolution: {integrity: sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw==} + + netlify@13.3.5: + resolution: {integrity: sha512-Nc3loyVASW59W+8fLDZT1lncpG7llffyZ2o0UQLx/Fr20i7P8oP+lE7+TEcFvXj9IUWU6LjB9P3BH+iFGyp+mg==} + engines: {node: ^14.16.0 || >=16.0.0} + netmask@2.0.2: resolution: {integrity: sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==} engines: {node: '>= 0.4.0'} @@ -8958,8 +9437,8 @@ packages: sass: optional: true - nitropack@2.11.6: - resolution: {integrity: sha512-iaLzOKYxsNL8G6h9cMFTC/hAN4RfhZsrFzFFzemr6Vfn57MooYEz6KLeUoRyTposlAeEWTVejz8naYOORIrnDg==} + nitropack@2.11.12: + resolution: {integrity: sha512-e2AdQrEY1IVoNTdyjfEQV93xkqz4SQxAMR0xWF8mZUUHxMLm6S4nPzpscjksmT4OdUxl0N8/DCaGjKQ9ghdodA==} engines: {node: ^16.11.0 || >=17.0.0} hasBin: true peerDependencies: @@ -9011,17 +9490,29 @@ packages: resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==} hasBin: true - node-gyp@11.1.0: - resolution: {integrity: sha512-/+7TuHKnBpnMvUQnsYEb0JOozDZqarQbfNuSGLXIjhStMT0fbw7IdSqWgopOP5xhRZE+lsbIvAHcekddruPZgQ==} + node-gyp@11.2.0: + resolution: {integrity: sha512-T0S1zqskVUSxcsSTkAsLc7xCycrRYmtDHadDinzocrThjyQCn5kMlEBSj6H4qDbgsIOSLmmlRIeb0lZXj+UArA==} engines: {node: ^18.17.0 || >=20.5.0} hasBin: true + node-machine-id@1.1.12: + resolution: {integrity: sha512-QNABxbrPa3qEIfrE6GOJ7BYIuignnJw7iQ2YPbc3Nla1HzRJjXzZOiikfF8m7eAMfichLt3M4VgLOetqgDmgGQ==} + node-mock-http@1.0.0: resolution: {integrity: sha512-0uGYQ1WQL1M5kKvGRXWQ3uZCHtLTO8hln3oBjIusM75WoesZ909uQJs/Hb946i2SS+Gsrhkaa6iAO17jRIv6DQ==} node-releases@2.0.19: resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} + node-source-walk@6.0.2: + resolution: {integrity: sha512-jn9vOIK/nfqoFCcpK89/VCVaLg1IHE6UVfDOzvqmANaJ/rWCTEdH8RZ1V278nv2jr36BJdyQXIAavBLXpzdlag==} + engines: {node: '>=14'} + + nopt@5.0.0: + resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} + engines: {node: '>=6'} + hasBin: true + nopt@7.2.1: resolution: {integrity: sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -9032,6 +9523,14 @@ packages: engines: {node: ^18.17.0 || >=20.5.0} hasBin: true + normalize-package-data@6.0.2: + resolution: {integrity: sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g==} + engines: {node: ^16.14.0 || >=18.0.0} + + normalize-path@2.1.1: + resolution: {integrity: sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==} + engines: {node: '>=0.10.0'} + normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} @@ -9089,11 +9588,15 @@ packages: resolution: {integrity: sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==} engines: {node: '>=18'} + npmlog@5.0.1: + resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} + deprecated: This package is no longer supported. + nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} - nuxi@3.22.5: - resolution: {integrity: sha512-fYEA7FDWQAVxGclBA/HHD+I4OurKuGBgxr/IGI6a78vjIg91AIhOPAzVcEkMtCSb0RWOnju3U1XO4ENnHMCq5Q==} + nuxi@3.25.1: + resolution: {integrity: sha512-NeZDRVdn58QF3+clrkKRXE3PtfhE4hkmj8/Wqf6th707SDqmdBb/KZV2BE4lwL+FhgEDgtN7AMF8WZCkicudXg==} engines: {node: ^16.10.0 || >=18.0.0} hasBin: true @@ -9110,8 +9613,21 @@ packages: '@types/node': optional: true - nwsapi@2.2.18: - resolution: {integrity: sha512-p1TRH/edngVEHVbwqWnxUViEmq5znDvyB+Sik5cmuLpGOIfDf/39zLiq3swPF8Vakqn+gvNiOQAZu8djYlQILA==} + nwsapi@2.2.20: + resolution: {integrity: sha512-/ieB+mDe4MrrKMT8z+mQL8klXydZWGR5Dowt4RAGKbJ3kIGEx3X4ljUo+6V73IXtUPWgfOlU5B9MlGxFO5T+cA==} + + nx@21.0.3: + resolution: {integrity: sha512-MWKucgA00TRjMBsuGbAS6HrCnOVwktU7Zxxw06Rfl0ue9tfTqbZX5iiNnb6M7b2wPQm9zcQXEq3DVBkPP8wUNw==} + engines: {node: ^20.19.0 || ^22.12.0} + hasBin: true + peerDependencies: + '@swc-node/register': ^1.8.0 + '@swc/core': ^1.3.85 + peerDependenciesMeta: + '@swc-node/register': + optional: true + '@swc/core': + optional: true nypm@0.3.12: resolution: {integrity: sha512-D3pzNDWIvgA+7IORhD/IuWzEk4uXv6GsgOxiid4UU3h9oq5IqV1KtPDi63n4sZJ/xcWlr88c0QM2RgN5VbOhFA==} @@ -9153,8 +9669,8 @@ packages: resolution: {integrity: sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==} engines: {node: '>= 0.4'} - object.entries@1.1.8: - resolution: {integrity: sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==} + object.entries@1.1.9: + resolution: {integrity: sha512-8u/hfXFRBD1O0hPUjioLhoWFHRmt6tKA4/vZPyckBr18l1KE9uHrFaFaUi8MDRTpi4uak2goyPTSNJLXX2k2Hw==} engines: {node: '>= 0.4'} object.fromentries@2.0.8: @@ -9200,6 +9716,9 @@ packages: once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + one-time@1.0.0: + resolution: {integrity: sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==} + onetime@5.1.2: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} @@ -9227,16 +9746,25 @@ packages: resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==} engines: {node: '>=12'} - openapi-typescript@7.6.1: - resolution: {integrity: sha512-F7RXEeo/heF3O9lOXo2bNjCOtfp7u+D6W3a3VNEH2xE6v+fxLtn5nq0uvUcA1F5aT+CMhNeC5Uqtg5tlXFX/ag==} + openapi-diff@0.23.7: + resolution: {integrity: sha512-ABXJ7gTYyawmEC4Z3MiLu7CoD2fLSVfid+ttP9yiuDpytC2PDsc26OTNhYUV9y/z2/ama4CKbszkq3LMd80R6Q==} + engines: {node: '>=6.11.4'} hasBin: true - peerDependencies: - typescript: ^5.x + + openapi-types@12.1.3: + resolution: {integrity: sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==} + + openapi3-ts@2.0.2: + resolution: {integrity: sha512-TxhYBMoqx9frXyOgnRHufjQfPXomTIHYKhSKJ6jHfj13kS8OEIhvmE8CTuQyKtjjWttAjX5DPxM1vmalEpo8Qw==} optionator@0.9.4: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} + ora@5.3.0: + resolution: {integrity: sha512-zAKMgGXUim0Jyd6CXK9lraBnD3H5yPGBPPOkC23a2BG6hsm4Zu6OQSjQuEtV0BHDf4aKHcUFvJiGRrFuW3MG8g==} + engines: {node: '>=10'} + ora@5.4.1: resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} engines: {node: '>=10'} @@ -9255,6 +9783,10 @@ packages: resolution: {integrity: sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==} engines: {node: '>= 0.4'} + p-event@5.0.1: + resolution: {integrity: sha512-dd589iCQ7m1L0bmC5NLlVYfy3TbBEsMUfWx9PyAgPeIcFZ/E2yaTZ4Rz4MiBmmJShviiftHVXOqfnfzJ6kyMrQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + p-filter@2.1.0: resolution: {integrity: sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==} engines: {node: '>=8'} @@ -9295,10 +9827,22 @@ packages: resolution: {integrity: sha512-hEt02O4hUct5wtwg4H4KcWgDdm+l1bOaEy/hWzd8xtXB9BqxTWBBhb+2ImAtH4Cv4rPjV76xN3Zumqk3k3AhhQ==} engines: {node: '>=16.17'} + p-timeout@5.1.0: + resolution: {integrity: sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==} + engines: {node: '>=12'} + + p-timeout@6.1.4: + resolution: {integrity: sha512-MyIV3ZA/PmyBN/ud8vV9XzwTrNtR4jFrObymZYnZqMmW0zA8Z17vnT0rBgFE/TlohB+YCHqXMgZzb3Csp49vqg==} + engines: {node: '>=14.16'} + p-try@2.2.0: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} + p-wait-for@5.0.2: + resolution: {integrity: sha512-lwx6u1CotQYPVju77R+D0vFomni/AqRfqLmqQ8hekklqZ6gAY9rONh7lBQ0uxWMkC2AuX9b2DVAl8To0NyP1JA==} + engines: {node: '>=12'} + pac-proxy-agent@7.2.0: resolution: {integrity: sha512-TEB8ESquiLMc0lV8vcd5Ql/JAKAoyzHFXaStwjkzpOpC5Yv+pIzLfHvjTSdf3vpa2bMiUQrg9i6276yn8666aA==} engines: {node: '>= 14'} @@ -9310,9 +9854,16 @@ packages: package-json-from-dist@1.0.1: resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} + package-json@10.0.1: + resolution: {integrity: sha512-ua1L4OgXSBdsu1FPb7F3tYH0F48a6kxvod4pLUlGY9COeJAJQNX/sNH2IiEmsxw7lqYiAwrdHMjz1FctOsyDQg==} + engines: {node: '>=18'} + package-manager-detector@0.2.11: resolution: {integrity: sha512-BEnLolu+yuz22S56CU1SUKq3XC3PkwD5wv4ikR4MfGvnRVcmzXR9DwSlW2fEamyTPyXHomBJRzgapeuBvRNzJQ==} + package-manager-detector@1.3.0: + resolution: {integrity: sha512-ZsEbbZORsyHuO00lY1kV3/t72yp6Ysay6Pd17ZAlNGuGwmWDLCJxFpRs0IzfXfj1o4icJOkUEioexFHzyPurSQ==} + packrup@0.1.2: resolution: {integrity: sha512-ZcKU7zrr5GlonoS9cxxrb5HVswGnyj6jQvwFBa6p5VFw7G71VAHcUKL5wyZSU/ECtPM/9gacWxy2KFQKt1gMNA==} @@ -9325,16 +9876,16 @@ packages: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} - parse-git-config@3.0.0: - resolution: {integrity: sha512-wXoQGL1D+2COYWCD35/xbiKma1Z15xvZL8cI25wvxzled58V51SJM04Urt/uznS900iQor7QO04SgdfT/XlbuA==} - engines: {node: '>=8'} + parse-gitignore@2.0.0: + resolution: {integrity: sha512-RmVuCHWsfu0QPNW+mraxh/xjQVw/lhUCUru8Zni3Ctq3AoMhpDTq0OVdKS6iesd6Kqb7viCV3isAL43dciOSog==} + engines: {node: '>=14'} parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} - parse-json@8.1.0: - resolution: {integrity: sha512-rum1bPifK5SSar35Z6EKZuYPJx85pkNaFrxBK3mwdfSJ1/WKbYrjoW/zTPSjRRamfmVX1ACBIdFAO0VRErW/EA==} + parse-json@8.3.0: + resolution: {integrity: sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ==} engines: {node: '>=18'} parse-ms@4.0.0: @@ -9345,8 +9896,8 @@ packages: resolution: {integrity: sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==} engines: {node: '>= 0.10'} - parse-path@7.0.1: - resolution: {integrity: sha512-6ReLMptznuuOEzLoGEa+I1oWRSj2Zna5jLWC+l6zlfAI4dbbSaIES29ThzuPkbhNahT65dWzfoZEO6cfJw2Ksg==} + parse-path@7.1.0: + resolution: {integrity: sha512-EuCycjZtfPcjWk7KTksnJ5xPMvWGA/6i4zrLYhRG0hGvC3GPU/jGUj3Cy+ZR0v30duV3e23R95T1lE2+lsndSw==} parse-url@9.2.0: resolution: {integrity: sha512-bCgsFI+GeGWPAvAiUv63ZorMeif3/U0zaXABGJbOWt5OH2KCaPHF6S+0ok4aqM9RuIPGyZdx9tR9l13PsW4AYQ==} @@ -9367,8 +9918,8 @@ packages: parse5@6.0.1: resolution: {integrity: sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==} - parse5@7.2.1: - resolution: {integrity: sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==} + parse5@7.3.0: + resolution: {integrity: sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==} parseurl@1.3.3: resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} @@ -9477,8 +10028,8 @@ packages: resolution: {integrity: sha512-i85pKRCt4qMjZ1+L7sy2Ag4t1atFcdbEt76+7iRJn1g2BvsnRMGu9p8pivl9fs63M2kF/A0OacFZhTub+m/qMg==} hasBin: true - pirates@4.0.6: - resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} + pirates@4.0.7: + resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==} engines: {node: '>= 6'} piscina@4.8.0: @@ -9494,10 +10045,6 @@ packages: pkg-types@2.1.0: resolution: {integrity: sha512-wmJwA+8ihJixSoHKxZJRBQG1oY8Yr9pGLzRmSsNms0iNWyHHAlZCa7mmKiFR10YPZuz/2k169JiS/inOjBCZ2A==} - pluralize@8.0.0: - resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} - engines: {node: '>=4'} - possible-typed-array-names@1.1.0: resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} engines: {node: '>= 0.4'} @@ -9508,41 +10055,41 @@ packages: peerDependencies: postcss: ^8.4.38 - postcss-colormin@7.0.2: - resolution: {integrity: sha512-YntRXNngcvEvDbEjTdRWGU606eZvB5prmHG4BF0yLmVpamXbpsRJzevyy6MZVyuecgzI2AWAlvFi8DAeCqwpvA==} + postcss-colormin@7.0.3: + resolution: {integrity: sha512-xZxQcSyIVZbSsl1vjoqZAcMYYdnJsIyG8OvqShuuqf12S88qQboxxEy0ohNCOLwVPXTU+hFHvJPACRL2B5ohTA==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - postcss-convert-values@7.0.4: - resolution: {integrity: sha512-e2LSXPqEHVW6aoGbjV9RsSSNDO3A0rZLCBxN24zvxF25WknMPpX8Dm9UxxThyEbaytzggRuZxaGXqaOhxQ514Q==} + postcss-convert-values@7.0.5: + resolution: {integrity: sha512-0VFhH8nElpIs3uXKnVtotDJJNX0OGYSZmdt4XfSfvOMrFw1jKfpwpZxfC4iN73CTM/MWakDEmsHQXkISYj4BXw==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - postcss-discard-comments@7.0.3: - resolution: {integrity: sha512-q6fjd4WU4afNhWOA2WltHgCbkRhZPgQe7cXF74fuVB/ge4QbM9HEaOIzGSiMvM+g/cOsNAUGdf2JDzqA2F8iLA==} + postcss-discard-comments@7.0.4: + resolution: {integrity: sha512-6tCUoql/ipWwKtVP/xYiFf1U9QgJ0PUvxN7pTcsQ8Ns3Fnwq1pU5D5s1MhT/XySeLq6GXNvn37U46Ded0TckWg==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - postcss-discard-duplicates@7.0.1: - resolution: {integrity: sha512-oZA+v8Jkpu1ct/xbbrntHRsfLGuzoP+cpt0nJe5ED2FQF8n8bJtn7Bo28jSmBYwqgqnqkuSXJfSUEE7if4nClQ==} + postcss-discard-duplicates@7.0.2: + resolution: {integrity: sha512-eTonaQvPZ/3i1ASDHOKkYwAybiM45zFIc7KXils4mQmHLqIswXD9XNOKEVxtTFnsmwYzF66u4LMgSr0abDlh5w==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - postcss-discard-empty@7.0.0: - resolution: {integrity: sha512-e+QzoReTZ8IAwhnSdp/++7gBZ/F+nBq9y6PomfwORfP7q9nBpK5AMP64kOt0bA+lShBFbBDcgpJ3X4etHg4lzA==} + postcss-discard-empty@7.0.1: + resolution: {integrity: sha512-cFrJKZvcg/uxB6Ijr4l6qmn3pXQBna9zyrPC+sK0zjbkDUZew+6xDltSF7OeB7rAtzaaMVYSdbod+sZOCWnMOg==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - postcss-discard-overridden@7.0.0: - resolution: {integrity: sha512-GmNAzx88u3k2+sBTZrJSDauR0ccpE24omTQCVmaTTZFz1du6AasspjaUPMJ2ud4RslZpoFKyf+6MSPETLojc6w==} + postcss-discard-overridden@7.0.1: + resolution: {integrity: sha512-7c3MMjjSZ/qYrx3uc1940GSOzN1Iqjtlqe8uoSg+qdVPYyRb0TILSqqmtlSFuE4mTDECwsm397Ya7iXGzfF7lg==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 postcss-import@15.1.0: resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==} @@ -9614,41 +10161,41 @@ packages: postcss-media-query-parser@0.2.3: resolution: {integrity: sha512-3sOlxmbKcSHMjlUXQZKQ06jOswE7oVkXPxmZdoB1r5l0q6gTFTQSHxNxOrCccElbW7dxNytifNEo8qidX2Vsig==} - postcss-merge-longhand@7.0.4: - resolution: {integrity: sha512-zer1KoZA54Q8RVHKOY5vMke0cCdNxMP3KBfDerjH/BYHh4nCIh+1Yy0t1pAEQF18ac/4z3OFclO+ZVH8azjR4A==} + postcss-merge-longhand@7.0.5: + resolution: {integrity: sha512-Kpu5v4Ys6QI59FxmxtNB/iHUVDn9Y9sYw66D6+SZoIk4QTz1prC4aYkhIESu+ieG1iylod1f8MILMs1Em3mmIw==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - postcss-merge-rules@7.0.4: - resolution: {integrity: sha512-ZsaamiMVu7uBYsIdGtKJ64PkcQt6Pcpep/uO90EpLS3dxJi6OXamIobTYcImyXGoW0Wpugh7DSD3XzxZS9JCPg==} + postcss-merge-rules@7.0.5: + resolution: {integrity: sha512-ZonhuSwEaWA3+xYbOdJoEReKIBs5eDiBVLAGpYZpNFPzXZcEE5VKR7/qBEQvTZpiwjqhhqEQ+ax5O3VShBj9Wg==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - postcss-minify-font-values@7.0.0: - resolution: {integrity: sha512-2ckkZtgT0zG8SMc5aoNwtm5234eUx1GGFJKf2b1bSp8UflqaeFzR50lid4PfqVI9NtGqJ2J4Y7fwvnP/u1cQog==} + postcss-minify-font-values@7.0.1: + resolution: {integrity: sha512-2m1uiuJeTplll+tq4ENOQSzB8LRnSUChBv7oSyFLsJRtUgAAJGP6LLz0/8lkinTgxrmJSPOEhgY1bMXOQ4ZXhQ==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - postcss-minify-gradients@7.0.0: - resolution: {integrity: sha512-pdUIIdj/C93ryCHew0UgBnL2DtUS3hfFa5XtERrs4x+hmpMYGhbzo6l/Ir5de41O0GaKVpK1ZbDNXSY6GkXvtg==} + postcss-minify-gradients@7.0.1: + resolution: {integrity: sha512-X9JjaysZJwlqNkJbUDgOclyG3jZEpAMOfof6PUZjPnPrePnPG62pS17CjdM32uT1Uq1jFvNSff9l7kNbmMSL2A==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - postcss-minify-params@7.0.2: - resolution: {integrity: sha512-nyqVLu4MFl9df32zTsdcLqCFfE/z2+f8GE1KHPxWOAmegSo6lpV2GNy5XQvrzwbLmiU7d+fYay4cwto1oNdAaQ==} + postcss-minify-params@7.0.3: + resolution: {integrity: sha512-vUKV2+f5mtjewYieanLX0xemxIp1t0W0H/D11u+kQV/MWdygOO7xPMkbK+r9P6Lhms8MgzKARF/g5OPXhb8tgg==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - postcss-minify-selectors@7.0.4: - resolution: {integrity: sha512-JG55VADcNb4xFCf75hXkzc1rNeURhlo7ugf6JjiiKRfMsKlDzN9CXHZDyiG6x/zGchpjQS+UAgb1d4nqXqOpmA==} + postcss-minify-selectors@7.0.5: + resolution: {integrity: sha512-x2/IvofHcdIrAm9Q+p06ZD1h6FPcQ32WtCRVodJLDR+WMn8EVHI1kvLxZuGKz/9EY5nAmI6lIQIrpo4tBy5+ug==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 postcss-modules-extract-imports@3.1.0: resolution: {integrity: sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==} @@ -9680,77 +10227,77 @@ packages: peerDependencies: postcss: ^8.2.14 - postcss-normalize-charset@7.0.0: - resolution: {integrity: sha512-ABisNUXMeZeDNzCQxPxBCkXexvBrUHV+p7/BXOY+ulxkcjUZO0cp8ekGBwvIh2LbCwnWbyMPNJVtBSdyhM2zYQ==} + postcss-normalize-charset@7.0.1: + resolution: {integrity: sha512-sn413ofhSQHlZFae//m9FTOfkmiZ+YQXsbosqOWRiVQncU2BA3daX3n0VF3cG6rGLSFVc5Di/yns0dFfh8NFgQ==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - postcss-normalize-display-values@7.0.0: - resolution: {integrity: sha512-lnFZzNPeDf5uGMPYgGOw7v0BfB45+irSRz9gHQStdkkhiM0gTfvWkWB5BMxpn0OqgOQuZG/mRlZyJxp0EImr2Q==} + postcss-normalize-display-values@7.0.1: + resolution: {integrity: sha512-E5nnB26XjSYz/mGITm6JgiDpAbVuAkzXwLzRZtts19jHDUBFxZ0BkXAehy0uimrOjYJbocby4FVswA/5noOxrQ==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - postcss-normalize-positions@7.0.0: - resolution: {integrity: sha512-I0yt8wX529UKIGs2y/9Ybs2CelSvItfmvg/DBIjTnoUSrPxSV7Z0yZ8ShSVtKNaV/wAY+m7bgtyVQLhB00A1NQ==} + postcss-normalize-positions@7.0.1: + resolution: {integrity: sha512-pB/SzrIP2l50ZIYu+yQZyMNmnAcwyYb9R1fVWPRxm4zcUFCY2ign7rcntGFuMXDdd9L2pPNUgoODDk91PzRZuQ==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - postcss-normalize-repeat-style@7.0.0: - resolution: {integrity: sha512-o3uSGYH+2q30ieM3ppu9GTjSXIzOrRdCUn8UOMGNw7Af61bmurHTWI87hRybrP6xDHvOe5WlAj3XzN6vEO8jLw==} + postcss-normalize-repeat-style@7.0.1: + resolution: {integrity: sha512-NsSQJ8zj8TIDiF0ig44Byo3Jk9e4gNt9x2VIlJudnQQ5DhWAHJPF4Tr1ITwyHio2BUi/I6Iv0HRO7beHYOloYQ==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - postcss-normalize-string@7.0.0: - resolution: {integrity: sha512-w/qzL212DFVOpMy3UGyxrND+Kb0fvCiBBujiaONIihq7VvtC7bswjWgKQU/w4VcRyDD8gpfqUiBQ4DUOwEJ6Qg==} + postcss-normalize-string@7.0.1: + resolution: {integrity: sha512-QByrI7hAhsoze992kpbMlJSbZ8FuCEc1OT9EFbZ6HldXNpsdpZr+YXC5di3UEv0+jeZlHbZcoCADgb7a+lPmmQ==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - postcss-normalize-timing-functions@7.0.0: - resolution: {integrity: sha512-tNgw3YV0LYoRwg43N3lTe3AEWZ66W7Dh7lVEpJbHoKOuHc1sLrzMLMFjP8SNULHaykzsonUEDbKedv8C+7ej6g==} + postcss-normalize-timing-functions@7.0.1: + resolution: {integrity: sha512-bHifyuuSNdKKsnNJ0s8fmfLMlvsQwYVxIoUBnowIVl2ZAdrkYQNGVB4RxjfpvkMjipqvbz0u7feBZybkl/6NJg==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - postcss-normalize-unicode@7.0.2: - resolution: {integrity: sha512-ztisabK5C/+ZWBdYC+Y9JCkp3M9qBv/XFvDtSw0d/XwfT3UaKeW/YTm/MD/QrPNxuecia46vkfEhewjwcYFjkg==} + postcss-normalize-unicode@7.0.3: + resolution: {integrity: sha512-EcoA29LvG3F+EpOh03iqu+tJY3uYYKzArqKJHxDhUYLa2u58aqGq16K6/AOsXD9yqLN8O6y9mmePKN5cx6krOw==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - postcss-normalize-url@7.0.0: - resolution: {integrity: sha512-+d7+PpE+jyPX1hDQZYG+NaFD+Nd2ris6r8fPTBAjE8z/U41n/bib3vze8x7rKs5H1uEw5ppe9IojewouHk0klQ==} + postcss-normalize-url@7.0.1: + resolution: {integrity: sha512-sUcD2cWtyK1AOL/82Fwy1aIVm/wwj5SdZkgZ3QiUzSzQQofrbq15jWJ3BA7Z+yVRwamCjJgZJN0I9IS7c6tgeQ==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - postcss-normalize-whitespace@7.0.0: - resolution: {integrity: sha512-37/toN4wwZErqohedXYqWgvcHUGlT8O/m2jVkAfAe9Bd4MzRqlBmXrJRePH0e9Wgnz2X7KymTgTOaaFizQe3AQ==} + postcss-normalize-whitespace@7.0.1: + resolution: {integrity: sha512-vsbgFHMFQrJBJKrUFJNZ2pgBeBkC2IvvoHjz1to0/0Xk7sII24T0qFOiJzG6Fu3zJoq/0yI4rKWi7WhApW+EFA==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - postcss-ordered-values@7.0.1: - resolution: {integrity: sha512-irWScWRL6nRzYmBOXReIKch75RRhNS86UPUAxXdmW/l0FcAsg0lvAXQCby/1lymxn/o0gVa6Rv/0f03eJOwHxw==} + postcss-ordered-values@7.0.2: + resolution: {integrity: sha512-AMJjt1ECBffF7CEON/Y0rekRLS6KsePU6PRP08UqYW4UGFRnTXNrByUzYK1h8AC7UWTZdQ9O3Oq9kFIhm0SFEw==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - postcss-reduce-initial@7.0.2: - resolution: {integrity: sha512-pOnu9zqQww7dEKf62Nuju6JgsW2V0KRNBHxeKohU+JkHd/GAH5uvoObqFLqkeB2n20mr6yrlWDvo5UBU5GnkfA==} + postcss-reduce-initial@7.0.3: + resolution: {integrity: sha512-RFvkZaqiWtGMlVjlUHpaxGqEL27lgt+Q2Ixjf83CRAzqdo+TsDyGPtJUbPx2MuYIJ+sCQc2TrOvRnhcXQfgIVA==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - postcss-reduce-transforms@7.0.0: - resolution: {integrity: sha512-pnt1HKKZ07/idH8cpATX/ujMbtOGhUfE+m8gbqwJE05aTaNw8gbo34a2e3if0xc0dlu75sUOiqvwCGY3fzOHew==} + postcss-reduce-transforms@7.0.1: + resolution: {integrity: sha512-MhyEbfrm+Mlp/36hvZ9mT9DaO7dbncU0CvWI8V93LRkY6IYlu38OPg3FObnuKTUxJ4qA8HpurdQOo5CyqqO76g==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 postcss-safe-parser@6.0.0: resolution: {integrity: sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==} @@ -9772,21 +10319,27 @@ packages: resolution: {integrity: sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==} engines: {node: '>=4'} - postcss-svgo@7.0.1: - resolution: {integrity: sha512-0WBUlSL4lhD9rA5k1e5D8EN5wCEyZD6HJk0jIvRxl+FDVOMlJ7DePHYWGGVc5QRqrJ3/06FTXM0bxjmJpmTPSA==} + postcss-svgo@7.0.2: + resolution: {integrity: sha512-5Dzy66JlnRM6pkdOTF8+cGsB1fnERTE8Nc+Eed++fOWo1hdsBptCsbG8UuJkgtZt75bRtMJIrPeZmtfANixdFA==} engines: {node: ^18.12.0 || ^20.9.0 || >= 18} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 - postcss-unique-selectors@7.0.3: - resolution: {integrity: sha512-J+58u5Ic5T1QjP/LDV9g3Cx4CNOgB5vz+kM6+OxHHhFACdcDeKhBXjQmB7fnIZM12YSTvsL0Opwco83DmacW2g==} + postcss-unique-selectors@7.0.4: + resolution: {integrity: sha512-pmlZjsmEAG7cHd7uK3ZiNSW6otSZ13RHuZ/4cDN/bVglS5EpF2r2oxY99SuOHa8m7AWoBCelTS3JPpzsIs8skQ==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 postcss-value-parser@4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} + postcss-values-parser@6.0.2: + resolution: {integrity: sha512-YLJpK0N1brcNJrs9WatuJFtHaV9q5aAOj+S4DI5S7jgHlRfm0PIbDCAFRYMQD5SHq7Fy6xsDhyutgS0QOAs0qw==} + engines: {node: '>=10'} + peerDependencies: + postcss: ^8.2.9 + postcss@8.4.31: resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} engines: {node: ^10 || ^12 || >=14} @@ -9799,12 +10352,17 @@ packages: resolution: {integrity: sha512-MjOadfU3Ys9KYoX0AdkBlFEF1Vx37uCCeN4ZHnmwm9FfpbsGWMZeBLMmmpY+6Ocqod7mkdZ0DT31OlbsFrLlkA==} engines: {node: ^10 || ^12 || >=14} - postcss@8.5.4: - resolution: {integrity: sha512-QSa9EBe+uwlGTFmHsPKokv3B/oEMQZxfqW0QqNCyhpa6mB1afzulwn8hihglqAb2pOw+BJgNlmXQ8la2VeHB7w==} + postcss@8.5.3: + resolution: {integrity: sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==} engines: {node: ^10 || ^12 || >=14} - preact@10.26.4: - resolution: {integrity: sha512-KJhO7LBFTjP71d83trW+Ilnjbo+ySsaAgCfXOXUlmGzJ4ygYPWmysm77yg4emwfmoz3b22yvH5IsVFHbhUaH5w==} + preact@10.26.6: + resolution: {integrity: sha512-5SRRBinwpwkaD+OqlBDeITlRgvd8I8QlxHJw9AxSdMNV6O+LodN9nUyYGpSF7sadHjs6RzeFShMexC6DbtWr9g==} + + precinct@11.0.5: + resolution: {integrity: sha512-oHSWLC8cL/0znFhvln26D14KfCQFFn4KOLSw6hmLhd+LQ2SKt9Ljm89but76Pc7flM9Ty1TnXyrA2u16MfRV3w==} + engines: {node: ^14.14.0 || >=16.0.0} + hasBin: true prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} @@ -9834,6 +10392,10 @@ packages: resolution: {integrity: sha512-mQUvGU6aUFQ+rNvTIAcZuWGRT9a6f6Yrg9bHs4ImKF+HZCEK+plBvnAZYSIQztknZF2qnzNtr6F8s0+IuptdlQ==} engines: {node: ^14.13.1 || >=16.0.0} + pretty-format@29.7.0: + resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + pretty-ms@9.2.0: resolution: {integrity: sha512-4yf0QO/sllf/1zbZWYnvWw3NxCQwLXKzIj0G849LSufP15BXKM0rbD2Z3wVnkMfjdn/CB0Dpp444gYAACdsplg==} engines: {node: '>=18'} @@ -9867,8 +10429,8 @@ packages: prop-types@15.8.1: resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} - property-information@7.0.0: - resolution: {integrity: sha512-7D/qOz/+Y4X/rzSB6jKxKUsQnphO046ei8qxG59mtM3RG3DHgTK81HrxrmoDVINJb8NKT5ZsRbwHvQ6B68Iyhg==} + property-information@7.1.0: + resolution: {integrity: sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ==} proto-list@1.2.4: resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} @@ -9896,8 +10458,8 @@ packages: psl@1.15.0: resolution: {integrity: sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==} - pump@3.0.3: - resolution: {integrity: sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==} + pump@3.0.2: + resolution: {integrity: sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==} punycode@1.4.1: resolution: {integrity: sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==} @@ -9923,8 +10485,12 @@ packages: resolution: {integrity: sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==} engines: {node: '>=0.6'} - quansync@0.2.8: - resolution: {integrity: sha512-4+saucphJMazjt7iOM27mbFCk+D9dd/zmgMDCzRZ8MEoBfYp7lAvoN38et/phRQF6wOPMy/OROBGgoWeSKyluA==} + qs@6.14.0: + resolution: {integrity: sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==} + engines: {node: '>=0.6'} + + quansync@0.2.10: + resolution: {integrity: sha512-t41VRkMYbkHyCYmOvx/6URnN80H7k4X0lLdBMGsz+maAwrJQYB1djpV6vHrQIBE0WBSGqhtEHrK9U3DWWH8v7A==} querystringify@2.2.0: resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==} @@ -9935,6 +10501,9 @@ packages: quick-format-unescaped@4.0.4: resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==} + quote-unquote@1.0.0: + resolution: {integrity: sha512-twwRO/ilhlG/FIgYeKGFqyHhoEhqgnKVkcmqMKi2r524gz3ZbDTcyFt38E9xjJI2vT+KbRNHVbnJ/e0I25Azwg==} + radix3@1.1.2: resolution: {integrity: sha512-b484I/7b8rDEdSDKckSSBA8knMpcdsXudlE/LNL639wFoHKwLbEkQFZHWEYwDC0wa0FKUcCY+GAF73Z7wxNVFA==} @@ -9952,6 +10521,10 @@ packages: rc9@2.1.2: resolution: {integrity: sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==} + rc@1.2.8: + resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} + hasBin: true + react-dom@19.0.0: resolution: {integrity: sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ==} peerDependencies: @@ -9960,6 +10533,9 @@ packages: react-is@16.13.1: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} + react-is@18.3.1: + resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} + react-refresh@0.14.2: resolution: {integrity: sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==} engines: {node: '>=0.10.0'} @@ -10005,6 +10581,14 @@ packages: resolution: {integrity: sha512-0J+Msgym3vrLOUB3hzQCuZHII0xkNGCtz/HJH9xZshwv9DbDwkw1KaE3gx/e2J5rpEY5rtOy6cyhKOPrkP7FZw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + read-package-up@11.0.0: + resolution: {integrity: sha512-MbgfoNPANMdb4oRBNg5eqLbB2t2r+o5Ua1pNt8BqGp4I0FJZhuVSOj3PaBPni4azWuSzEdNn2evevzVmEk1ohQ==} + engines: {node: '>=18'} + + read-pkg@9.0.1: + resolution: {integrity: sha512-9viLL4/n1BJUCT1NXVTdS1jtm80yDEgR5T4yCelII49Mbj0v1rZdKqj7zCiYdbB0CuCgdrvHcNogAKTFPBocFA==} + engines: {node: '>=18'} + read-yaml-file@1.1.0: resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==} engines: {node: '>=6'} @@ -10060,9 +10644,6 @@ packages: regenerator-runtime@0.14.1: resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} - regenerator-transform@0.15.2: - resolution: {integrity: sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==} - regex-parser@2.3.1: resolution: {integrity: sha512-yXLRqatcCuKtVHsWrNg0JL3l1zGfdXeEvDa0bdu4tCDQw0RpMDZsqbkyRTUnKMR0tXF627V2oEWjBEaEdqTwtQ==} @@ -10087,6 +10668,14 @@ packages: resolution: {integrity: sha512-H66BPQMrv+V16t8xtmq+UC0CBpiTBA60V8ibS1QVReIp8T1z8hwFxqcGzm9K6lgsN7sB5edVH8a+ze6Fqm4weA==} engines: {node: '>=4'} + registry-auth-token@5.1.0: + resolution: {integrity: sha512-GdekYuwLXLxMuFTwAPg5UKGLW/UXzQrZvH/Zj791BQif5T05T0RsaLfHc9q3ZOKi7n+BoprPD9mJ0O0k4xzUlw==} + engines: {node: '>=14'} + + registry-url@6.0.1: + resolution: {integrity: sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==} + engines: {node: '>=12'} + regjsgen@0.8.0: resolution: {integrity: sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q==} @@ -10097,6 +10686,9 @@ packages: remove-accents@0.5.0: resolution: {integrity: sha512-8g3/Otx1eJaVD12e31UbJj1YzdtVvzH85HV7t+9MJYk/u3XmkOUJ5Ys9wQrf9PCPK8+xn4ymzqYCiZl6QWKn+A==} + remove-trailing-separator@1.1.0: + resolution: {integrity: sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw==} + require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} @@ -10105,6 +10697,9 @@ packages: resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} engines: {node: '>=0.10.0'} + require-package-name@2.0.1: + resolution: {integrity: sha512-uuoJ1hU/k6M0779t3VMVIYpb2VMJk05cehCaABFhXaibcbvfgR8wKiozLjVFSzJPmQMRqIcO0HMyTFqfV09V6Q==} + requireindex@1.2.0: resolution: {integrity: sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==} engines: {node: '>=0.10.5'} @@ -10127,6 +10722,10 @@ packages: resolution: {integrity: sha512-uZtduh8/8srhBoMx//5bwqjQ+rfYOUq8zC9NrMUGtjBiGTtFJM42s58/36+hTqeqINcnYe08Nj3LkK9lW4N8Xg==} engines: {node: '>=12'} + resolve.exports@2.0.3: + resolution: {integrity: sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==} + engines: {node: '>=10'} + resolve@1.22.10: resolution: {integrity: sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==} engines: {node: '>= 0.4'} @@ -10168,10 +10767,6 @@ packages: deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true - rimraf@5.0.10: - resolution: {integrity: sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==} - hasBin: true - rollup-plugin-dts@6.1.1: resolution: {integrity: sha512-aSHRcJ6KG2IHIioYlvAOcEq6U99sVtqDDKVhnwt70rW6tsz3tv5OSjEiWcgzfsHdLyGXZ/3b/7b/+Za3Y6r1XA==} engines: {node: '>=16'} @@ -10207,13 +10802,8 @@ packages: engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true - rollup@4.39.0: - resolution: {integrity: sha512-thI8kNc02yNvnmJp8dr3fNWJ9tCONDhp6TV35X6HkKGGs9E6q7YWCHbe5vKiTa7TAiNcFEmXKj3X/pG2b3ci0g==} - engines: {node: '>=18.0.0', npm: '>=8.0.0'} - hasBin: true - - rollup@4.41.1: - resolution: {integrity: sha512-cPmwD3FnFv8rKMBc1MxWCwVQFxwf1JEmSX3iQXrRVVG15zerAIXRjMFVWnd5Q5QvgKF7Aj+5ykXFhUl+QGnyOw==} + rollup@4.40.2: + resolution: {integrity: sha512-tfUOg6DTP4rhQ3VjOO6B4wyrJnGOX85requAXvqYTHsOgb2TFJdZ3aWpT8W2kPoypSGP7dZUyzxJ9ee4buM5Fg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -10298,8 +10888,8 @@ packages: scheduler@0.25.0: resolution: {integrity: sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA==} - schema-utils@4.3.0: - resolution: {integrity: sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g==} + schema-utils@4.3.2: + resolution: {integrity: sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ==} engines: {node: '>= 10.13.0'} scule@1.3.0: @@ -10345,17 +10935,21 @@ packages: resolution: {integrity: sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==} engines: {node: '>= 0.8.0'} + send@1.2.0: + resolution: {integrity: sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==} + engines: {node: '>= 18'} + serialize-javascript@6.0.2: resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} - seroval-plugins@1.3.2: - resolution: {integrity: sha512-0QvCV2lM3aj/U3YozDiVwx9zpH0q8A60CTWIv4Jszj/givcudPb48B+rkU5D51NJ0pTpweGMttHjboPa9/zoIQ==} + seroval-plugins@1.3.1: + resolution: {integrity: sha512-dOlUoiI3fgZbQIcj6By+l865pzeWdP3XCSLdI3xlKnjCk5983yLWPsXytFOUI0BUZKG9qwqbj78n9yVcVwUqaQ==} engines: {node: '>=10'} peerDependencies: seroval: ^1.0 - seroval@1.3.2: - resolution: {integrity: sha512-RbcPH1n5cfwKrru7v7+zrZvjLurgHhGyso3HTyGtRivGWgYjbOmGuivCQaORNELjNONoK35nj28EoWul9sb1zQ==} + seroval@1.3.1: + resolution: {integrity: sha512-F+T9EQPdLzgdewgxnBh4mSc+vde+EOkU6dC9BDuu/bfGb+UyUlqM6t8znFCTPQSuai/ZcfFg0gu79h+bVW2O0w==} engines: {node: '>=10'} serve-index@1.9.1: @@ -10369,6 +10963,13 @@ packages: resolution: {integrity: sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==} engines: {node: '>= 0.8.0'} + serve-static@2.2.0: + resolution: {integrity: sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==} + engines: {node: '>= 18'} + + set-blocking@2.0.0: + resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} + set-cookie-parser@2.7.1: resolution: {integrity: sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==} @@ -10517,8 +11118,8 @@ packages: resolution: {integrity: sha512-D3YaD0aRxR3mEcqnidIs7ReYJFVzWdd6fXJYUM8ixcQcJRGTka/b3saV0KflYhyVJXKhb947GndU35SxYNResQ==} engines: {node: '>= 10.0.0', npm: '>= 3.0.0'} - solid-js@1.9.7: - resolution: {integrity: sha512-/saTKi8iWEM233n5OSi1YHCCuh66ZIQ7aK2hsToPe4tqGm7qAejU1SwNuTPivbWAYq7SjuHVVYxxuZQNRbICiw==} + solid-js@1.9.6: + resolution: {integrity: sha512-PoasAJvLk60hRtOTe9ulvALOdLjjqxuxcGZRolBQqxOnXrBXHGzqMT4ijNhGsDAYdOgEa8ZYaAE94PSldrFSkA==} sonic-boom@4.2.0: resolution: {integrity: sha512-INb7TM37/mAcsGmc9hyyI6+QR3rR1zVRu36B0NeGXKnOOLiZOfER5SA+N7X7k3yUYRzLWafduTDvJAfDswwEww==} @@ -10594,8 +11195,11 @@ packages: resolution: {integrity: sha512-S7iGNosepx9RadX82oimUkvr0Ct7IjJbEbs4mJcTxst8um95J3sDYU1RBEOvdu6oL1Wek2ODI5i4MAw+dZ6cAQ==} engines: {node: ^18.17.0 || >=20.5.0} - stable-hash@0.0.4: - resolution: {integrity: sha512-LjdcbuBeLcdETCrPn9i8AYAZ1eCtu4ECAWtP7UleOiZ9LzVxRzzUZEoZ8zB24nhkQnDWyET0I+3sWokSDS3E7g==} + stable-hash@0.0.5: + resolution: {integrity: sha512-+L3ccpzibovGXFK+Ap/f8LOS0ahMrHTf3xu7mMLSpEGU0EO9ucaysSylKo9eRDFNhWve/y275iPmIZ4z39a9iA==} + + stack-trace@0.0.10: + resolution: {integrity: sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==} stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} @@ -10611,8 +11215,8 @@ packages: resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} engines: {node: '>= 0.8'} - std-env@3.8.1: - resolution: {integrity: sha512-vj5lIj3Mwf9D79hBkltk5qmkFI+biIKWS2IBxEyEU3AX1tUf7AoL8nSazCOiiqQsGKIq01SClsKEzweu34uwvA==} + std-env@3.9.0: + resolution: {integrity: sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==} streamroller@3.1.5: resolution: {integrity: sha512-KFxaM7XT+irxvdqSP1LGLgNWbYN7ay5owZ3r/8t77p+EtSUAfUgtl7be3xtqtOmGUl9K9YPO2ca8133RlTjvKw==} @@ -10693,6 +11297,10 @@ packages: resolution: {integrity: sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==} engines: {node: '>=18'} + strip-json-comments@2.0.1: + resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} + engines: {node: '>=0.10.0'} + strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} @@ -10716,11 +11324,11 @@ packages: babel-plugin-macros: optional: true - stylehacks@7.0.4: - resolution: {integrity: sha512-i4zfNrGMt9SB4xRK9L83rlsFCgdGANfeDAYacO1pkqcE7cRHPdWHwnKZVz7WY17Veq/FvyYsRAU++Ga+qDFIww==} + stylehacks@7.0.5: + resolution: {integrity: sha512-5kNb7V37BNf0Q3w+1pxfa+oiNPS++/b4Jil9e/kPDgrk1zjEd6uR7SZeJiYaLYH6RRSC1XX2/37OTeU/4FvuIA==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: - postcss: ^8.4.31 + postcss: ^8.4.32 sucrase@3.35.0: resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==} @@ -10743,10 +11351,6 @@ packages: resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} engines: {node: '>=10'} - supports-color@9.4.0: - resolution: {integrity: sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==} - engines: {node: '>=12'} - supports-hyperlinks@3.2.0: resolution: {integrity: sha512-zFObLMyZeEwzAoKCyu1B91U79K2t7ApXuQfo8OuxwXLDgcKxuwM+YvcbIhm6QWqz7mHUH1TVytR1PwVVjEuMig==} engines: {node: '>=14.18'} @@ -10781,6 +11385,10 @@ packages: engines: {node: '>=14.0.0'} hasBin: true + swagger-parser@10.0.3: + resolution: {integrity: sha512-nF7oMeL4KypldrQhac8RyHerJeGPD1p2xDh900GPvc+Nk7nWP6jX2FcC7WmkinMoAmoO774+AFXcWsW8gMWEIg==} + engines: {node: '>=10'} + symbol-observable@4.0.0: resolution: {integrity: sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==} engines: {node: '>=0.10'} @@ -10788,8 +11396,8 @@ packages: symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} - synckit@0.9.2: - resolution: {integrity: sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==} + synckit@0.11.5: + resolution: {integrity: sha512-frqvfWyDA5VPVdrWfH24uM6SI/O8NLpVbIIJxb8t/a3YGsp4AW9CYgSKC0OaSEfexnp7Y1pVh2Y6IHO8ggGDmA==} engines: {node: ^14.18.0 || >=16.0.0} system-architecture@0.1.0: @@ -10811,6 +11419,10 @@ packages: tar-fs@3.0.5: resolution: {integrity: sha512-JOgGAmZyMgbqpLwct7ZV8VzkEB6pxXFBVErLtb+XCOqzc6w1xiWKI9GVd6bwk68EX7eJ4DWmfXVmq8K2ziZTGg==} + tar-stream@2.2.0: + resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==} + engines: {node: '>=6'} + tar-stream@3.1.7: resolution: {integrity: sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==} @@ -10847,6 +11459,11 @@ packages: engines: {node: '>=10'} hasBin: true + terser@5.39.1: + resolution: {integrity: sha512-Mm6+uad0ZuDtcV8/4uOZQDQ8RuiC5Pu+iZRedJtF7yA/27sPL7d++In/AJKpWZlU3SYMPPkVfwetn6sgZ66pUA==} + engines: {node: '>=10'} + hasBin: true + test-exclude@7.0.1: resolution: {integrity: sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==} engines: {node: '>=18'} @@ -10854,6 +11471,9 @@ packages: text-decoder@1.2.3: resolution: {integrity: sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==} + text-hex@1.0.0: + resolution: {integrity: sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==} + thenify-all@1.6.0: resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} engines: {node: '>=0.8'} @@ -10889,8 +11509,8 @@ packages: resolution: {integrity: sha512-Zc+8eJlFMvgatPZTl6A9L/yht8QqdmUNtURHaKZLmKBE12hNPSrqNkUp2cs3M/UKmNVVAMFQYSjYIVHDjW5zew==} engines: {node: '>=12.0.0'} - tinyglobby@0.2.12: - resolution: {integrity: sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==} + tinyglobby@0.2.13: + resolution: {integrity: sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==} engines: {node: '>=12.0.0'} tinypool@1.0.2: @@ -10905,6 +11525,9 @@ packages: resolution: {integrity: sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==} engines: {node: '>=14.0.0'} + tmp-promise@3.0.3: + resolution: {integrity: sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==} + tmp@0.0.33: resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} engines: {node: '>=0.6.0'} @@ -10925,6 +11548,9 @@ packages: resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} engines: {node: '>=0.6'} + toml@3.0.0: + resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} + totalist@3.0.1: resolution: {integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==} engines: {node: '>=6'} @@ -10939,8 +11565,8 @@ packages: tr46@1.0.1: resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} - tr46@5.0.0: - resolution: {integrity: sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==} + tr46@5.1.1: + resolution: {integrity: sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==} engines: {node: '>=18'} tree-dump@1.0.2: @@ -10956,8 +11582,12 @@ packages: trim-lines@3.0.1: resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==} - ts-api-utils@2.0.1: - resolution: {integrity: sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==} + triple-beam@1.4.1: + resolution: {integrity: sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==} + engines: {node: '>= 14.0.0'} + + ts-api-utils@2.1.0: + resolution: {integrity: sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==} engines: {node: '>=18.12'} peerDependencies: typescript: '>=4.8.4' @@ -10992,6 +11622,10 @@ packages: tsconfig-paths@3.15.0: resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} + tsconfig-paths@4.2.0: + resolution: {integrity: sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==} + engines: {node: '>=6'} + tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} @@ -11073,8 +11707,8 @@ packages: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} engines: {node: '>=10'} - type-fest@4.37.0: - resolution: {integrity: sha512-S/5/0kFftkq27FPNye0XM1e2NsnoD/3FS+pBmbjmmtLT6I+i344KoOf7pvXreaFsDamWeaJX55nczA1m5PsBDg==} + type-fest@4.41.0: + resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} engines: {node: '>=16'} type-is@1.6.18: @@ -11124,16 +11758,16 @@ packages: resolution: {integrity: sha512-us1E3K+3jJppDBa3Tl0L3MOJiGhe1C6P0+nIvQAFYbxlMAx0h81eOwLmU57xgqToduDDPx3y5QsdjPfDu+FgOQ==} hasBin: true - ufo@1.5.4: - resolution: {integrity: sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==} + ufo@1.6.1: + resolution: {integrity: sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==} uglify-js@3.19.3: resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==} engines: {node: '>=0.8.0'} hasBin: true - ultrahtml@1.5.3: - resolution: {integrity: sha512-GykOvZwgDWZlTQMtp5jrD4BVL+gNn2NVlVafjcFUJ7taY20tqYdwdoWBFy6GBJsNTZe1GkGPkSl5knQAjtgceg==} + ultrahtml@1.6.0: + resolution: {integrity: sha512-R9fBn90VTJrqqLDwyMph+HGne8eqY1iPfYhPzZrvKpIfwkWZbcYlfpsb8B9dTvBfpy1/hqAD7Wi8EKfP9e8zdw==} unbox-primitive@1.1.0: resolution: {integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==} @@ -11163,8 +11797,8 @@ packages: unenv@1.10.0: resolution: {integrity: sha512-wY5bskBQFL9n3Eca5XnhH6KbUo/tfvkwm9OpcdCvLaeA7piBNbavbOKJySEwQ1V0RH6HvNlSAFRTpvTqgKRQXQ==} - unenv@2.0.0-rc.14: - resolution: {integrity: sha512-od496pShMen7nOy5VmVJCnq8rptd45vh6Nx/r2iPbrba6pa6p+tS2ywuIHRZ/OBvSbQZB0kWvpO9XBNVFXHD3Q==} + unenv@2.0.0-rc.17: + resolution: {integrity: sha512-B06u0wXkEd+o5gOCMl/ZHl5cfpYbDZKAT+HWTL+Hws6jWu7dCiqBBXXXzMFcFVJb8D4ytAnYmxJA83uwOQRSsg==} unhead@1.11.20: resolution: {integrity: sha512-3AsNQC0pjwlLqEYHLjtichGWankK8yqmocReITecmpB1H0aOabeESueyy+8X1gyJx4ftZVwo9hqQ4O3fPWffCA==} @@ -11189,6 +11823,10 @@ packages: resolution: {integrity: sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==} engines: {node: '>=4'} + unicorn-magic@0.1.0: + resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} + engines: {node: '>=18'} + unicorn-magic@0.3.0: resolution: {integrity: sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==} engines: {node: '>=18'} @@ -11196,14 +11834,14 @@ packages: unimport@3.14.6: resolution: {integrity: sha512-CYvbDaTT04Rh8bmD8jz3WPmHYZRG/NnvYVzwD6V1YAlvvKROlAeNDUBhkBGzNav2RKaeuXvlWYaa1V4Lfi/O0g==} - unimport@4.1.2: - resolution: {integrity: sha512-oVUL7PSlyVV3QRhsdcyYEMaDX8HJyS/CnUonEJTYA3//bWO+o/4gG8F7auGWWWkrrxBQBYOO8DKe+C53ktpRXw==} - engines: {node: '>=18.12.0'} - unimport@4.2.0: resolution: {integrity: sha512-mYVtA0nmzrysnYnyb3ALMbByJ+Maosee2+WyE0puXl+Xm2bUwPorPaaeZt0ETfuroPOtG8jj1g/qeFZ6buFnag==} engines: {node: '>=18.12.0'} + unimport@5.0.1: + resolution: {integrity: sha512-1YWzPj6wYhtwHE+9LxRlyqP4DiRrhGfJxdtH475im8ktyZXO3jHj/3PZ97zDdvkYoovFdi0K4SKl3a7l92v3sQ==} + engines: {node: '>=18.12.0'} + unique-filename@4.0.0: resolution: {integrity: sha512-XSnEewXmQ+veP7xX2dS5Q4yZAvO40cBN2MWkJ7D/6sW4Dg6wYBNwM1Vrnz1FhH5AdeLIlUXRI9e28z1YZi71NQ==} engines: {node: ^18.17.0 || >=20.5.0} @@ -11239,6 +11877,10 @@ packages: resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} engines: {node: '>= 10.0.0'} + unixify@1.0.0: + resolution: {integrity: sha512-6bc58dPYhCMHHuwxldQxO3RRNZ4eCogZ/st++0+fcC1nr0jiGUtAdBJ2qzmLQWSxbtz42pWt4QQMiZ9HvZf5cg==} + engines: {node: '>=0.10.0'} + unpipe@1.0.0: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} engines: {node: '>= 0.8'} @@ -11263,16 +11905,15 @@ packages: resolution: {integrity: sha512-2qzQo5LN2DmUZXkWDHvGKLF5BP0WN+KthD6aPnPJ8plRBIjv4lh5O07eYcSxgO2znNw9s4MNhEO1sB+JDllDbQ==} engines: {node: '>=18.12.0'} - unplugin@2.2.0: - resolution: {integrity: sha512-m1ekpSwuOT5hxkJeZGRxO7gXbXT3gF26NjQ7GdVHoLoF8/nopLcd/QfPigpCy7i51oFHiRJg/CyHhj4vs2+KGw==} + unplugin@2.3.4: + resolution: {integrity: sha512-m4PjxTurwpWfpMomp8AptjD5yj8qEZN5uQjjGM3TAs9MWWD2tXSSNNj6jGR2FoVGod4293ytyV6SwBbertfyJg==} engines: {node: '>=18.12.0'} - unplugin@2.3.2: - resolution: {integrity: sha512-3n7YA46rROb3zSj8fFxtxC/PqoyvYQ0llwz9wtUPUutr9ig09C8gGo5CWCwHrUzlqC1LLR43kxp5vEIyH1ac1w==} - engines: {node: '>=18.12.0'} + unrs-resolver@1.7.2: + resolution: {integrity: sha512-BBKpaylOW8KbHsu378Zky/dGh4ckT/4NW/0SHRABdqRLcQJ2dAOjDo9g97p04sWflm0kqPqpUatxReNV/dqI5A==} - unstorage@1.15.0: - resolution: {integrity: sha512-m40eHdGY/gA6xAPqo8eaxqXgBuzQTlAKfmB1iF7oCKXE1HfwHwzDJBywK+qQGn52dta+bPlZluPF7++yR3p/bg==} + unstorage@1.16.0: + resolution: {integrity: sha512-WQ37/H5A7LcRPWfYOrDa1Ys02xAbpPJq6q5GkO88FBXVSQzHd7+BjEwfRqyaSWCv9MbsJy058GWjjPjcJ16GGA==} peerDependencies: '@azure/app-configuration': ^1.8.0 '@azure/cosmos': ^4.2.0 @@ -11280,7 +11921,7 @@ packages: '@azure/identity': ^4.6.0 '@azure/keyvault-secrets': ^4.9.0 '@azure/storage-blob': ^12.26.0 - '@capacitor/preferences': ^6.0.3 + '@capacitor/preferences': ^6.0.3 || ^7.0.0 '@deno/kv': '>=0.9.0' '@netlify/blobs': ^6.5.0 || ^7.0.0 || ^8.1.0 '@planetscale/database': ^1.19.0 @@ -11354,9 +11995,6 @@ packages: uqr@0.1.2: resolution: {integrity: sha512-MJu7ypHq6QasgF5YRTjqscSzQp/W11zoUk6kvmlH+fmWEs63Y0Eib13hYFwAzagRJcVY8WVnlV+eBDUGMJ5IbA==} - uri-js-replace@1.0.1: - resolution: {integrity: sha512-W+C9NWNLFOoBI2QWDp4UT9pv65r2w5Cx+3sTYFvtMdDBxkKt1syCqsUdSFAChbEe1uK5TfS04wt/nGwmaeIQ0g==} - uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} @@ -11366,6 +12004,9 @@ packages: urlpattern-polyfill@10.0.0: resolution: {integrity: sha512-H/A06tKD7sS1O1X2SshBVeA5FLycRpjqiBeqGKmBwBDBy28EnRjORxTNe269KSSr5un5qyWi1iL61wLxpd+ZOg==} + urlpattern-polyfill@10.1.0: + resolution: {integrity: sha512-IGjKp/o0NL3Bso1PymYURCJxMPNAf/ILOpendP9f5B6e1rTJgdgiOvgfoT8VxCAdY+Wisb9uhGaJJf3yZ2V9nw==} + urlpattern-polyfill@8.0.2: resolution: {integrity: sha512-Qp95D4TPJl1kC9SKigDcqgyM2VDVO4RiJc2d4qe5GrYm+zbIQCWWKAFaJNQ4BhdFeDGwBmAxqJBwWSJDb9T3BQ==} @@ -11389,6 +12030,11 @@ packages: '@types/react': optional: true + use-sync-external-store@1.5.0: + resolution: {integrity: sha512-Rb46I4cGGVBmjamjphe8L/UnvJD+uPPtTkNvX5mZgqdbavhI4EbgIWJiIHXJ8bc/i9EQGPRh4DwEURJ552Do0A==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} @@ -11396,6 +12042,10 @@ packages: resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} engines: {node: '>= 0.4.0'} + uuid@11.1.0: + resolution: {integrity: sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==} + hasBin: true + uuid@8.3.2: resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} hasBin: true @@ -11422,10 +12072,18 @@ packages: resolution: {integrity: sha512-d7KLgL1LD3U3fgnvWEY1cQXoO/q6EQ1BSz48Sa149V/5zVTAbgmZIpyI8TRi6U9/JNyeYLlTKsEMPtLC27RFUg==} engines: {node: ^18.17.0 || >=20.5.0} + validator@13.15.15: + resolution: {integrity: sha512-BgWVbCI72aIQy937xbawcs+hrVaN/CZ2UwutgaJ36hGqRrLNM+f5LUT/YPRbo8IV/ASeFzXszezV+y2+rq3l8A==} + engines: {node: '>= 0.10'} + vary@1.1.2: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} + verror@1.10.1: + resolution: {integrity: sha512-veufcmxri4e3XSrT0xwfUR7kguIkaxBeosDg00yDWhk49wdwkSUrvvsm7nc75e1PUyvIeZj6nS8VQRYz2/S4Xg==} + engines: {node: '>=0.6.0'} + vfile-message@4.0.2: resolution: {integrity: sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==} @@ -11437,6 +12095,11 @@ packages: peerDependencies: vite: ^2.6.0 || ^3.0.0 || ^4.0.0 || ^5.0.0-0 || ^6.0.0-0 + vite-hot-client@2.0.4: + resolution: {integrity: sha512-W9LOGAyGMrbGArYJN4LBCdOC5+Zwh7dHvOHC0KmGKkJhsOzaKbpo/jEjpPKVHIW0/jBWj8RZG0NUxfgA8BxgAg==} + peerDependencies: + vite: ^2.6.0 || ^3.0.0 || ^4.0.0 || ^5.0.0-0 || ^6.0.0-0 + vite-node@2.1.9: resolution: {integrity: sha512-AM9aQ/IPrW/6ENLQg3AGY4K1N2TGZdR5e4gu/MmmR2xR3Ll1+dib+nook92g4TV3PXVyeyxdWwtaCAiUL0hMxA==} engines: {node: ^18.0.0 || >=20.0.0} @@ -11502,37 +12165,6 @@ packages: peerDependencies: vite: ^3.0.0-0 || ^4.0.0-0 || ^5.0.0-0 || ^6.0.0-0 - vite@5.4.14: - resolution: {integrity: sha512-EK5cY7Q1D8JNhSaPKVK4pwBFvaTmZxEnoKXLG/U9gmdDcihQGNzFlgIvaxezFR4glP1LsuiedwMBqCXH3wZccA==} - engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true - peerDependencies: - '@types/node': ^18.0.0 || >=20.0.0 - less: '*' - lightningcss: ^1.21.0 - sass: '*' - sass-embedded: '*' - stylus: '*' - sugarss: '*' - terser: ^5.4.0 - peerDependenciesMeta: - '@types/node': - optional: true - less: - optional: true - lightningcss: - optional: true - sass: - optional: true - sass-embedded: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - vite@5.4.19: resolution: {integrity: sha512-qO3aKv3HoQC8QKiNSTuUM1l9o/XX3+c+VTgLHbJWHZGeTPVAg2XwazI9UWzoxjIJCGCV2zU60uqMzjeLZuULqA==} engines: {node: ^18.0.0 || >=20.0.0} @@ -11726,8 +12358,8 @@ packages: vue-bundle-renderer@2.1.1: resolution: {integrity: sha512-+qALLI5cQncuetYOXp4yScwYvqh8c6SMXee3B+M7oTZxOgtESP0l4j/fXdEJoZ+EdMxkGWIj+aSEyjXkOdmd7g==} - vue-component-type-helpers@2.2.8: - resolution: {integrity: sha512-4bjIsC284coDO9om4HPA62M7wfsTvcmZyzdfR0aUlFXqq4tXxM1APyXpNVxPC8QazKw9OhmZNHBVDA6ODaZsrA==} + vue-component-type-helpers@2.2.10: + resolution: {integrity: sha512-iDUO7uQK+Sab2tYuiP9D1oLujCWlhHELHMgV/cB13cuGbG4qwkLHvtfWb6FzvxrIOPDnU0oHsz2MlQjhYDeaHA==} vue-demi@0.14.10: resolution: {integrity: sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==} @@ -11873,8 +12505,8 @@ packages: resolution: {integrity: sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==} engines: {node: '>=18'} - whatwg-url@14.1.1: - resolution: {integrity: sha512-mDGf9diDad/giZ/Sm9Xi2YcyzaFpbdLpJPr+E9fSkyQ7KpQD4SdFcugkRQYzhmfI4KeV4Qpnn2sKPdo+kmsgRQ==} + whatwg-url@14.2.0: + resolution: {integrity: sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==} engines: {node: '>=18'} whatwg-url@5.0.0: @@ -11923,9 +12555,20 @@ packages: engines: {node: '>=8'} hasBin: true + wide-align@1.1.5: + resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} + wildcard@2.0.1: resolution: {integrity: sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==} + winston-transport@4.9.0: + resolution: {integrity: sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==} + engines: {node: '>= 12.0.0'} + + winston@3.17.0: + resolution: {integrity: sha512-DLiFIXYC5fMPxaRg832S6F5mJYvePtmO5G9v9IgUFPhXm9/GkXarH/TUrBAVzhTCzAj9anE/+GjrgXp/54nOgw==} + engines: {node: '>= 12.0.0'} + word-wrap@1.2.5: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} @@ -11952,6 +12595,10 @@ packages: wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + write-file-atomic@6.0.0: + resolution: {integrity: sha512-GmqrO8WJ1NuzJ2DrziEI2o57jKAVIQNf8a18W3nCYU3H7PNWqCCVTeH6/NQE93CIllIgQS98rrmVkYgTX9fFJQ==} + engines: {node: ^18.17.0 || >=20.5.0} + ws@8.17.1: resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==} engines: {node: '>=10.0.0'} @@ -11964,8 +12611,8 @@ packages: utf-8-validate: optional: true - ws@8.18.1: - resolution: {integrity: sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==} + ws@8.18.2: + resolution: {integrity: sha512-DMricUmwGZUVr++AEAe2uiVM7UoO9MAVZMDu05UQOaUII0lp+zOzLLU4Xqh/JvTqklB1T4uELaaPBKyjE1r4fQ==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 @@ -11976,6 +12623,11 @@ packages: utf-8-validate: optional: true + xcurl@2.1.2: + resolution: {integrity: sha512-y3IKd4a+kuUUUZUwSLmpKBZWcZeCpOOYc9r2ROBuhv4DYWiusExuVCcaouPXXlOFpLJLf4qH64/JjqW0PbJtdg==} + engines: {node: '>=18.0.0'} + hasBin: true + xml-name-validator@4.0.0: resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==} engines: {node: '>=12'} @@ -12004,9 +12656,6 @@ packages: resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} engines: {node: '>=18'} - yaml-ast-parser@0.0.43: - resolution: {integrity: sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A==} - yaml@1.10.2: resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} engines: {node: '>= 6'} @@ -12048,8 +12697,8 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - yocto-queue@1.2.0: - resolution: {integrity: sha512-KHBC7z61OJeaMGnF3wqNZj+GGNXOyypZviiKpQeiHirG5Ib1ImwcLBH70rbMSkKfSmUNBsdf2PwaEJtKvgmkNw==} + yocto-queue@1.2.1: + resolution: {integrity: sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg==} engines: {node: '>=12.20'} yoctocolors-cjs@2.1.2: @@ -12064,16 +12713,25 @@ packages: resolution: {integrity: sha512-fusrlIMLeRvTFYLUjJ9KzlGC3N+6MOPJ68HNj/yJv2nz7zq8t4HEviLms2gkdRPUS7F5rZ5n+pYx9r88m6IE1g==} engines: {node: '>=18'} - youch@4.1.0-beta.6: - resolution: {integrity: sha512-y1aNsEeoLXnWb6pI9TvfNPIxySyo4Un3OGxKn7rsNj8+tgSquzXEWkzfA5y6gU0fvzmQgvx3JBn/p51qQ8Xg9A==} + youch@4.1.0-beta.7: + resolution: {integrity: sha512-HUn0M24AUTMvjdkoMtH8fJz2FEd+k1xvtR9EoTrDUoVUi6o7xl5X+pST/vjk4T3GEQo2mJ9FlAvhWBm8dIdD4g==} engines: {node: '>=18'} + z-schema@5.0.5: + resolution: {integrity: sha512-D7eujBWkLa3p2sIpJA0d1pr7es+a7m0vFAnZLlCEKq/Ij2k0MLi9Br2UPxoxdYystm5K1yeBGzub0FlYUEWj2Q==} + engines: {node: '>=8.0.0'} + hasBin: true + zhead@2.2.4: resolution: {integrity: sha512-8F0OI5dpWIA5IGG5NHUg9staDwz/ZPxZtvGVf01j7vHqSyZ0raHY+78atOVxRqb73AotX22uV1pXt3gYSstGag==} zimmerframe@1.1.2: resolution: {integrity: sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==} + zip-stream@4.1.1: + resolution: {integrity: sha512-9qv4rlDiopXg4E69k+vMHjNN63YFMe9sZMrdlvKnCjlCRWeCBswPPMPUfx+ipsAWq1LXHe70RcbaHdJJpS6hyQ==} + engines: {node: '>= 10'} + zip-stream@6.0.1: resolution: {integrity: sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==} engines: {node: '>= 14'} @@ -12095,110 +12753,110 @@ packages: snapshots: - '@algolia/autocomplete-core@1.17.9(@algolia/client-search@5.21.0)(algoliasearch@5.21.0)(search-insights@2.17.3)': + '@algolia/autocomplete-core@1.17.9(@algolia/client-search@5.25.0)(algoliasearch@5.25.0)(search-insights@2.17.3)': dependencies: - '@algolia/autocomplete-plugin-algolia-insights': 1.17.9(@algolia/client-search@5.21.0)(algoliasearch@5.21.0)(search-insights@2.17.3) - '@algolia/autocomplete-shared': 1.17.9(@algolia/client-search@5.21.0)(algoliasearch@5.21.0) + '@algolia/autocomplete-plugin-algolia-insights': 1.17.9(@algolia/client-search@5.25.0)(algoliasearch@5.25.0)(search-insights@2.17.3) + '@algolia/autocomplete-shared': 1.17.9(@algolia/client-search@5.25.0)(algoliasearch@5.25.0) transitivePeerDependencies: - '@algolia/client-search' - algoliasearch - search-insights - '@algolia/autocomplete-plugin-algolia-insights@1.17.9(@algolia/client-search@5.21.0)(algoliasearch@5.21.0)(search-insights@2.17.3)': + '@algolia/autocomplete-plugin-algolia-insights@1.17.9(@algolia/client-search@5.25.0)(algoliasearch@5.25.0)(search-insights@2.17.3)': dependencies: - '@algolia/autocomplete-shared': 1.17.9(@algolia/client-search@5.21.0)(algoliasearch@5.21.0) + '@algolia/autocomplete-shared': 1.17.9(@algolia/client-search@5.25.0)(algoliasearch@5.25.0) search-insights: 2.17.3 transitivePeerDependencies: - '@algolia/client-search' - algoliasearch - '@algolia/autocomplete-preset-algolia@1.17.9(@algolia/client-search@5.21.0)(algoliasearch@5.21.0)': + '@algolia/autocomplete-preset-algolia@1.17.9(@algolia/client-search@5.25.0)(algoliasearch@5.25.0)': dependencies: - '@algolia/autocomplete-shared': 1.17.9(@algolia/client-search@5.21.0)(algoliasearch@5.21.0) - '@algolia/client-search': 5.21.0 - algoliasearch: 5.21.0 + '@algolia/autocomplete-shared': 1.17.9(@algolia/client-search@5.25.0)(algoliasearch@5.25.0) + '@algolia/client-search': 5.25.0 + algoliasearch: 5.25.0 - '@algolia/autocomplete-shared@1.17.9(@algolia/client-search@5.21.0)(algoliasearch@5.21.0)': + '@algolia/autocomplete-shared@1.17.9(@algolia/client-search@5.25.0)(algoliasearch@5.25.0)': dependencies: - '@algolia/client-search': 5.21.0 - algoliasearch: 5.21.0 + '@algolia/client-search': 5.25.0 + algoliasearch: 5.25.0 - '@algolia/client-abtesting@5.21.0': + '@algolia/client-abtesting@5.25.0': dependencies: - '@algolia/client-common': 5.21.0 - '@algolia/requester-browser-xhr': 5.21.0 - '@algolia/requester-fetch': 5.21.0 - '@algolia/requester-node-http': 5.21.0 + '@algolia/client-common': 5.25.0 + '@algolia/requester-browser-xhr': 5.25.0 + '@algolia/requester-fetch': 5.25.0 + '@algolia/requester-node-http': 5.25.0 - '@algolia/client-analytics@5.21.0': + '@algolia/client-analytics@5.25.0': dependencies: - '@algolia/client-common': 5.21.0 - '@algolia/requester-browser-xhr': 5.21.0 - '@algolia/requester-fetch': 5.21.0 - '@algolia/requester-node-http': 5.21.0 + '@algolia/client-common': 5.25.0 + '@algolia/requester-browser-xhr': 5.25.0 + '@algolia/requester-fetch': 5.25.0 + '@algolia/requester-node-http': 5.25.0 - '@algolia/client-common@5.21.0': {} + '@algolia/client-common@5.25.0': {} - '@algolia/client-insights@5.21.0': + '@algolia/client-insights@5.25.0': dependencies: - '@algolia/client-common': 5.21.0 - '@algolia/requester-browser-xhr': 5.21.0 - '@algolia/requester-fetch': 5.21.0 - '@algolia/requester-node-http': 5.21.0 + '@algolia/client-common': 5.25.0 + '@algolia/requester-browser-xhr': 5.25.0 + '@algolia/requester-fetch': 5.25.0 + '@algolia/requester-node-http': 5.25.0 - '@algolia/client-personalization@5.21.0': + '@algolia/client-personalization@5.25.0': dependencies: - '@algolia/client-common': 5.21.0 - '@algolia/requester-browser-xhr': 5.21.0 - '@algolia/requester-fetch': 5.21.0 - '@algolia/requester-node-http': 5.21.0 + '@algolia/client-common': 5.25.0 + '@algolia/requester-browser-xhr': 5.25.0 + '@algolia/requester-fetch': 5.25.0 + '@algolia/requester-node-http': 5.25.0 - '@algolia/client-query-suggestions@5.21.0': + '@algolia/client-query-suggestions@5.25.0': dependencies: - '@algolia/client-common': 5.21.0 - '@algolia/requester-browser-xhr': 5.21.0 - '@algolia/requester-fetch': 5.21.0 - '@algolia/requester-node-http': 5.21.0 + '@algolia/client-common': 5.25.0 + '@algolia/requester-browser-xhr': 5.25.0 + '@algolia/requester-fetch': 5.25.0 + '@algolia/requester-node-http': 5.25.0 - '@algolia/client-search@5.21.0': + '@algolia/client-search@5.25.0': dependencies: - '@algolia/client-common': 5.21.0 - '@algolia/requester-browser-xhr': 5.21.0 - '@algolia/requester-fetch': 5.21.0 - '@algolia/requester-node-http': 5.21.0 + '@algolia/client-common': 5.25.0 + '@algolia/requester-browser-xhr': 5.25.0 + '@algolia/requester-fetch': 5.25.0 + '@algolia/requester-node-http': 5.25.0 - '@algolia/ingestion@1.21.0': + '@algolia/ingestion@1.25.0': dependencies: - '@algolia/client-common': 5.21.0 - '@algolia/requester-browser-xhr': 5.21.0 - '@algolia/requester-fetch': 5.21.0 - '@algolia/requester-node-http': 5.21.0 + '@algolia/client-common': 5.25.0 + '@algolia/requester-browser-xhr': 5.25.0 + '@algolia/requester-fetch': 5.25.0 + '@algolia/requester-node-http': 5.25.0 - '@algolia/monitoring@1.21.0': + '@algolia/monitoring@1.25.0': dependencies: - '@algolia/client-common': 5.21.0 - '@algolia/requester-browser-xhr': 5.21.0 - '@algolia/requester-fetch': 5.21.0 - '@algolia/requester-node-http': 5.21.0 + '@algolia/client-common': 5.25.0 + '@algolia/requester-browser-xhr': 5.25.0 + '@algolia/requester-fetch': 5.25.0 + '@algolia/requester-node-http': 5.25.0 - '@algolia/recommend@5.21.0': + '@algolia/recommend@5.25.0': dependencies: - '@algolia/client-common': 5.21.0 - '@algolia/requester-browser-xhr': 5.21.0 - '@algolia/requester-fetch': 5.21.0 - '@algolia/requester-node-http': 5.21.0 + '@algolia/client-common': 5.25.0 + '@algolia/requester-browser-xhr': 5.25.0 + '@algolia/requester-fetch': 5.25.0 + '@algolia/requester-node-http': 5.25.0 - '@algolia/requester-browser-xhr@5.21.0': + '@algolia/requester-browser-xhr@5.25.0': dependencies: - '@algolia/client-common': 5.21.0 + '@algolia/client-common': 5.25.0 - '@algolia/requester-fetch@5.21.0': + '@algolia/requester-fetch@5.25.0': dependencies: - '@algolia/client-common': 5.21.0 + '@algolia/client-common': 5.25.0 - '@algolia/requester-node-http@5.21.0': + '@algolia/requester-node-http@5.25.0': dependencies: - '@algolia/client-common': 5.21.0 + '@algolia/client-common': 5.25.0 '@alloc/quick-lru@5.2.0': {} @@ -12239,7 +12897,7 @@ snapshots: ansi-colors: 4.1.3 autoprefixer: 10.4.20(postcss@8.5.2) babel-loader: 9.2.1(@babel/core@7.26.9)(webpack@5.98.0(esbuild@0.25.0)) - browserslist: 4.24.4 + browserslist: 4.24.5 copy-webpack-plugin: 12.0.2(webpack@5.98.0(esbuild@0.25.0)) css-loader: 7.1.2(webpack@5.98.0(esbuild@0.25.0)) esbuild-wasm: 0.25.0 @@ -12270,7 +12928,7 @@ snapshots: tree-kill: 1.2.2 tslib: 2.8.1 typescript: 5.8.3 - webpack: 5.98.0(esbuild@0.25.2) + webpack: 5.98.0(esbuild@0.25.4) webpack-dev-middleware: 7.4.2(webpack@5.98.0(esbuild@0.25.0)) webpack-dev-server: 5.2.0(webpack@5.98.0(esbuild@0.25.0)) webpack-merge: 6.0.1 @@ -12302,7 +12960,7 @@ snapshots: - webpack-cli - yaml - '@angular-devkit/build-angular@19.2.0(@angular/compiler-cli@19.2.0(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.8.3))(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@types/node@22.10.5)(chokidar@4.0.3)(jiti@2.4.2)(karma@6.4.4)(tailwindcss@3.4.9(ts-node@10.9.2(@types/node@22.10.5)(typescript@5.8.3)))(typescript@5.8.3)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))(yaml@2.8.0)': + '@angular-devkit/build-angular@19.2.0(@angular/compiler-cli@19.2.0(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.8.3))(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@types/node@22.10.5)(chokidar@4.0.3)(jiti@2.4.2)(karma@6.4.4)(tailwindcss@3.4.9(ts-node@10.9.2(@types/node@22.10.5)(typescript@5.8.3)))(typescript@5.8.3)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(yaml@2.8.0)': dependencies: '@ampproject/remapping': 2.3.0 '@angular-devkit/architect': 0.1902.0(chokidar@4.0.3) @@ -12321,11 +12979,11 @@ snapshots: '@babel/runtime': 7.26.9 '@discoveryjs/json-ext': 0.6.3 '@ngtools/webpack': 19.2.0(@angular/compiler-cli@19.2.0(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.8.3))(typescript@5.8.3)(webpack@5.98.0(esbuild@0.25.0)) - '@vitejs/plugin-basic-ssl': 1.2.0(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) + '@vitejs/plugin-basic-ssl': 1.2.0(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) ansi-colors: 4.1.3 autoprefixer: 10.4.20(postcss@8.5.2) babel-loader: 9.2.1(@babel/core@7.26.9)(webpack@5.98.0(esbuild@0.25.0)) - browserslist: 4.24.4 + browserslist: 4.24.5 copy-webpack-plugin: 12.0.2(webpack@5.98.0(esbuild@0.25.0)) css-loader: 7.1.2(webpack@5.98.0(esbuild@0.25.0)) esbuild-wasm: 0.25.0 @@ -12356,7 +13014,7 @@ snapshots: tree-kill: 1.2.2 tslib: 2.8.1 typescript: 5.8.3 - webpack: 5.98.0(esbuild@0.25.2) + webpack: 5.98.0(esbuild@0.25.4) webpack-dev-middleware: 7.4.2(webpack@5.98.0(esbuild@0.25.0)) webpack-dev-server: 5.2.0(webpack@5.98.0(esbuild@0.25.0)) webpack-merge: 6.0.1 @@ -12392,7 +13050,7 @@ snapshots: dependencies: '@angular-devkit/architect': 0.1902.0(chokidar@4.0.3) rxjs: 7.8.1 - webpack: 5.98.0(esbuild@0.25.2) + webpack: 5.98.0(esbuild@0.25.4) webpack-dev-server: 5.2.0(webpack@5.98.0(esbuild@0.25.0)) transitivePeerDependencies: - chokidar @@ -12436,10 +13094,10 @@ snapshots: '@inquirer/confirm': 5.1.6(@types/node@22.10.5) '@vitejs/plugin-basic-ssl': 1.2.0(vite@6.1.0(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) beasties: 0.2.0 - browserslist: 4.24.4 + browserslist: 4.24.5 esbuild: 0.25.0 fast-glob: 3.3.3 - https-proxy-agent: 7.0.6(supports-color@9.4.0) + https-proxy-agent: 7.0.6 istanbul-lib-instrument: 6.0.3 listr2: 8.2.5 magic-string: 0.30.17 @@ -12473,14 +13131,13 @@ snapshots: - tsx - yaml - '@angular/cdk@19.2.2(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1)': + '@angular/cdk@19.2.16(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1)': dependencies: '@angular/common': 19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1) '@angular/core': 19.2.0(rxjs@7.8.1)(zone.js@0.15.0) + parse5: 7.3.0 rxjs: 7.8.1 tslib: 2.8.1 - optionalDependencies: - parse5: 7.2.1 '@angular/cli@19.2.0(@types/node@22.10.5)(chokidar@4.0.3)': dependencies: @@ -12547,9 +13204,9 @@ snapshots: rxjs: 7.8.1 tslib: 2.8.1 - '@angular/material@19.2.2(@angular/cdk@19.2.2(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(@angular/forms@19.2.0(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(@angular/platform-browser@19.2.0(@angular/animations@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(rxjs@7.8.1))(@angular/platform-browser@19.2.0(@angular/animations@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(rxjs@7.8.1)': + '@angular/material@19.2.16(@angular/cdk@19.2.16(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(@angular/forms@19.2.0(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(@angular/platform-browser@19.2.0(@angular/animations@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(rxjs@7.8.1))(@angular/platform-browser@19.2.0(@angular/animations@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(rxjs@7.8.1)': dependencies: - '@angular/cdk': 19.2.2(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1) + '@angular/cdk': 19.2.16(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1) '@angular/common': 19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1) '@angular/core': 19.2.0(rxjs@7.8.1)(zone.js@0.15.0) '@angular/forms': 19.2.0(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(@angular/platform-browser@19.2.0(@angular/animations@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(rxjs@7.8.1) @@ -12583,6 +13240,34 @@ snapshots: '@antfu/utils@0.7.10': {} + '@apidevtools/json-schema-ref-parser@9.0.9': + dependencies: + '@jsdevtools/ono': 7.1.3 + '@types/json-schema': 7.0.15 + call-me-maybe: 1.0.2 + js-yaml: 4.1.0 + + '@apidevtools/json-schema-ref-parser@9.1.2': + dependencies: + '@jsdevtools/ono': 7.1.3 + '@types/json-schema': 7.0.15 + call-me-maybe: 1.0.2 + js-yaml: 4.1.0 + + '@apidevtools/openapi-schemas@2.1.0': {} + + '@apidevtools/swagger-methods@3.0.2': {} + + '@apidevtools/swagger-parser@10.0.3(openapi-types@12.1.3)': + dependencies: + '@apidevtools/json-schema-ref-parser': 9.1.2 + '@apidevtools/openapi-schemas': 2.1.0 + '@apidevtools/swagger-methods': 3.0.2 + '@jsdevtools/ono': 7.1.3 + call-me-maybe: 1.0.2 + openapi-types: 12.1.3 + z-schema: 5.0.5 + '@arethetypeswrong/cli@0.17.4': dependencies: '@arethetypeswrong/core': 0.17.4 @@ -12604,266 +13289,270 @@ snapshots: typescript: 5.6.1-rc validate-npm-package-name: 5.0.1 - '@babel/code-frame@7.26.2': + '@babel/code-frame@7.27.1': dependencies: - '@babel/helper-validator-identifier': 7.25.9 + '@babel/helper-validator-identifier': 7.27.1 js-tokens: 4.0.0 picocolors: 1.1.1 - '@babel/compat-data@7.26.8': {} + '@babel/compat-data@7.27.2': {} - '@babel/core@7.26.10': + '@babel/core@7.26.9': dependencies: '@ampproject/remapping': 2.3.0 - '@babel/code-frame': 7.26.2 - '@babel/generator': 7.26.10 - '@babel/helper-compilation-targets': 7.26.5 - '@babel/helper-module-transforms': 7.26.0(@babel/core@7.26.10) - '@babel/helpers': 7.26.10 - '@babel/parser': 7.26.10 - '@babel/template': 7.26.9 - '@babel/traverse': 7.26.10 - '@babel/types': 7.26.10 + '@babel/code-frame': 7.27.1 + '@babel/generator': 7.26.9 + '@babel/helper-compilation-targets': 7.27.2 + '@babel/helper-module-transforms': 7.27.1(@babel/core@7.26.9) + '@babel/helpers': 7.27.1 + '@babel/parser': 7.27.2 + '@babel/template': 7.27.2 + '@babel/traverse': 7.27.1 + '@babel/types': 7.27.1 convert-source-map: 2.0.0 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/core@7.26.9': + '@babel/core@7.27.1': dependencies: '@ampproject/remapping': 2.3.0 - '@babel/code-frame': 7.26.2 - '@babel/generator': 7.26.10 - '@babel/helper-compilation-targets': 7.26.5 - '@babel/helper-module-transforms': 7.26.0(@babel/core@7.26.9) - '@babel/helpers': 7.26.10 - '@babel/parser': 7.26.10 - '@babel/template': 7.26.9 - '@babel/traverse': 7.26.10 - '@babel/types': 7.26.10 + '@babel/code-frame': 7.27.1 + '@babel/generator': 7.27.1 + '@babel/helper-compilation-targets': 7.27.2 + '@babel/helper-module-transforms': 7.27.1(@babel/core@7.27.1) + '@babel/helpers': 7.27.1 + '@babel/parser': 7.27.2 + '@babel/template': 7.27.2 + '@babel/traverse': 7.27.1 + '@babel/types': 7.27.1 convert-source-map: 2.0.0 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/generator@7.26.10': + '@babel/generator@7.26.9': dependencies: - '@babel/parser': 7.26.10 - '@babel/types': 7.26.10 + '@babel/parser': 7.27.2 + '@babel/types': 7.27.1 '@jridgewell/gen-mapping': 0.3.8 '@jridgewell/trace-mapping': 0.3.25 jsesc: 3.1.0 - '@babel/generator@7.26.9': + '@babel/generator@7.27.1': dependencies: - '@babel/parser': 7.26.10 - '@babel/types': 7.26.10 + '@babel/parser': 7.27.2 + '@babel/types': 7.27.1 '@jridgewell/gen-mapping': 0.3.8 '@jridgewell/trace-mapping': 0.3.25 jsesc: 3.1.0 '@babel/helper-annotate-as-pure@7.25.9': dependencies: - '@babel/types': 7.26.10 + '@babel/types': 7.27.1 + + '@babel/helper-annotate-as-pure@7.27.1': + dependencies: + '@babel/types': 7.27.1 - '@babel/helper-compilation-targets@7.26.5': + '@babel/helper-compilation-targets@7.27.2': dependencies: - '@babel/compat-data': 7.26.8 - '@babel/helper-validator-option': 7.25.9 - browserslist: 4.24.4 + '@babel/compat-data': 7.27.2 + '@babel/helper-validator-option': 7.27.1 + browserslist: 4.24.5 lru-cache: 5.1.1 semver: 6.3.1 - '@babel/helper-create-class-features-plugin@7.26.9(@babel/core@7.26.10)': + '@babel/helper-create-class-features-plugin@7.27.1(@babel/core@7.26.9)': dependencies: - '@babel/core': 7.26.10 - '@babel/helper-annotate-as-pure': 7.25.9 - '@babel/helper-member-expression-to-functions': 7.25.9 - '@babel/helper-optimise-call-expression': 7.25.9 - '@babel/helper-replace-supers': 7.26.5(@babel/core@7.26.10) - '@babel/helper-skip-transparent-expression-wrappers': 7.25.9 - '@babel/traverse': 7.26.10 + '@babel/core': 7.26.9 + '@babel/helper-annotate-as-pure': 7.27.1 + '@babel/helper-member-expression-to-functions': 7.27.1 + '@babel/helper-optimise-call-expression': 7.27.1 + '@babel/helper-replace-supers': 7.27.1(@babel/core@7.26.9) + '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 + '@babel/traverse': 7.27.1 semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/helper-create-class-features-plugin@7.26.9(@babel/core@7.26.9)': + '@babel/helper-create-class-features-plugin@7.27.1(@babel/core@7.27.1)': dependencies: - '@babel/core': 7.26.9 - '@babel/helper-annotate-as-pure': 7.25.9 - '@babel/helper-member-expression-to-functions': 7.25.9 - '@babel/helper-optimise-call-expression': 7.25.9 - '@babel/helper-replace-supers': 7.26.5(@babel/core@7.26.9) - '@babel/helper-skip-transparent-expression-wrappers': 7.25.9 - '@babel/traverse': 7.26.10 + '@babel/core': 7.27.1 + '@babel/helper-annotate-as-pure': 7.27.1 + '@babel/helper-member-expression-to-functions': 7.27.1 + '@babel/helper-optimise-call-expression': 7.27.1 + '@babel/helper-replace-supers': 7.27.1(@babel/core@7.27.1) + '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 + '@babel/traverse': 7.27.1 semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/helper-create-regexp-features-plugin@7.26.3(@babel/core@7.26.9)': + '@babel/helper-create-regexp-features-plugin@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-annotate-as-pure': 7.25.9 + '@babel/helper-annotate-as-pure': 7.27.1 regexpu-core: 6.2.0 semver: 6.3.1 - '@babel/helper-define-polyfill-provider@0.6.3(@babel/core@7.26.9)': + '@babel/helper-define-polyfill-provider@0.6.4(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-compilation-targets': 7.26.5 - '@babel/helper-plugin-utils': 7.26.5 - debug: 4.4.0(supports-color@9.4.0) + '@babel/helper-compilation-targets': 7.27.2 + '@babel/helper-plugin-utils': 7.27.1 + debug: 4.4.1 lodash.debounce: 4.0.8 resolve: 1.22.10 transitivePeerDependencies: - supports-color - '@babel/helper-member-expression-to-functions@7.25.9': + '@babel/helper-member-expression-to-functions@7.27.1': dependencies: - '@babel/traverse': 7.26.10 - '@babel/types': 7.26.10 + '@babel/traverse': 7.27.1 + '@babel/types': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/helper-module-imports@7.25.9': + '@babel/helper-module-imports@7.27.1': dependencies: - '@babel/traverse': 7.26.10 - '@babel/types': 7.26.10 + '@babel/traverse': 7.27.1 + '@babel/types': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/helper-module-transforms@7.26.0(@babel/core@7.26.10)': + '@babel/helper-module-transforms@7.27.1(@babel/core@7.26.9)': dependencies: - '@babel/core': 7.26.10 - '@babel/helper-module-imports': 7.25.9 - '@babel/helper-validator-identifier': 7.25.9 - '@babel/traverse': 7.26.10 + '@babel/core': 7.26.9 + '@babel/helper-module-imports': 7.27.1 + '@babel/helper-validator-identifier': 7.27.1 + '@babel/traverse': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/helper-module-transforms@7.26.0(@babel/core@7.26.9)': + '@babel/helper-module-transforms@7.27.1(@babel/core@7.27.1)': dependencies: - '@babel/core': 7.26.9 - '@babel/helper-module-imports': 7.25.9 - '@babel/helper-validator-identifier': 7.25.9 - '@babel/traverse': 7.26.10 + '@babel/core': 7.27.1 + '@babel/helper-module-imports': 7.27.1 + '@babel/helper-validator-identifier': 7.27.1 + '@babel/traverse': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/helper-optimise-call-expression@7.25.9': + '@babel/helper-optimise-call-expression@7.27.1': dependencies: - '@babel/types': 7.26.10 + '@babel/types': 7.27.1 - '@babel/helper-plugin-utils@7.26.5': {} + '@babel/helper-plugin-utils@7.27.1': {} - '@babel/helper-remap-async-to-generator@7.25.9(@babel/core@7.26.9)': + '@babel/helper-remap-async-to-generator@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-annotate-as-pure': 7.25.9 - '@babel/helper-wrap-function': 7.25.9 - '@babel/traverse': 7.26.10 + '@babel/helper-annotate-as-pure': 7.27.1 + '@babel/helper-wrap-function': 7.27.1 + '@babel/traverse': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/helper-replace-supers@7.26.5(@babel/core@7.26.10)': + '@babel/helper-replace-supers@7.27.1(@babel/core@7.26.9)': dependencies: - '@babel/core': 7.26.10 - '@babel/helper-member-expression-to-functions': 7.25.9 - '@babel/helper-optimise-call-expression': 7.25.9 - '@babel/traverse': 7.26.10 + '@babel/core': 7.26.9 + '@babel/helper-member-expression-to-functions': 7.27.1 + '@babel/helper-optimise-call-expression': 7.27.1 + '@babel/traverse': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/helper-replace-supers@7.26.5(@babel/core@7.26.9)': + '@babel/helper-replace-supers@7.27.1(@babel/core@7.27.1)': dependencies: - '@babel/core': 7.26.9 - '@babel/helper-member-expression-to-functions': 7.25.9 - '@babel/helper-optimise-call-expression': 7.25.9 - '@babel/traverse': 7.26.10 + '@babel/core': 7.27.1 + '@babel/helper-member-expression-to-functions': 7.27.1 + '@babel/helper-optimise-call-expression': 7.27.1 + '@babel/traverse': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/helper-skip-transparent-expression-wrappers@7.25.9': + '@babel/helper-skip-transparent-expression-wrappers@7.27.1': dependencies: - '@babel/traverse': 7.26.10 - '@babel/types': 7.26.10 + '@babel/traverse': 7.27.1 + '@babel/types': 7.27.1 transitivePeerDependencies: - supports-color '@babel/helper-split-export-declaration@7.24.7': dependencies: - '@babel/types': 7.26.10 + '@babel/types': 7.27.1 - '@babel/helper-string-parser@7.25.9': {} + '@babel/helper-string-parser@7.27.1': {} - '@babel/helper-validator-identifier@7.25.9': {} + '@babel/helper-validator-identifier@7.27.1': {} - '@babel/helper-validator-option@7.25.9': {} + '@babel/helper-validator-option@7.27.1': {} - '@babel/helper-wrap-function@7.25.9': + '@babel/helper-wrap-function@7.27.1': dependencies: - '@babel/template': 7.26.9 - '@babel/traverse': 7.26.10 - '@babel/types': 7.26.10 + '@babel/template': 7.27.2 + '@babel/traverse': 7.27.1 + '@babel/types': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/helpers@7.26.10': + '@babel/helpers@7.27.1': dependencies: - '@babel/template': 7.26.9 - '@babel/types': 7.26.10 + '@babel/template': 7.27.2 + '@babel/types': 7.27.1 - '@babel/parser@7.26.10': + '@babel/parser@7.27.2': dependencies: - '@babel/types': 7.26.10 + '@babel/types': 7.27.1 - '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 - '@babel/traverse': 7.26.10 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/traverse': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-bugfix-safari-class-field-initializer-scope@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-bugfix-safari-class-field-initializer-scope@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 - '@babel/helper-skip-transparent-expression-wrappers': 7.25.9 - '@babel/plugin-transform-optional-chaining': 7.25.9(@babel/core@7.26.9) + '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 + '@babel/plugin-transform-optional-chaining': 7.27.1(@babel/core@7.26.9) transitivePeerDependencies: - supports-color - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 - '@babel/traverse': 7.26.10 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/traverse': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-proposal-decorators@7.25.9(@babel/core@7.26.10)': + '@babel/plugin-proposal-decorators@7.27.1(@babel/core@7.27.1)': dependencies: - '@babel/core': 7.26.10 - '@babel/helper-create-class-features-plugin': 7.26.9(@babel/core@7.26.10) - '@babel/helper-plugin-utils': 7.26.5 - '@babel/plugin-syntax-decorators': 7.25.9(@babel/core@7.26.10) + '@babel/core': 7.27.1 + '@babel/helper-create-class-features-plugin': 7.27.1(@babel/core@7.27.1) + '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-decorators': 7.27.1(@babel/core@7.27.1) transitivePeerDependencies: - supports-color @@ -12871,470 +13560,475 @@ snapshots: dependencies: '@babel/core': 7.26.9 - '@babel/plugin-syntax-decorators@7.25.9(@babel/core@7.26.10)': + '@babel/plugin-syntax-decorators@7.27.1(@babel/core@7.27.1)': dependencies: - '@babel/core': 7.26.10 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-syntax-import-assertions@7.26.0(@babel/core@7.26.9)': + '@babel/plugin-syntax-import-assertions@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-syntax-import-attributes@7.26.0(@babel/core@7.26.10)': + '@babel/plugin-syntax-import-attributes@7.26.0(@babel/core@7.26.9)': dependencies: - '@babel/core': 7.26.10 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/core': 7.26.9 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-syntax-import-attributes@7.26.0(@babel/core@7.26.9)': + '@babel/plugin-syntax-import-attributes@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.26.10)': + '@babel/plugin-syntax-import-attributes@7.27.1(@babel/core@7.27.1)': dependencies: - '@babel/core': 7.26.10 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-syntax-jsx@7.25.9(@babel/core@7.26.10)': + '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.27.1)': dependencies: - '@babel/core': 7.26.10 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-syntax-typescript@7.25.9(@babel/core@7.26.10)': + '@babel/plugin-syntax-jsx@7.27.1(@babel/core@7.27.1)': dependencies: - '@babel/core': 7.26.10 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + + '@babel/plugin-syntax-typescript@7.27.1(@babel/core@7.27.1)': + dependencies: + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 '@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.9) - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-create-regexp-features-plugin': 7.27.1(@babel/core@7.26.9) + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-arrow-functions@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-arrow-functions@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 '@babel/plugin-transform-async-generator-functions@7.26.8(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 - '@babel/helper-remap-async-to-generator': 7.25.9(@babel/core@7.26.9) - '@babel/traverse': 7.26.10 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-remap-async-to-generator': 7.27.1(@babel/core@7.26.9) + '@babel/traverse': 7.27.1 transitivePeerDependencies: - supports-color '@babel/plugin-transform-async-to-generator@7.25.9(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-module-imports': 7.25.9 - '@babel/helper-plugin-utils': 7.26.5 - '@babel/helper-remap-async-to-generator': 7.25.9(@babel/core@7.26.9) + '@babel/helper-module-imports': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-remap-async-to-generator': 7.27.1(@babel/core@7.26.9) transitivePeerDependencies: - supports-color - '@babel/plugin-transform-block-scoped-functions@7.26.5(@babel/core@7.26.9)': + '@babel/plugin-transform-block-scoped-functions@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-block-scoping@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-block-scoping@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-class-properties@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-class-properties@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-create-class-features-plugin': 7.26.9(@babel/core@7.26.9) - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-create-class-features-plugin': 7.27.1(@babel/core@7.26.9) + '@babel/helper-plugin-utils': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-class-static-block@7.26.0(@babel/core@7.26.9)': + '@babel/plugin-transform-class-static-block@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-create-class-features-plugin': 7.26.9(@babel/core@7.26.9) - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-create-class-features-plugin': 7.27.1(@babel/core@7.26.9) + '@babel/helper-plugin-utils': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-classes@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-classes@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-annotate-as-pure': 7.25.9 - '@babel/helper-compilation-targets': 7.26.5 - '@babel/helper-plugin-utils': 7.26.5 - '@babel/helper-replace-supers': 7.26.5(@babel/core@7.26.9) - '@babel/traverse': 7.26.10 + '@babel/helper-annotate-as-pure': 7.27.1 + '@babel/helper-compilation-targets': 7.27.2 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-replace-supers': 7.27.1(@babel/core@7.26.9) + '@babel/traverse': 7.27.1 globals: 11.12.0 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-computed-properties@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-computed-properties@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 - '@babel/template': 7.26.9 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/template': 7.27.2 - '@babel/plugin-transform-destructuring@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-destructuring@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-dotall-regex@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-dotall-regex@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.9) - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-create-regexp-features-plugin': 7.27.1(@babel/core@7.26.9) + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-duplicate-keys@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-duplicate-keys@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-duplicate-named-capturing-groups-regex@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-duplicate-named-capturing-groups-regex@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.9) - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-create-regexp-features-plugin': 7.27.1(@babel/core@7.26.9) + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-dynamic-import@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-dynamic-import@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-exponentiation-operator@7.26.3(@babel/core@7.26.9)': + '@babel/plugin-transform-exponentiation-operator@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-export-namespace-from@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-export-namespace-from@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-for-of@7.26.9(@babel/core@7.26.9)': + '@babel/plugin-transform-for-of@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 - '@babel/helper-skip-transparent-expression-wrappers': 7.25.9 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-function-name@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-function-name@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-compilation-targets': 7.26.5 - '@babel/helper-plugin-utils': 7.26.5 - '@babel/traverse': 7.26.10 + '@babel/helper-compilation-targets': 7.27.2 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/traverse': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-json-strings@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-json-strings@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-literals@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-literals@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-logical-assignment-operators@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-logical-assignment-operators@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-member-expression-literals@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-member-expression-literals@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-modules-amd@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-modules-amd@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-module-transforms': 7.26.0(@babel/core@7.26.9) - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-module-transforms': 7.27.1(@babel/core@7.26.9) + '@babel/helper-plugin-utils': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-modules-commonjs@7.26.3(@babel/core@7.26.9)': + '@babel/plugin-transform-modules-commonjs@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-module-transforms': 7.26.0(@babel/core@7.26.9) - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-module-transforms': 7.27.1(@babel/core@7.26.9) + '@babel/helper-plugin-utils': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-modules-systemjs@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-modules-systemjs@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-module-transforms': 7.26.0(@babel/core@7.26.9) - '@babel/helper-plugin-utils': 7.26.5 - '@babel/helper-validator-identifier': 7.25.9 - '@babel/traverse': 7.26.10 + '@babel/helper-module-transforms': 7.27.1(@babel/core@7.26.9) + '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-validator-identifier': 7.27.1 + '@babel/traverse': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-modules-umd@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-modules-umd@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-module-transforms': 7.26.0(@babel/core@7.26.9) - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-module-transforms': 7.27.1(@babel/core@7.26.9) + '@babel/helper-plugin-utils': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-named-capturing-groups-regex@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-named-capturing-groups-regex@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.9) - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-create-regexp-features-plugin': 7.27.1(@babel/core@7.26.9) + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-new-target@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-new-target@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-nullish-coalescing-operator@7.26.6(@babel/core@7.26.9)': + '@babel/plugin-transform-nullish-coalescing-operator@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-numeric-separator@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-numeric-separator@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-object-rest-spread@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-object-rest-spread@7.27.2(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-compilation-targets': 7.26.5 - '@babel/helper-plugin-utils': 7.26.5 - '@babel/plugin-transform-parameters': 7.25.9(@babel/core@7.26.9) + '@babel/helper-compilation-targets': 7.27.2 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-transform-destructuring': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-parameters': 7.27.1(@babel/core@7.26.9) - '@babel/plugin-transform-object-super@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-object-super@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 - '@babel/helper-replace-supers': 7.26.5(@babel/core@7.26.9) + '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-replace-supers': 7.27.1(@babel/core@7.26.9) transitivePeerDependencies: - supports-color - '@babel/plugin-transform-optional-catch-binding@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-optional-catch-binding@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-optional-chaining@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-optional-chaining@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 - '@babel/helper-skip-transparent-expression-wrappers': 7.25.9 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-parameters@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-parameters@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-private-methods@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-private-methods@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-create-class-features-plugin': 7.26.9(@babel/core@7.26.9) - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-create-class-features-plugin': 7.27.1(@babel/core@7.26.9) + '@babel/helper-plugin-utils': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-private-property-in-object@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-private-property-in-object@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-annotate-as-pure': 7.25.9 - '@babel/helper-create-class-features-plugin': 7.26.9(@babel/core@7.26.9) - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-annotate-as-pure': 7.27.1 + '@babel/helper-create-class-features-plugin': 7.27.1(@babel/core@7.26.9) + '@babel/helper-plugin-utils': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-property-literals@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-property-literals@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-react-jsx-self@7.25.9(@babel/core@7.26.10)': + '@babel/plugin-transform-react-jsx-self@7.27.1(@babel/core@7.27.1)': dependencies: - '@babel/core': 7.26.10 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-react-jsx-source@7.25.9(@babel/core@7.26.10)': + '@babel/plugin-transform-react-jsx-source@7.27.1(@babel/core@7.27.1)': dependencies: - '@babel/core': 7.26.10 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/core': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-regenerator@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-regenerator@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 - regenerator-transform: 0.15.2 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-regexp-modifiers@7.26.0(@babel/core@7.26.9)': + '@babel/plugin-transform-regexp-modifiers@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.9) - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-create-regexp-features-plugin': 7.27.1(@babel/core@7.26.9) + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-reserved-words@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-reserved-words@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 '@babel/plugin-transform-runtime@7.26.9(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-module-imports': 7.25.9 - '@babel/helper-plugin-utils': 7.26.5 - babel-plugin-polyfill-corejs2: 0.4.12(@babel/core@7.26.9) + '@babel/helper-module-imports': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + babel-plugin-polyfill-corejs2: 0.4.13(@babel/core@7.26.9) babel-plugin-polyfill-corejs3: 0.10.6(@babel/core@7.26.9) - babel-plugin-polyfill-regenerator: 0.6.3(@babel/core@7.26.9) + babel-plugin-polyfill-regenerator: 0.6.4(@babel/core@7.26.9) semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-shorthand-properties@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-shorthand-properties@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-spread@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-spread@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 - '@babel/helper-skip-transparent-expression-wrappers': 7.25.9 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-sticky-regex@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-sticky-regex@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-template-literals@7.26.8(@babel/core@7.26.9)': + '@babel/plugin-transform-template-literals@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-typeof-symbol@7.26.7(@babel/core@7.26.9)': + '@babel/plugin-transform-typeof-symbol@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-typescript@7.26.8(@babel/core@7.26.10)': + '@babel/plugin-transform-typescript@7.27.1(@babel/core@7.27.1)': dependencies: - '@babel/core': 7.26.10 - '@babel/helper-annotate-as-pure': 7.25.9 - '@babel/helper-create-class-features-plugin': 7.26.9(@babel/core@7.26.10) - '@babel/helper-plugin-utils': 7.26.5 - '@babel/helper-skip-transparent-expression-wrappers': 7.25.9 - '@babel/plugin-syntax-typescript': 7.25.9(@babel/core@7.26.10) + '@babel/core': 7.27.1 + '@babel/helper-annotate-as-pure': 7.27.1 + '@babel/helper-create-class-features-plugin': 7.27.1(@babel/core@7.27.1) + '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 + '@babel/plugin-syntax-typescript': 7.27.1(@babel/core@7.27.1) transitivePeerDependencies: - supports-color - '@babel/plugin-transform-unicode-escapes@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-unicode-escapes@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-unicode-property-regex@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-unicode-property-regex@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.9) - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-create-regexp-features-plugin': 7.27.1(@babel/core@7.26.9) + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-unicode-regex@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-unicode-regex@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.9) - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-create-regexp-features-plugin': 7.27.1(@babel/core@7.26.9) + '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-unicode-sets-regex@7.25.9(@babel/core@7.26.9)': + '@babel/plugin-transform-unicode-sets-regex@7.27.1(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-create-regexp-features-plugin': 7.26.3(@babel/core@7.26.9) - '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-create-regexp-features-plugin': 7.27.1(@babel/core@7.26.9) + '@babel/helper-plugin-utils': 7.27.1 '@babel/preset-env@7.26.9(@babel/core@7.26.9)': dependencies: - '@babel/compat-data': 7.26.8 + '@babel/compat-data': 7.27.2 '@babel/core': 7.26.9 - '@babel/helper-compilation-targets': 7.26.5 - '@babel/helper-plugin-utils': 7.26.5 - '@babel/helper-validator-option': 7.25.9 - '@babel/plugin-bugfix-firefox-class-in-computed-class-key': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-bugfix-safari-class-field-initializer-scope': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly': 7.25.9(@babel/core@7.26.9) + '@babel/helper-compilation-targets': 7.27.2 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-validator-option': 7.27.1 + '@babel/plugin-bugfix-firefox-class-in-computed-class-key': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-bugfix-safari-class-field-initializer-scope': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly': 7.27.1(@babel/core@7.26.9) '@babel/plugin-proposal-private-property-in-object': 7.21.0-placeholder-for-preset-env.2(@babel/core@7.26.9) - '@babel/plugin-syntax-import-assertions': 7.26.0(@babel/core@7.26.9) - '@babel/plugin-syntax-import-attributes': 7.26.0(@babel/core@7.26.9) + '@babel/plugin-syntax-import-assertions': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-syntax-import-attributes': 7.27.1(@babel/core@7.26.9) '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/core@7.26.9) - '@babel/plugin-transform-arrow-functions': 7.25.9(@babel/core@7.26.9) + '@babel/plugin-transform-arrow-functions': 7.27.1(@babel/core@7.26.9) '@babel/plugin-transform-async-generator-functions': 7.26.8(@babel/core@7.26.9) '@babel/plugin-transform-async-to-generator': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-block-scoped-functions': 7.26.5(@babel/core@7.26.9) - '@babel/plugin-transform-block-scoping': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-class-properties': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-class-static-block': 7.26.0(@babel/core@7.26.9) - '@babel/plugin-transform-classes': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-computed-properties': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-destructuring': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-dotall-regex': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-duplicate-keys': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-duplicate-named-capturing-groups-regex': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-dynamic-import': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-exponentiation-operator': 7.26.3(@babel/core@7.26.9) - '@babel/plugin-transform-export-namespace-from': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-for-of': 7.26.9(@babel/core@7.26.9) - '@babel/plugin-transform-function-name': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-json-strings': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-literals': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-logical-assignment-operators': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-member-expression-literals': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-modules-amd': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-modules-commonjs': 7.26.3(@babel/core@7.26.9) - '@babel/plugin-transform-modules-systemjs': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-modules-umd': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-named-capturing-groups-regex': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-new-target': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-nullish-coalescing-operator': 7.26.6(@babel/core@7.26.9) - '@babel/plugin-transform-numeric-separator': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-object-rest-spread': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-object-super': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-optional-catch-binding': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-optional-chaining': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-parameters': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-private-methods': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-private-property-in-object': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-property-literals': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-regenerator': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-regexp-modifiers': 7.26.0(@babel/core@7.26.9) - '@babel/plugin-transform-reserved-words': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-shorthand-properties': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-spread': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-sticky-regex': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-template-literals': 7.26.8(@babel/core@7.26.9) - '@babel/plugin-transform-typeof-symbol': 7.26.7(@babel/core@7.26.9) - '@babel/plugin-transform-unicode-escapes': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-unicode-property-regex': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-unicode-regex': 7.25.9(@babel/core@7.26.9) - '@babel/plugin-transform-unicode-sets-regex': 7.25.9(@babel/core@7.26.9) + '@babel/plugin-transform-block-scoped-functions': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-block-scoping': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-class-properties': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-class-static-block': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-classes': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-computed-properties': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-destructuring': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-dotall-regex': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-duplicate-keys': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-duplicate-named-capturing-groups-regex': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-dynamic-import': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-exponentiation-operator': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-export-namespace-from': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-for-of': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-function-name': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-json-strings': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-literals': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-logical-assignment-operators': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-member-expression-literals': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-modules-amd': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-modules-commonjs': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-modules-systemjs': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-modules-umd': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-named-capturing-groups-regex': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-new-target': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-nullish-coalescing-operator': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-numeric-separator': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-object-rest-spread': 7.27.2(@babel/core@7.26.9) + '@babel/plugin-transform-object-super': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-optional-catch-binding': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-optional-chaining': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-parameters': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-private-methods': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-private-property-in-object': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-property-literals': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-regenerator': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-regexp-modifiers': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-reserved-words': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-shorthand-properties': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-spread': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-sticky-regex': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-template-literals': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-typeof-symbol': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-unicode-escapes': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-unicode-property-regex': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-unicode-regex': 7.27.1(@babel/core@7.26.9) + '@babel/plugin-transform-unicode-sets-regex': 7.27.1(@babel/core@7.26.9) '@babel/preset-modules': 0.1.6-no-external-plugins(@babel/core@7.26.9) - babel-plugin-polyfill-corejs2: 0.4.12(@babel/core@7.26.9) + babel-plugin-polyfill-corejs2: 0.4.13(@babel/core@7.26.9) babel-plugin-polyfill-corejs3: 0.11.1(@babel/core@7.26.9) - babel-plugin-polyfill-regenerator: 0.6.3(@babel/core@7.26.9) - core-js-compat: 3.41.0 + babel-plugin-polyfill-regenerator: 0.6.4(@babel/core@7.26.9) + core-js-compat: 3.42.0 semver: 6.3.1 transitivePeerDependencies: - supports-color @@ -13342,52 +14036,50 @@ snapshots: '@babel/preset-modules@0.1.6-no-external-plugins(@babel/core@7.26.9)': dependencies: '@babel/core': 7.26.9 - '@babel/helper-plugin-utils': 7.26.5 - '@babel/types': 7.26.10 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/types': 7.27.1 esutils: 2.0.3 - '@babel/runtime@7.26.10': - dependencies: - regenerator-runtime: 0.14.1 - '@babel/runtime@7.26.9': dependencies: regenerator-runtime: 0.14.1 - '@babel/standalone@7.26.10': {} + '@babel/runtime@7.27.1': {} - '@babel/template@7.26.9': + '@babel/standalone@7.27.2': {} + + '@babel/template@7.27.2': dependencies: - '@babel/code-frame': 7.26.2 - '@babel/parser': 7.26.10 - '@babel/types': 7.26.10 + '@babel/code-frame': 7.27.1 + '@babel/parser': 7.27.2 + '@babel/types': 7.27.1 - '@babel/traverse@7.26.10': + '@babel/traverse@7.27.1': dependencies: - '@babel/code-frame': 7.26.2 - '@babel/generator': 7.26.10 - '@babel/parser': 7.26.10 - '@babel/template': 7.26.9 - '@babel/types': 7.26.10 - debug: 4.4.0(supports-color@9.4.0) + '@babel/code-frame': 7.27.1 + '@babel/generator': 7.27.1 + '@babel/parser': 7.27.2 + '@babel/template': 7.27.2 + '@babel/types': 7.27.1 + debug: 4.4.1 globals: 11.12.0 transitivePeerDependencies: - supports-color - '@babel/types@7.26.10': + '@babel/types@7.27.1': dependencies: - '@babel/helper-string-parser': 7.25.9 - '@babel/helper-validator-identifier': 7.25.9 + '@babel/helper-string-parser': 7.27.1 + '@babel/helper-validator-identifier': 7.27.1 '@bcoe/v8-coverage@1.0.2': {} - '@braidai/lang@1.1.0': {} + '@braidai/lang@1.1.1': {} - '@changesets/apply-release-plan@7.0.10': + '@changesets/apply-release-plan@7.0.12': dependencies: '@changesets/config': 3.1.1 '@changesets/get-version-range-type': 0.4.0 - '@changesets/git': 3.0.2 + '@changesets/git': 3.0.4 '@changesets/should-skip-package': 0.1.2 '@changesets/types': 6.1.0 '@manypkg/get-packages': 1.1.3 @@ -13399,7 +14091,7 @@ snapshots: resolve-from: 5.0.0 semver: 7.7.2 - '@changesets/assemble-release-plan@6.0.6': + '@changesets/assemble-release-plan@6.0.8': dependencies: '@changesets/errors': 0.2.0 '@changesets/get-dependents-graph': 2.1.3 @@ -13422,17 +14114,17 @@ snapshots: '@changesets/cli@2.27.8': dependencies: - '@changesets/apply-release-plan': 7.0.10 - '@changesets/assemble-release-plan': 6.0.6 + '@changesets/apply-release-plan': 7.0.12 + '@changesets/assemble-release-plan': 6.0.8 '@changesets/changelog-git': 0.2.1 '@changesets/config': 3.1.1 '@changesets/errors': 0.2.0 '@changesets/get-dependents-graph': 2.1.3 - '@changesets/get-release-plan': 4.0.8 - '@changesets/git': 3.0.2 + '@changesets/get-release-plan': 4.0.12 + '@changesets/git': 3.0.4 '@changesets/logger': 0.1.1 '@changesets/pre': 2.0.2 - '@changesets/read': 0.6.3 + '@changesets/read': 0.6.5 '@changesets/should-skip-package': 0.1.2 '@changesets/types': 6.1.0 '@changesets/write': 0.3.2 @@ -13481,18 +14173,18 @@ snapshots: transitivePeerDependencies: - encoding - '@changesets/get-release-plan@4.0.8': + '@changesets/get-release-plan@4.0.12': dependencies: - '@changesets/assemble-release-plan': 6.0.6 + '@changesets/assemble-release-plan': 6.0.8 '@changesets/config': 3.1.1 '@changesets/pre': 2.0.2 - '@changesets/read': 0.6.3 + '@changesets/read': 0.6.5 '@changesets/types': 6.1.0 '@manypkg/get-packages': 1.1.3 '@changesets/get-version-range-type@0.4.0': {} - '@changesets/git@3.0.2': + '@changesets/git@3.0.4': dependencies: '@changesets/errors': 0.2.0 '@manypkg/get-packages': 1.1.3 @@ -13516,9 +14208,9 @@ snapshots: '@manypkg/get-packages': 1.1.3 fs-extra: 7.0.1 - '@changesets/read@0.6.3': + '@changesets/read@0.6.5': dependencies: - '@changesets/git': 3.0.2 + '@changesets/git': 3.0.4 '@changesets/logger': 0.1.1 '@changesets/parse': 0.4.1 '@changesets/types': 6.1.0 @@ -13542,24 +14234,37 @@ snapshots: human-id: 1.0.2 prettier: 2.8.8 - '@cloudflare/kv-asset-handler@0.3.4': + '@cloudflare/kv-asset-handler@0.4.0': dependencies: mime: 3.0.0 '@colors/colors@1.5.0': {} + '@colors/colors@1.6.0': {} + '@cspotcode/source-map-support@0.8.1': dependencies: '@jridgewell/trace-mapping': 0.3.9 + '@dabh/diagnostics@2.0.3': + dependencies: + colorspace: 1.1.4 + enabled: 2.0.0 + kuler: 2.0.0 + + '@dependents/detective-less@4.1.0': + dependencies: + gonzales-pe: 4.3.0 + node-source-walk: 6.0.2 + '@discoveryjs/json-ext@0.6.3': {} '@docsearch/css@3.9.0': {} - '@docsearch/js@3.9.0(@algolia/client-search@5.21.0)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(search-insights@2.17.3)': + '@docsearch/js@3.9.0(@algolia/client-search@5.25.0)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(search-insights@2.17.3)': dependencies: - '@docsearch/react': 3.9.0(@algolia/client-search@5.21.0)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(search-insights@2.17.3) - preact: 10.26.4 + '@docsearch/react': 3.9.0(@algolia/client-search@5.25.0)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(search-insights@2.17.3) + preact: 10.26.6 transitivePeerDependencies: - '@algolia/client-search' - '@types/react' @@ -13567,12 +14272,12 @@ snapshots: - react-dom - search-insights - '@docsearch/react@3.9.0(@algolia/client-search@5.21.0)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(search-insights@2.17.3)': + '@docsearch/react@3.9.0(@algolia/client-search@5.25.0)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(search-insights@2.17.3)': dependencies: - '@algolia/autocomplete-core': 1.17.9(@algolia/client-search@5.21.0)(algoliasearch@5.21.0)(search-insights@2.17.3) - '@algolia/autocomplete-preset-algolia': 1.17.9(@algolia/client-search@5.21.0)(algoliasearch@5.21.0) + '@algolia/autocomplete-core': 1.17.9(@algolia/client-search@5.25.0)(algoliasearch@5.25.0)(search-insights@2.17.3) + '@algolia/autocomplete-preset-algolia': 1.17.9(@algolia/client-search@5.25.0)(algoliasearch@5.25.0) '@docsearch/css': 3.9.0 - algoliasearch: 5.21.0 + algoliasearch: 5.25.0 optionalDependencies: '@types/react': 19.0.1 react: 19.0.0 @@ -13581,10 +14286,18 @@ snapshots: transitivePeerDependencies: - '@algolia/client-search' - '@emnapi/runtime@1.3.1': + '@emnapi/core@1.4.3': + dependencies: + '@emnapi/wasi-threads': 1.0.2 + tslib: 2.8.1 + + '@emnapi/runtime@1.4.3': + dependencies: + tslib: 2.8.1 + + '@emnapi/wasi-threads@1.0.2': dependencies: tslib: 2.8.1 - optional: true '@esbuild/aix-ppc64@0.19.12': optional: true @@ -13598,10 +14311,7 @@ snapshots: '@esbuild/aix-ppc64@0.25.0': optional: true - '@esbuild/aix-ppc64@0.25.2': - optional: true - - '@esbuild/aix-ppc64@0.25.5': + '@esbuild/aix-ppc64@0.25.4': optional: true '@esbuild/android-arm64@0.19.12': @@ -13616,10 +14326,7 @@ snapshots: '@esbuild/android-arm64@0.25.0': optional: true - '@esbuild/android-arm64@0.25.2': - optional: true - - '@esbuild/android-arm64@0.25.5': + '@esbuild/android-arm64@0.25.4': optional: true '@esbuild/android-arm@0.19.12': @@ -13634,10 +14341,7 @@ snapshots: '@esbuild/android-arm@0.25.0': optional: true - '@esbuild/android-arm@0.25.2': - optional: true - - '@esbuild/android-arm@0.25.5': + '@esbuild/android-arm@0.25.4': optional: true '@esbuild/android-x64@0.19.12': @@ -13652,10 +14356,7 @@ snapshots: '@esbuild/android-x64@0.25.0': optional: true - '@esbuild/android-x64@0.25.2': - optional: true - - '@esbuild/android-x64@0.25.5': + '@esbuild/android-x64@0.25.4': optional: true '@esbuild/darwin-arm64@0.19.12': @@ -13670,10 +14371,7 @@ snapshots: '@esbuild/darwin-arm64@0.25.0': optional: true - '@esbuild/darwin-arm64@0.25.2': - optional: true - - '@esbuild/darwin-arm64@0.25.5': + '@esbuild/darwin-arm64@0.25.4': optional: true '@esbuild/darwin-x64@0.19.12': @@ -13688,10 +14386,7 @@ snapshots: '@esbuild/darwin-x64@0.25.0': optional: true - '@esbuild/darwin-x64@0.25.2': - optional: true - - '@esbuild/darwin-x64@0.25.5': + '@esbuild/darwin-x64@0.25.4': optional: true '@esbuild/freebsd-arm64@0.19.12': @@ -13706,10 +14401,7 @@ snapshots: '@esbuild/freebsd-arm64@0.25.0': optional: true - '@esbuild/freebsd-arm64@0.25.2': - optional: true - - '@esbuild/freebsd-arm64@0.25.5': + '@esbuild/freebsd-arm64@0.25.4': optional: true '@esbuild/freebsd-x64@0.19.12': @@ -13724,10 +14416,7 @@ snapshots: '@esbuild/freebsd-x64@0.25.0': optional: true - '@esbuild/freebsd-x64@0.25.2': - optional: true - - '@esbuild/freebsd-x64@0.25.5': + '@esbuild/freebsd-x64@0.25.4': optional: true '@esbuild/linux-arm64@0.19.12': @@ -13742,10 +14431,7 @@ snapshots: '@esbuild/linux-arm64@0.25.0': optional: true - '@esbuild/linux-arm64@0.25.2': - optional: true - - '@esbuild/linux-arm64@0.25.5': + '@esbuild/linux-arm64@0.25.4': optional: true '@esbuild/linux-arm@0.19.12': @@ -13760,10 +14446,7 @@ snapshots: '@esbuild/linux-arm@0.25.0': optional: true - '@esbuild/linux-arm@0.25.2': - optional: true - - '@esbuild/linux-arm@0.25.5': + '@esbuild/linux-arm@0.25.4': optional: true '@esbuild/linux-ia32@0.19.12': @@ -13778,10 +14461,7 @@ snapshots: '@esbuild/linux-ia32@0.25.0': optional: true - '@esbuild/linux-ia32@0.25.2': - optional: true - - '@esbuild/linux-ia32@0.25.5': + '@esbuild/linux-ia32@0.25.4': optional: true '@esbuild/linux-loong64@0.19.12': @@ -13796,10 +14476,7 @@ snapshots: '@esbuild/linux-loong64@0.25.0': optional: true - '@esbuild/linux-loong64@0.25.2': - optional: true - - '@esbuild/linux-loong64@0.25.5': + '@esbuild/linux-loong64@0.25.4': optional: true '@esbuild/linux-mips64el@0.19.12': @@ -13814,10 +14491,7 @@ snapshots: '@esbuild/linux-mips64el@0.25.0': optional: true - '@esbuild/linux-mips64el@0.25.2': - optional: true - - '@esbuild/linux-mips64el@0.25.5': + '@esbuild/linux-mips64el@0.25.4': optional: true '@esbuild/linux-ppc64@0.19.12': @@ -13832,10 +14506,7 @@ snapshots: '@esbuild/linux-ppc64@0.25.0': optional: true - '@esbuild/linux-ppc64@0.25.2': - optional: true - - '@esbuild/linux-ppc64@0.25.5': + '@esbuild/linux-ppc64@0.25.4': optional: true '@esbuild/linux-riscv64@0.19.12': @@ -13850,10 +14521,7 @@ snapshots: '@esbuild/linux-riscv64@0.25.0': optional: true - '@esbuild/linux-riscv64@0.25.2': - optional: true - - '@esbuild/linux-riscv64@0.25.5': + '@esbuild/linux-riscv64@0.25.4': optional: true '@esbuild/linux-s390x@0.19.12': @@ -13868,10 +14536,7 @@ snapshots: '@esbuild/linux-s390x@0.25.0': optional: true - '@esbuild/linux-s390x@0.25.2': - optional: true - - '@esbuild/linux-s390x@0.25.5': + '@esbuild/linux-s390x@0.25.4': optional: true '@esbuild/linux-x64@0.19.12': @@ -13886,10 +14551,7 @@ snapshots: '@esbuild/linux-x64@0.25.0': optional: true - '@esbuild/linux-x64@0.25.2': - optional: true - - '@esbuild/linux-x64@0.25.5': + '@esbuild/linux-x64@0.25.4': optional: true '@esbuild/netbsd-arm64@0.24.2': @@ -13898,10 +14560,7 @@ snapshots: '@esbuild/netbsd-arm64@0.25.0': optional: true - '@esbuild/netbsd-arm64@0.25.2': - optional: true - - '@esbuild/netbsd-arm64@0.25.5': + '@esbuild/netbsd-arm64@0.25.4': optional: true '@esbuild/netbsd-x64@0.19.12': @@ -13916,10 +14575,7 @@ snapshots: '@esbuild/netbsd-x64@0.25.0': optional: true - '@esbuild/netbsd-x64@0.25.2': - optional: true - - '@esbuild/netbsd-x64@0.25.5': + '@esbuild/netbsd-x64@0.25.4': optional: true '@esbuild/openbsd-arm64@0.24.2': @@ -13928,10 +14584,7 @@ snapshots: '@esbuild/openbsd-arm64@0.25.0': optional: true - '@esbuild/openbsd-arm64@0.25.2': - optional: true - - '@esbuild/openbsd-arm64@0.25.5': + '@esbuild/openbsd-arm64@0.25.4': optional: true '@esbuild/openbsd-x64@0.19.12': @@ -13946,10 +14599,7 @@ snapshots: '@esbuild/openbsd-x64@0.25.0': optional: true - '@esbuild/openbsd-x64@0.25.2': - optional: true - - '@esbuild/openbsd-x64@0.25.5': + '@esbuild/openbsd-x64@0.25.4': optional: true '@esbuild/sunos-x64@0.19.12': @@ -13964,10 +14614,7 @@ snapshots: '@esbuild/sunos-x64@0.25.0': optional: true - '@esbuild/sunos-x64@0.25.2': - optional: true - - '@esbuild/sunos-x64@0.25.5': + '@esbuild/sunos-x64@0.25.4': optional: true '@esbuild/win32-arm64@0.19.12': @@ -13982,10 +14629,7 @@ snapshots: '@esbuild/win32-arm64@0.25.0': optional: true - '@esbuild/win32-arm64@0.25.2': - optional: true - - '@esbuild/win32-arm64@0.25.5': + '@esbuild/win32-arm64@0.25.4': optional: true '@esbuild/win32-ia32@0.19.12': @@ -14000,10 +14644,7 @@ snapshots: '@esbuild/win32-ia32@0.25.0': optional: true - '@esbuild/win32-ia32@0.25.2': - optional: true - - '@esbuild/win32-ia32@0.25.5': + '@esbuild/win32-ia32@0.25.4': optional: true '@esbuild/win32-x64@0.19.12': @@ -14018,13 +14659,10 @@ snapshots: '@esbuild/win32-x64@0.25.0': optional: true - '@esbuild/win32-x64@0.25.2': - optional: true - - '@esbuild/win32-x64@0.25.5': + '@esbuild/win32-x64@0.25.4': optional: true - '@eslint-community/eslint-utils@4.5.0(eslint@9.17.0(jiti@2.4.2))': + '@eslint-community/eslint-utils@4.7.0(eslint@9.17.0(jiti@2.4.2))': dependencies: eslint: 9.17.0(jiti@2.4.2) eslint-visitor-keys: 3.4.3 @@ -14034,12 +14672,12 @@ snapshots: '@eslint/config-array@0.19.2': dependencies: '@eslint/object-schema': 2.1.6 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 minimatch: 3.1.2 transitivePeerDependencies: - supports-color - '@eslint/core@0.12.0': + '@eslint/core@0.13.0': dependencies: '@types/json-schema': 7.0.15 @@ -14047,10 +14685,10 @@ snapshots: dependencies: '@types/json-schema': 7.0.15 - '@eslint/eslintrc@3.3.0': + '@eslint/eslintrc@3.3.1': dependencies: ajv: 6.12.6 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 espree: 10.3.0 globals: 14.0.0 ignore: 5.3.2 @@ -14065,9 +14703,9 @@ snapshots: '@eslint/object-schema@2.1.6': {} - '@eslint/plugin-kit@0.2.7': + '@eslint/plugin-kit@0.2.8': dependencies: - '@eslint/core': 0.12.0 + '@eslint/core': 0.13.0 levn: 0.4.1 '@fastify/ajv-compiler@4.0.2': @@ -14076,9 +14714,11 @@ snapshots: ajv-formats: 3.0.1(ajv@8.17.1) fast-uri: 3.0.6 - '@fastify/error@4.0.0': {} + '@fastify/busboy@3.1.1': {} - '@fastify/fast-json-stringify-compiler@5.0.2': + '@fastify/error@4.1.0': {} + + '@fastify/fast-json-stringify-compiler@5.0.3': dependencies: fast-json-stringify: 6.0.1 @@ -14086,18 +14726,18 @@ snapshots: dependencies: dequal: 2.0.3 - '@floating-ui/core@1.6.9': + '@floating-ui/core@1.7.0': dependencies: '@floating-ui/utils': 0.2.9 - '@floating-ui/dom@1.6.13': + '@floating-ui/dom@1.7.0': dependencies: - '@floating-ui/core': 1.6.9 + '@floating-ui/core': 1.7.0 '@floating-ui/utils': 0.2.9 '@floating-ui/react-dom@2.1.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: - '@floating-ui/dom': 1.6.13 + '@floating-ui/dom': 1.7.0 react: 19.0.0 react-dom: 19.0.0(react@19.0.0) @@ -14105,6 +14745,12 @@ snapshots: '@fontsource/fira-mono@5.0.0': {} + '@hey-api/json-schema-ref-parser@1.0.4': + dependencies: + '@jsdevtools/ono': 7.1.3 + '@types/json-schema': 7.0.15 + js-yaml: 4.1.0 + '@hey-api/json-schema-ref-parser@1.0.6': dependencies: '@jsdevtools/ono': 7.1.3 @@ -14123,7 +14769,7 @@ snapshots: '@humanwhocodes/retry@0.3.1': {} - '@humanwhocodes/retry@0.4.2': {} + '@humanwhocodes/retry@0.4.3': {} '@img/sharp-darwin-arm64@0.33.5': optionalDependencies: @@ -14191,7 +14837,7 @@ snapshots: '@img/sharp-wasm32@0.33.5': dependencies: - '@emnapi/runtime': 1.3.1 + '@emnapi/runtime': 1.4.3 optional: true '@img/sharp-win32-ia32@0.33.5': @@ -14200,34 +14846,34 @@ snapshots: '@img/sharp-win32-x64@0.33.5': optional: true - '@inquirer/checkbox@4.1.3(@types/node@22.10.5)': + '@inquirer/checkbox@4.1.6(@types/node@22.10.5)': dependencies: - '@inquirer/core': 10.1.8(@types/node@22.10.5) + '@inquirer/core': 10.1.11(@types/node@22.10.5) '@inquirer/figures': 1.0.11 - '@inquirer/type': 3.0.5(@types/node@22.10.5) + '@inquirer/type': 3.0.6(@types/node@22.10.5) ansi-escapes: 4.3.2 yoctocolors-cjs: 2.1.2 optionalDependencies: '@types/node': 22.10.5 - '@inquirer/confirm@5.1.6(@types/node@22.10.5)': + '@inquirer/confirm@5.1.10(@types/node@22.10.5)': dependencies: - '@inquirer/core': 10.1.8(@types/node@22.10.5) - '@inquirer/type': 3.0.5(@types/node@22.10.5) + '@inquirer/core': 10.1.11(@types/node@22.10.5) + '@inquirer/type': 3.0.6(@types/node@22.10.5) optionalDependencies: '@types/node': 22.10.5 - '@inquirer/confirm@5.1.7(@types/node@22.10.5)': + '@inquirer/confirm@5.1.6(@types/node@22.10.5)': dependencies: - '@inquirer/core': 10.1.8(@types/node@22.10.5) - '@inquirer/type': 3.0.5(@types/node@22.10.5) + '@inquirer/core': 10.1.11(@types/node@22.10.5) + '@inquirer/type': 3.0.6(@types/node@22.10.5) optionalDependencies: '@types/node': 22.10.5 - '@inquirer/core@10.1.8(@types/node@22.10.5)': + '@inquirer/core@10.1.11(@types/node@22.10.5)': dependencies: '@inquirer/figures': 1.0.11 - '@inquirer/type': 3.0.5(@types/node@22.10.5) + '@inquirer/type': 3.0.6(@types/node@22.10.5) ansi-escapes: 4.3.2 cli-width: 4.1.0 mute-stream: 2.0.0 @@ -14237,83 +14883,83 @@ snapshots: optionalDependencies: '@types/node': 22.10.5 - '@inquirer/editor@4.2.8(@types/node@22.10.5)': + '@inquirer/editor@4.2.11(@types/node@22.10.5)': dependencies: - '@inquirer/core': 10.1.8(@types/node@22.10.5) - '@inquirer/type': 3.0.5(@types/node@22.10.5) + '@inquirer/core': 10.1.11(@types/node@22.10.5) + '@inquirer/type': 3.0.6(@types/node@22.10.5) external-editor: 3.1.0 optionalDependencies: '@types/node': 22.10.5 - '@inquirer/expand@4.0.10(@types/node@22.10.5)': + '@inquirer/expand@4.0.13(@types/node@22.10.5)': dependencies: - '@inquirer/core': 10.1.8(@types/node@22.10.5) - '@inquirer/type': 3.0.5(@types/node@22.10.5) + '@inquirer/core': 10.1.11(@types/node@22.10.5) + '@inquirer/type': 3.0.6(@types/node@22.10.5) yoctocolors-cjs: 2.1.2 optionalDependencies: '@types/node': 22.10.5 '@inquirer/figures@1.0.11': {} - '@inquirer/input@4.1.7(@types/node@22.10.5)': + '@inquirer/input@4.1.10(@types/node@22.10.5)': dependencies: - '@inquirer/core': 10.1.8(@types/node@22.10.5) - '@inquirer/type': 3.0.5(@types/node@22.10.5) + '@inquirer/core': 10.1.11(@types/node@22.10.5) + '@inquirer/type': 3.0.6(@types/node@22.10.5) optionalDependencies: '@types/node': 22.10.5 - '@inquirer/number@3.0.10(@types/node@22.10.5)': + '@inquirer/number@3.0.13(@types/node@22.10.5)': dependencies: - '@inquirer/core': 10.1.8(@types/node@22.10.5) - '@inquirer/type': 3.0.5(@types/node@22.10.5) + '@inquirer/core': 10.1.11(@types/node@22.10.5) + '@inquirer/type': 3.0.6(@types/node@22.10.5) optionalDependencies: '@types/node': 22.10.5 - '@inquirer/password@4.0.10(@types/node@22.10.5)': + '@inquirer/password@4.0.13(@types/node@22.10.5)': dependencies: - '@inquirer/core': 10.1.8(@types/node@22.10.5) - '@inquirer/type': 3.0.5(@types/node@22.10.5) + '@inquirer/core': 10.1.11(@types/node@22.10.5) + '@inquirer/type': 3.0.6(@types/node@22.10.5) ansi-escapes: 4.3.2 optionalDependencies: '@types/node': 22.10.5 '@inquirer/prompts@7.3.2(@types/node@22.10.5)': dependencies: - '@inquirer/checkbox': 4.1.3(@types/node@22.10.5) - '@inquirer/confirm': 5.1.7(@types/node@22.10.5) - '@inquirer/editor': 4.2.8(@types/node@22.10.5) - '@inquirer/expand': 4.0.10(@types/node@22.10.5) - '@inquirer/input': 4.1.7(@types/node@22.10.5) - '@inquirer/number': 3.0.10(@types/node@22.10.5) - '@inquirer/password': 4.0.10(@types/node@22.10.5) - '@inquirer/rawlist': 4.0.10(@types/node@22.10.5) - '@inquirer/search': 3.0.10(@types/node@22.10.5) - '@inquirer/select': 4.0.10(@types/node@22.10.5) + '@inquirer/checkbox': 4.1.6(@types/node@22.10.5) + '@inquirer/confirm': 5.1.10(@types/node@22.10.5) + '@inquirer/editor': 4.2.11(@types/node@22.10.5) + '@inquirer/expand': 4.0.13(@types/node@22.10.5) + '@inquirer/input': 4.1.10(@types/node@22.10.5) + '@inquirer/number': 3.0.13(@types/node@22.10.5) + '@inquirer/password': 4.0.13(@types/node@22.10.5) + '@inquirer/rawlist': 4.1.1(@types/node@22.10.5) + '@inquirer/search': 3.0.13(@types/node@22.10.5) + '@inquirer/select': 4.2.1(@types/node@22.10.5) optionalDependencies: '@types/node': 22.10.5 - '@inquirer/rawlist@4.0.10(@types/node@22.10.5)': + '@inquirer/rawlist@4.1.1(@types/node@22.10.5)': dependencies: - '@inquirer/core': 10.1.8(@types/node@22.10.5) - '@inquirer/type': 3.0.5(@types/node@22.10.5) + '@inquirer/core': 10.1.11(@types/node@22.10.5) + '@inquirer/type': 3.0.6(@types/node@22.10.5) yoctocolors-cjs: 2.1.2 optionalDependencies: '@types/node': 22.10.5 - '@inquirer/search@3.0.10(@types/node@22.10.5)': + '@inquirer/search@3.0.13(@types/node@22.10.5)': dependencies: - '@inquirer/core': 10.1.8(@types/node@22.10.5) + '@inquirer/core': 10.1.11(@types/node@22.10.5) '@inquirer/figures': 1.0.11 - '@inquirer/type': 3.0.5(@types/node@22.10.5) + '@inquirer/type': 3.0.6(@types/node@22.10.5) yoctocolors-cjs: 2.1.2 optionalDependencies: '@types/node': 22.10.5 - '@inquirer/select@4.0.10(@types/node@22.10.5)': + '@inquirer/select@4.2.1(@types/node@22.10.5)': dependencies: - '@inquirer/core': 10.1.8(@types/node@22.10.5) + '@inquirer/core': 10.1.11(@types/node@22.10.5) '@inquirer/figures': 1.0.11 - '@inquirer/type': 3.0.5(@types/node@22.10.5) + '@inquirer/type': 3.0.6(@types/node@22.10.5) ansi-escapes: 4.3.2 yoctocolors-cjs: 2.1.2 optionalDependencies: @@ -14323,7 +14969,7 @@ snapshots: dependencies: mute-stream: 1.0.0 - '@inquirer/type@3.0.5(@types/node@22.10.5)': + '@inquirer/type@3.0.6(@types/node@22.10.5)': optionalDependencies: '@types/node': 22.10.5 @@ -14344,6 +14990,10 @@ snapshots: '@istanbuljs/schema@0.1.3': {} + '@jest/schemas@29.6.3': + dependencies: + '@sinclair/typebox': 0.27.8 + '@jridgewell/gen-mapping@0.3.8': dependencies: '@jridgewell/set-array': 1.2.1 @@ -14380,18 +15030,18 @@ snapshots: '@jsonjoy.com/json-pack@1.2.0(tslib@2.8.1)': dependencies: '@jsonjoy.com/base64': 1.1.2(tslib@2.8.1) - '@jsonjoy.com/util': 1.5.0(tslib@2.8.1) + '@jsonjoy.com/util': 1.6.0(tslib@2.8.1) hyperdyperid: 1.2.0 thingies: 1.21.0(tslib@2.8.1) tslib: 2.8.1 - '@jsonjoy.com/util@1.5.0(tslib@2.8.1)': + '@jsonjoy.com/util@1.6.0(tslib@2.8.1)': dependencies: tslib: 2.8.1 '@kwsites/file-exists@1.1.1': dependencies: - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 transitivePeerDependencies: - supports-color @@ -14424,29 +15074,44 @@ snapshots: '@loaderkit/resolve@1.0.4': dependencies: - '@braidai/lang': 1.1.0 + '@braidai/lang': 1.1.1 '@manypkg/find-root@1.1.0': dependencies: - '@babel/runtime': 7.26.10 + '@babel/runtime': 7.27.1 '@types/node': 12.20.55 find-up: 4.1.0 fs-extra: 8.1.0 '@manypkg/get-packages@1.1.3': dependencies: - '@babel/runtime': 7.26.10 + '@babel/runtime': 7.27.1 '@changesets/types': 4.1.0 '@manypkg/find-root': 1.1.0 fs-extra: 8.1.0 globby: 11.1.0 read-yaml-file: 1.1.0 + '@mapbox/node-pre-gyp@1.0.11(encoding@0.1.13)': + dependencies: + detect-libc: 2.0.4 + https-proxy-agent: 5.0.1 + make-dir: 3.1.0 + node-fetch: 2.7.0(encoding@0.1.13) + nopt: 5.0.0 + npmlog: 5.0.1 + rimraf: 3.0.2 + semver: 7.7.2 + tar: 6.2.1 + transitivePeerDependencies: + - encoding + - supports-color + '@mapbox/node-pre-gyp@2.0.0(encoding@0.1.13)': dependencies: consola: 3.4.2 - detect-libc: 2.0.3 - https-proxy-agent: 7.0.6(supports-color@9.4.0) + detect-libc: 2.0.4 + https-proxy-agent: 7.0.6 node-fetch: 2.7.0(encoding@0.1.13) nopt: 8.1.0 semver: 7.7.2 @@ -14541,18 +15206,107 @@ snapshots: '@napi-rs/nice-win32-x64-msvc': 1.0.1 optional: true + '@napi-rs/wasm-runtime@0.2.4': + dependencies: + '@emnapi/core': 1.4.3 + '@emnapi/runtime': 1.4.3 + '@tybys/wasm-util': 0.9.0 + + '@napi-rs/wasm-runtime@0.2.9': + dependencies: + '@emnapi/core': 1.4.3 + '@emnapi/runtime': 1.4.3 + '@tybys/wasm-util': 0.9.0 + optional: true + '@neoconfetti/svelte@2.0.0': {} - '@netlify/functions@3.0.0': + '@netlify/binary-info@1.0.0': {} + + '@netlify/blobs@9.1.1': dependencies: - '@netlify/serverless-functions-api': 1.30.1 + '@netlify/dev-utils': 2.1.1 + '@netlify/runtime-utils': 1.3.1 + + '@netlify/dev-utils@2.1.1': + dependencies: + '@whatwg-node/server': 0.9.71 + chokidar: 4.0.3 + decache: 4.6.2 + dot-prop: 9.0.0 + env-paths: 3.0.0 + find-up: 7.0.0 + lodash.debounce: 4.0.8 + netlify: 13.3.5 + parse-gitignore: 2.0.0 + uuid: 11.1.0 + write-file-atomic: 6.0.0 + + '@netlify/functions@3.1.8(encoding@0.1.13)(rollup@4.40.2)': + dependencies: + '@netlify/blobs': 9.1.1 + '@netlify/dev-utils': 2.1.1 + '@netlify/serverless-functions-api': 1.41.1 + '@netlify/zip-it-and-ship-it': 10.1.1(encoding@0.1.13)(rollup@4.40.2) + cron-parser: 4.9.0 + decache: 4.6.2 + extract-zip: 2.0.1 + is-stream: 4.0.1 + jwt-decode: 4.0.0 + lambda-local: 2.2.0 + read-package-up: 11.0.0 + source-map-support: 0.5.21 + transitivePeerDependencies: + - encoding + - rollup + - supports-color - '@netlify/node-cookies@0.1.0': {} + '@netlify/open-api@2.37.0': {} - '@netlify/serverless-functions-api@1.30.1': + '@netlify/runtime-utils@1.3.1': {} + + '@netlify/serverless-functions-api@1.41.1': {} + + '@netlify/zip-it-and-ship-it@10.1.1(encoding@0.1.13)(rollup@4.40.2)': dependencies: - '@netlify/node-cookies': 0.1.0 + '@babel/parser': 7.27.2 + '@babel/types': 7.27.1 + '@netlify/binary-info': 1.0.0 + '@netlify/serverless-functions-api': 1.41.1 + '@vercel/nft': 0.27.7(encoding@0.1.13)(rollup@4.40.2) + archiver: 5.3.2 + common-path-prefix: 3.0.0 + cp-file: 10.0.0 + es-module-lexer: 1.7.0 + esbuild: 0.25.4 + execa: 7.2.0 + fast-glob: 3.3.3 + filter-obj: 5.1.0 + find-up: 6.3.0 + glob: 8.1.0 + is-builtin-module: 3.2.1 + is-path-inside: 4.0.0 + junk: 4.0.1 + locate-path: 7.2.0 + merge-options: 3.0.4 + minimatch: 9.0.5 + normalize-path: 3.0.0 + p-map: 7.0.3 + path-exists: 5.0.0 + precinct: 11.0.5 + require-package-name: 2.0.1 + resolve: 2.0.0-next.5 + semver: 7.7.2 + tmp-promise: 3.0.3 + toml: 3.0.0 + unixify: 1.0.0 urlpattern-polyfill: 8.0.2 + yargs: 17.7.2 + zod: 3.25.3 + transitivePeerDependencies: + - encoding + - rollup + - supports-color '@next/env@15.2.4': {} @@ -14588,7 +15342,7 @@ snapshots: dependencies: '@angular/compiler-cli': 19.2.0(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.8.3) typescript: 5.8.3 - webpack: 5.98.0(esbuild@0.25.2) + webpack: 5.98.0(esbuild@0.25.4) '@nodelib/fs.scandir@2.1.5': dependencies: @@ -14608,7 +15362,7 @@ snapshots: dependencies: agent-base: 7.1.3 http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.6(supports-color@9.4.0) + https-proxy-agent: 7.0.6 lru-cache: 10.4.3 socks-proxy-agent: 8.0.5 transitivePeerDependencies: @@ -14640,7 +15394,7 @@ snapshots: dependencies: '@npmcli/git': 6.0.3 glob: 10.4.3 - hosted-git-info: 8.0.2 + hosted-git-info: 8.1.0 json-parse-even-better-errors: 4.0.0 proc-log: 5.0.0 semver: 7.7.2 @@ -14650,14 +15404,14 @@ snapshots: dependencies: which: 5.0.0 - '@npmcli/redact@3.1.1': {} + '@npmcli/redact@3.2.2': {} '@npmcli/run-script@9.1.0': dependencies: '@npmcli/node-gyp': 4.0.0 '@npmcli/package-json': 6.1.1 '@npmcli/promise-spawn': 8.0.2 - node-gyp: 11.1.0 + node-gyp: 11.2.0 proc-log: 5.0.0 which: 5.0.0 transitivePeerDependencies: @@ -14665,12 +15419,22 @@ snapshots: '@nuxt/devalue@2.0.2': {} - '@nuxt/devtools-kit@1.7.0(magicast@0.3.5)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))': + '@nuxt/devtools-kit@1.7.0(magicast@0.3.5)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1))': + dependencies: + '@nuxt/kit': 3.15.4(magicast@0.3.5) + '@nuxt/schema': 3.16.2 + execa: 7.2.0 + vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1) + transitivePeerDependencies: + - magicast + - supports-color + + '@nuxt/devtools-kit@1.7.0(magicast@0.3.5)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))': dependencies: '@nuxt/kit': 3.15.4(magicast@0.3.5) '@nuxt/schema': 3.16.2 execa: 7.2.0 - vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) transitivePeerDependencies: - magicast - supports-color @@ -14688,18 +15452,18 @@ snapshots: rc9: 2.1.2 semver: 7.7.2 - '@nuxt/devtools@1.7.0(rollup@3.29.5)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3))': + '@nuxt/devtools@1.7.0(rollup@3.29.5)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3))': dependencies: '@antfu/utils': 0.7.10 - '@nuxt/devtools-kit': 1.7.0(magicast@0.3.5)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) + '@nuxt/devtools-kit': 1.7.0(magicast@0.3.5)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) '@nuxt/devtools-wizard': 1.7.0 '@nuxt/kit': 3.15.4(magicast@0.3.5) - '@vue/devtools-core': 7.6.8(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3)) + '@vue/devtools-core': 7.6.8(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3)) '@vue/devtools-kit': 7.6.8 birpc: 0.2.19 consola: 3.4.2 - cronstrue: 2.56.0 - destr: 2.0.3 + cronstrue: 2.61.0 + destr: 2.0.5 error-stack-parser-es: 0.1.5 execa: 7.2.0 fast-npm-meta: 0.2.2 @@ -14721,13 +15485,13 @@ snapshots: semver: 7.7.2 simple-git: 3.27.0 sirv: 3.0.1 - tinyglobby: 0.2.12 + tinyglobby: 0.2.13 unimport: 3.14.6(rollup@3.29.5) - vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) - vite-plugin-inspect: 0.8.9(@nuxt/kit@3.15.4(magicast@0.3.5))(rollup@3.29.5)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) - vite-plugin-vue-inspector: 5.3.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) + vite-plugin-inspect: 0.8.9(@nuxt/kit@3.15.4(magicast@0.3.5))(rollup@3.29.5)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) + vite-plugin-vue-inspector: 5.3.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) which: 3.0.1 - ws: 8.18.1 + ws: 8.18.2 transitivePeerDependencies: - bufferutil - rollup @@ -14735,18 +15499,18 @@ snapshots: - utf-8-validate - vue - '@nuxt/devtools@1.7.0(rollup@4.41.1)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3))': + '@nuxt/devtools@1.7.0(rollup@4.40.2)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1))(vue@3.5.13(typescript@5.8.3))': dependencies: '@antfu/utils': 0.7.10 - '@nuxt/devtools-kit': 1.7.0(magicast@0.3.5)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) + '@nuxt/devtools-kit': 1.7.0(magicast@0.3.5)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)) '@nuxt/devtools-wizard': 1.7.0 '@nuxt/kit': 3.15.4(magicast@0.3.5) - '@vue/devtools-core': 7.6.8(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3)) + '@vue/devtools-core': 7.6.8(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1))(vue@3.5.13(typescript@5.8.3)) '@vue/devtools-kit': 7.6.8 birpc: 0.2.19 consola: 3.4.2 - cronstrue: 2.56.0 - destr: 2.0.3 + cronstrue: 2.61.0 + destr: 2.0.5 error-stack-parser-es: 0.1.5 execa: 7.2.0 fast-npm-meta: 0.2.2 @@ -14768,13 +15532,60 @@ snapshots: semver: 7.7.2 simple-git: 3.27.0 sirv: 3.0.1 - tinyglobby: 0.2.12 - unimport: 3.14.6(rollup@4.41.1) - vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) - vite-plugin-inspect: 0.8.9(@nuxt/kit@3.15.4(magicast@0.3.5))(rollup@4.41.1)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) - vite-plugin-vue-inspector: 5.3.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) + tinyglobby: 0.2.13 + unimport: 3.14.6(rollup@4.40.2) + vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1) + vite-plugin-inspect: 0.8.9(@nuxt/kit@3.15.4(magicast@0.3.5))(rollup@4.40.2)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)) + vite-plugin-vue-inspector: 5.3.1(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)) which: 3.0.1 - ws: 8.18.1 + ws: 8.18.2 + transitivePeerDependencies: + - bufferutil + - rollup + - supports-color + - utf-8-validate + - vue + + '@nuxt/devtools@1.7.0(rollup@4.40.2)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3))': + dependencies: + '@antfu/utils': 0.7.10 + '@nuxt/devtools-kit': 1.7.0(magicast@0.3.5)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) + '@nuxt/devtools-wizard': 1.7.0 + '@nuxt/kit': 3.15.4(magicast@0.3.5) + '@vue/devtools-core': 7.6.8(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3)) + '@vue/devtools-kit': 7.6.8 + birpc: 0.2.19 + consola: 3.4.2 + cronstrue: 2.61.0 + destr: 2.0.5 + error-stack-parser-es: 0.1.5 + execa: 7.2.0 + fast-npm-meta: 0.2.2 + flatted: 3.3.3 + get-port-please: 3.1.2 + hookable: 5.5.3 + image-meta: 0.2.1 + is-installed-globally: 1.0.0 + launch-editor: 2.10.0 + local-pkg: 0.5.1 + magicast: 0.3.5 + nypm: 0.4.1 + ohash: 1.1.6 + pathe: 1.1.2 + perfect-debounce: 1.0.0 + pkg-types: 1.3.1 + rc9: 2.1.2 + scule: 1.3.0 + semver: 7.7.2 + simple-git: 3.27.0 + sirv: 3.0.1 + tinyglobby: 0.2.13 + unimport: 3.14.6(rollup@4.40.2) + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) + vite-plugin-inspect: 0.8.9(@nuxt/kit@3.15.4(magicast@0.3.5))(rollup@4.40.2)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) + vite-plugin-vue-inspector: 5.3.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) + which: 3.0.1 + ws: 8.18.2 transitivePeerDependencies: - bufferutil - rollup @@ -14788,7 +15599,7 @@ snapshots: c12: 2.0.1(magicast@0.3.5) consola: 3.4.2 defu: 6.1.4 - destr: 2.0.3 + destr: 2.0.5 globby: 14.1.0 hash-sum: 2.0.0 ignore: 6.0.2 @@ -14800,7 +15611,7 @@ snapshots: pkg-types: 1.3.1 scule: 1.3.0 semver: 7.7.2 - ufo: 1.5.4 + ufo: 1.6.1 unctx: 2.4.1 unimport: 3.14.6(rollup@3.29.5) untyped: 1.5.2 @@ -14809,13 +15620,13 @@ snapshots: - rollup - supports-color - '@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.41.1)': + '@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.40.2)': dependencies: - '@nuxt/schema': 3.14.1592(magicast@0.3.5)(rollup@4.41.1) + '@nuxt/schema': 3.14.1592(magicast@0.3.5)(rollup@4.40.2) c12: 2.0.1(magicast@0.3.5) consola: 3.4.2 defu: 6.1.4 - destr: 2.0.3 + destr: 2.0.5 globby: 14.1.0 hash-sum: 2.0.0 ignore: 6.0.2 @@ -14827,9 +15638,9 @@ snapshots: pkg-types: 1.3.1 scule: 1.3.0 semver: 7.7.2 - ufo: 1.5.4 + ufo: 1.6.1 unctx: 2.4.1 - unimport: 3.14.6(rollup@4.41.1) + unimport: 3.14.6(rollup@4.40.2) untyped: 1.5.2 transitivePeerDependencies: - magicast @@ -14839,11 +15650,11 @@ snapshots: '@nuxt/kit@3.15.4(magicast@0.3.5)': dependencies: c12: 2.0.1(magicast@0.3.5) - consola: 3.4.0 + consola: 3.4.2 defu: 6.1.4 - destr: 2.0.3 + destr: 2.0.5 globby: 14.1.0 - ignore: 7.0.3 + ignore: 7.0.4 jiti: 2.4.2 klona: 2.0.6 knitwork: 1.2.0 @@ -14852,26 +15663,25 @@ snapshots: pathe: 2.0.3 pkg-types: 1.3.1 scule: 1.3.0 - semver: 7.7.1 - std-env: 3.8.1 - ufo: 1.5.4 + semver: 7.7.2 + std-env: 3.9.0 + ufo: 1.6.1 unctx: 2.4.1 - unimport: 4.1.2 + unimport: 4.2.0 untyped: 1.5.2 transitivePeerDependencies: - magicast - supports-color - '@nuxt/kit@3.16.2(magicast@0.3.5)': + '@nuxt/kit@3.17.3(magicast@0.3.5)': dependencies: - c12: 3.0.2(magicast@0.3.5) + c12: 3.0.3(magicast@0.3.5) consola: 3.4.2 defu: 6.1.4 - destr: 2.0.3 + destr: 2.0.5 errx: 0.1.0 - exsolve: 1.0.4 - globby: 14.1.0 - ignore: 7.0.3 + exsolve: 1.0.5 + ignore: 7.0.4 jiti: 2.4.2 klona: 2.0.6 knitwork: 1.2.0 @@ -14881,23 +15691,24 @@ snapshots: pkg-types: 2.1.0 scule: 1.3.0 semver: 7.7.2 - std-env: 3.8.1 - ufo: 1.5.4 + std-env: 3.9.0 + tinyglobby: 0.2.13 + ufo: 1.6.1 unctx: 2.4.1 - unimport: 4.2.0 + unimport: 5.0.1 untyped: 2.0.0 transitivePeerDependencies: - magicast - '@nuxt/module-builder@0.8.4(@nuxt/kit@3.15.4(magicast@0.3.5))(nuxi@3.22.5)(sass@1.85.0)(typescript@5.8.3)': + '@nuxt/module-builder@0.8.4(@nuxt/kit@3.15.4(magicast@0.3.5))(nuxi@3.25.1)(sass@1.85.0)(typescript@5.8.3)': dependencies: '@nuxt/kit': 3.15.4(magicast@0.3.5) citty: 0.1.6 - consola: 3.4.0 + consola: 3.4.2 defu: 6.1.4 magic-regexp: 0.8.0 mlly: 1.7.4 - nuxi: 3.22.5 + nuxi: 3.25.1 pathe: 1.1.2 pkg-types: 1.3.1 tsconfck: 3.1.5(typescript@5.8.3) @@ -14918,8 +15729,8 @@ snapshots: pathe: 1.1.2 pkg-types: 1.3.1 scule: 1.3.0 - std-env: 3.8.1 - ufo: 1.5.4 + std-env: 3.9.0 + ufo: 1.6.1 uncrypto: 0.1.3 unimport: 3.14.6(rollup@3.29.5) untyped: 1.5.2 @@ -14928,7 +15739,7 @@ snapshots: - rollup - supports-color - '@nuxt/schema@3.14.1592(magicast@0.3.5)(rollup@4.41.1)': + '@nuxt/schema@3.14.1592(magicast@0.3.5)(rollup@4.40.2)': dependencies: c12: 2.0.1(magicast@0.3.5) compatx: 0.1.8 @@ -14938,10 +15749,10 @@ snapshots: pathe: 1.1.2 pkg-types: 1.3.1 scule: 1.3.0 - std-env: 3.8.1 - ufo: 1.5.4 + std-env: 3.9.0 + ufo: 1.6.1 uncrypto: 0.1.3 - unimport: 3.14.6(rollup@4.41.1) + unimport: 3.14.6(rollup@4.40.2) untyped: 1.5.2 transitivePeerDependencies: - magicast @@ -14953,39 +15764,38 @@ snapshots: consola: 3.4.2 defu: 6.1.4 pathe: 2.0.3 - std-env: 3.8.1 + std-env: 3.9.0 - '@nuxt/telemetry@2.6.5(magicast@0.3.5)': + '@nuxt/telemetry@2.6.6(magicast@0.3.5)': dependencies: '@nuxt/kit': 3.15.4(magicast@0.3.5) citty: 0.1.6 consola: 3.4.2 - destr: 2.0.3 - dotenv: 16.4.7 - git-url-parse: 16.0.1 + destr: 2.0.5 + dotenv: 16.5.0 + git-url-parse: 16.1.0 is-docker: 3.0.0 ofetch: 1.4.1 - package-manager-detector: 0.2.11 - parse-git-config: 3.0.0 + package-manager-detector: 1.3.0 pathe: 2.0.3 rc9: 2.1.2 - std-env: 3.8.1 + std-env: 3.9.0 transitivePeerDependencies: - magicast - supports-color - '@nuxt/test-utils@3.17.2(@types/node@22.10.5)(@vue/test-utils@2.4.6)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(magicast@0.3.5)(sass@1.85.0)(terser@5.39.0)(typescript@5.8.3)(vitest@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))(yaml@2.8.0)': + '@nuxt/test-utils@3.17.2(@types/node@22.10.5)(@vue/test-utils@2.4.6)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(magicast@0.3.5)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vitest@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(yaml@2.8.0)': dependencies: - '@nuxt/kit': 3.16.2(magicast@0.3.5) + '@nuxt/kit': 3.17.3(magicast@0.3.5) '@nuxt/schema': 3.16.2 - c12: 3.0.2(magicast@0.3.5) - consola: 3.4.0 + c12: 3.0.3(magicast@0.3.5) + consola: 3.4.2 defu: 6.1.4 - destr: 2.0.3 + destr: 2.0.5 estree-walker: 3.0.3 - fake-indexeddb: 6.0.0 + fake-indexeddb: 6.0.1 get-port-please: 3.1.2 - h3: 1.15.1 + h3: 1.15.3 local-pkg: 1.1.1 magic-string: 0.30.17 node-fetch-native: 1.6.6 @@ -14995,17 +15805,17 @@ snapshots: perfect-debounce: 1.0.0 radix3: 1.1.2 scule: 1.3.0 - std-env: 3.8.1 + std-env: 3.9.0 tinyexec: 0.3.2 - ufo: 1.5.4 - unplugin: 2.2.0 - vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) - vitest-environment-nuxt: 1.0.1(@types/node@22.10.5)(@vue/test-utils@2.4.6)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(magicast@0.3.5)(sass@1.85.0)(terser@5.39.0)(typescript@5.8.3)(vitest@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))(yaml@2.8.0) + ufo: 1.6.1 + unplugin: 2.3.4 + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) + vitest-environment-nuxt: 1.0.1(@types/node@22.10.5)(@vue/test-utils@2.4.6)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(magicast@0.3.5)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vitest@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(yaml@2.8.0) vue: 3.5.13(typescript@5.8.3) optionalDependencies: '@vue/test-utils': 2.4.6 jsdom: 23.0.0 - vitest: 3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + vitest: 3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) transitivePeerDependencies: - '@types/node' - jiti @@ -15021,23 +15831,23 @@ snapshots: - typescript - yaml - '@nuxt/vite-builder@3.14.1592(@types/node@22.10.5)(eslint@9.17.0(jiti@2.4.2))(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@3.29.5)(sass@1.85.0)(terser@5.39.0)(typescript@5.8.3)(vue@3.5.13(typescript@5.8.3))': + '@nuxt/vite-builder@3.14.1592(@types/node@22.10.5)(eslint@9.17.0(jiti@2.4.2))(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@3.29.5)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vue@3.5.13(typescript@5.8.3))': dependencies: '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5) '@rollup/plugin-replace': 6.0.2(rollup@3.29.5) - '@vitejs/plugin-vue': 5.2.1(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0))(vue@3.5.13(typescript@5.8.3)) - '@vitejs/plugin-vue-jsx': 4.1.1(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0))(vue@3.5.13(typescript@5.8.3)) - autoprefixer: 10.4.20(postcss@8.5.4) + '@vitejs/plugin-vue': 5.2.1(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1))(vue@3.5.13(typescript@5.8.3)) + '@vitejs/plugin-vue-jsx': 4.1.1(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1))(vue@3.5.13(typescript@5.8.3)) + autoprefixer: 10.4.20(postcss@8.5.3) clear: 0.1.0 consola: 3.4.2 - cssnano: 7.0.6(postcss@8.5.4) + cssnano: 7.0.7(postcss@8.5.3) defu: 6.1.4 esbuild: 0.24.2 escape-string-regexp: 5.0.0 estree-walker: 3.0.3 externality: 1.0.2 get-port-please: 3.1.2 - h3: 1.15.1 + h3: 1.15.3 jiti: 2.4.2 knitwork: 1.2.0 magic-string: 0.30.17 @@ -15046,16 +15856,16 @@ snapshots: pathe: 1.1.2 perfect-debounce: 1.0.0 pkg-types: 1.3.1 - postcss: 8.5.4 + postcss: 8.5.3 rollup-plugin-visualizer: 5.14.0(rollup@3.29.5) - std-env: 3.8.1 + std-env: 3.9.0 strip-literal: 2.1.1 - ufo: 1.5.4 + ufo: 1.6.1 unenv: 1.10.0 unplugin: 1.16.1 - vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0) - vite-node: 2.1.9(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0) - vite-plugin-checker: 0.8.0(eslint@9.17.0(jiti@2.4.2))(optionator@0.9.4)(typescript@5.8.3)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)) + vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1) + vite-node: 2.1.9(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1) + vite-plugin-checker: 0.8.0(eslint@9.17.0(jiti@2.4.2))(optionator@0.9.4)(typescript@5.8.3)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)) vue: 3.5.13(typescript@5.8.3) vue-bundle-renderer: 2.1.1 transitivePeerDependencies: @@ -15081,23 +15891,23 @@ snapshots: - vti - vue-tsc - '@nuxt/vite-builder@3.14.1592(@types/node@22.10.5)(eslint@9.17.0(jiti@2.4.2))(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.41.1)(sass@1.85.0)(terser@5.39.0)(typescript@5.8.3)(vue@3.5.13(typescript@5.8.3))': + '@nuxt/vite-builder@3.14.1592(@types/node@22.10.5)(eslint@9.17.0(jiti@2.4.2))(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.40.2)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vue@3.5.13(typescript@5.8.3))': dependencies: - '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.41.1) - '@rollup/plugin-replace': 6.0.2(rollup@4.41.1) - '@vitejs/plugin-vue': 5.2.1(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0))(vue@3.5.13(typescript@5.8.3)) - '@vitejs/plugin-vue-jsx': 4.1.1(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0))(vue@3.5.13(typescript@5.8.3)) - autoprefixer: 10.4.20(postcss@8.5.4) + '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.40.2) + '@rollup/plugin-replace': 6.0.2(rollup@4.40.2) + '@vitejs/plugin-vue': 5.2.1(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1))(vue@3.5.13(typescript@5.8.3)) + '@vitejs/plugin-vue-jsx': 4.1.1(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1))(vue@3.5.13(typescript@5.8.3)) + autoprefixer: 10.4.20(postcss@8.5.3) clear: 0.1.0 consola: 3.4.2 - cssnano: 7.0.6(postcss@8.5.4) + cssnano: 7.0.7(postcss@8.5.3) defu: 6.1.4 esbuild: 0.24.2 escape-string-regexp: 5.0.0 estree-walker: 3.0.3 externality: 1.0.2 get-port-please: 3.1.2 - h3: 1.15.1 + h3: 1.15.3 jiti: 2.4.2 knitwork: 1.2.0 magic-string: 0.30.17 @@ -15106,16 +15916,16 @@ snapshots: pathe: 1.1.2 perfect-debounce: 1.0.0 pkg-types: 1.3.1 - postcss: 8.5.4 - rollup-plugin-visualizer: 5.14.0(rollup@4.41.1) - std-env: 3.8.1 + postcss: 8.5.3 + rollup-plugin-visualizer: 5.14.0(rollup@4.40.2) + std-env: 3.9.0 strip-literal: 2.1.1 - ufo: 1.5.4 + ufo: 1.6.1 unenv: 1.10.0 unplugin: 1.16.1 - vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0) - vite-node: 2.1.9(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0) - vite-plugin-checker: 0.8.0(eslint@9.17.0(jiti@2.4.2))(optionator@0.9.4)(typescript@5.8.3)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)) + vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1) + vite-node: 2.1.9(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1) + vite-plugin-checker: 0.8.0(eslint@9.17.0(jiti@2.4.2))(optionator@0.9.4)(typescript@5.8.3)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)) vue: 3.5.13(typescript@5.8.3) vue-bundle-renderer: 2.1.1 transitivePeerDependencies: @@ -15141,6 +15951,48 @@ snapshots: - vti - vue-tsc + '@nx/devkit@20.7.2(nx@21.0.3)': + dependencies: + ejs: 3.1.10 + enquirer: 2.3.6 + ignore: 5.3.2 + minimatch: 9.0.3 + nx: 21.0.3 + semver: 7.7.2 + tmp: 0.2.3 + tslib: 2.8.1 + yargs-parser: 21.1.1 + + '@nx/nx-darwin-arm64@21.0.3': + optional: true + + '@nx/nx-darwin-x64@21.0.3': + optional: true + + '@nx/nx-freebsd-x64@21.0.3': + optional: true + + '@nx/nx-linux-arm-gnueabihf@21.0.3': + optional: true + + '@nx/nx-linux-arm64-gnu@21.0.3': + optional: true + + '@nx/nx-linux-arm64-musl@21.0.3': + optional: true + + '@nx/nx-linux-x64-gnu@21.0.3': + optional: true + + '@nx/nx-linux-x64-musl@21.0.3': + optional: true + + '@nx/nx-win32-arm64-msvc@21.0.3': + optional: true + + '@nx/nx-win32-x64-msvc@21.0.3': + optional: true + '@one-ini/wasm@0.1.1': {} '@parcel/watcher-android-arm64@2.5.1': @@ -15211,9 +16063,21 @@ snapshots: '@pkgjs/parseargs@0.11.0': optional: true - '@pkgr/core@0.1.1': {} + '@pkgr/core@0.2.4': {} + + '@pnpm/config.env-replace@1.1.0': {} - '@polka/url@1.0.0-next.28': {} + '@pnpm/network.ca-file@1.0.2': + dependencies: + graceful-fs: 4.2.10 + + '@pnpm/npm-conf@2.3.1': + dependencies: + '@pnpm/config.env-replace': 1.1.0 + '@pnpm/network.ca-file': 1.0.2 + config-chain: 1.1.13 + + '@polka/url@1.0.0-next.29': {} '@poppinss/colors@4.1.4': dependencies: @@ -15243,85 +16107,88 @@ snapshots: '@radix-ui/colors@3.0.0': {} - '@radix-ui/number@1.1.0': {} + '@radix-ui/number@1.1.1': {} '@radix-ui/primitive@1.1.1': {} - '@radix-ui/react-accessible-icon@1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@radix-ui/primitive@1.1.2': {} + + '@radix-ui/react-accessible-icon@1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: - '@radix-ui/react-visually-hidden': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-visually-hidden': 1.2.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-alert-dialog@1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@radix-ui/react-alert-dialog@1.1.13(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-dialog': 1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-slot': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/primitive': 1.1.2 + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-dialog': 1.1.13(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-slot': 1.2.2(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-arrow@1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@radix-ui/react-arrow@1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-aspect-ratio@1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@radix-ui/react-aspect-ratio@1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-avatar@1.1.3(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@radix-ui/react-avatar@1.1.9(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-is-hydrated': 0.1.0(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-checkbox@1.1.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@radix-ui/react-checkbox@1.3.1(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-presence': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-previous': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-size': 1.1.0(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/primitive': 1.1.2 + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-presence': 1.1.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-previous': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-size': 1.1.1(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-collection@1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@radix-ui/react-collection@1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-slot': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-slot': 1.2.2(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: @@ -15334,14 +16201,20 @@ snapshots: optionalDependencies: '@types/react': 19.0.1 - '@radix-ui/react-context-menu@2.2.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@radix-ui/react-compose-refs@1.1.2(@types/react@19.0.1)(react@19.0.0)': dependencies: - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-menu': 2.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@19.0.1)(react@19.0.0) + react: 19.0.0 + optionalDependencies: + '@types/react': 19.0.1 + + '@radix-ui/react-context-menu@2.2.14(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + dependencies: + '@radix-ui/primitive': 1.1.2 + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-menu': 2.1.14(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: @@ -15354,20 +16227,26 @@ snapshots: optionalDependencies: '@types/react': 19.0.1 - '@radix-ui/react-dialog@1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@radix-ui/react-context@1.1.2(@types/react@19.0.1)(react@19.0.0)': dependencies: - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-dismissable-layer': 1.1.5(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-focus-guards': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-focus-scope': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-id': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-portal': 1.1.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-presence': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-slot': 1.1.2(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@19.0.1)(react@19.0.0) + react: 19.0.0 + optionalDependencies: + '@types/react': 19.0.1 + + '@radix-ui/react-dialog@1.1.13(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + dependencies: + '@radix-ui/primitive': 1.1.2 + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-dismissable-layer': 1.1.9(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-focus-guards': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-focus-scope': 1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-id': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-portal': 1.1.8(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-presence': 1.1.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-slot': 1.2.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.0.1)(react@19.0.0) aria-hidden: 1.2.4 react: 19.0.0 react-dom: 19.0.0(react@19.0.0) @@ -15376,51 +16255,51 @@ snapshots: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-direction@1.1.0(@types/react@19.0.1)(react@19.0.0)': + '@radix-ui/react-direction@1.1.1(@types/react@19.0.1)(react@19.0.0)': dependencies: react: 19.0.0 optionalDependencies: '@types/react': 19.0.1 - '@radix-ui/react-dismissable-layer@1.1.5(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@radix-ui/react-dismissable-layer@1.1.9(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-escape-keydown': 1.1.0(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/primitive': 1.1.2 + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-escape-keydown': 1.1.1(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-dropdown-menu@2.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@radix-ui/react-dropdown-menu@2.1.14(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-id': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-menu': 2.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/primitive': 1.1.2 + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-id': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-menu': 2.1.14(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-focus-guards@1.1.1(@types/react@19.0.1)(react@19.0.0)': + '@radix-ui/react-focus-guards@1.1.2(@types/react@19.0.1)(react@19.0.0)': dependencies: react: 19.0.0 optionalDependencies: '@types/react': 19.0.1 - '@radix-ui/react-focus-scope@1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@radix-ui/react-focus-scope@1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: @@ -15441,17 +16320,17 @@ snapshots: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-hover-card@1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': - dependencies: - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-dismissable-layer': 1.1.5(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-popper': 1.2.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-portal': 1.1.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-presence': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-hover-card@1.1.13(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + dependencies: + '@radix-ui/primitive': 1.1.2 + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-dismissable-layer': 1.1.9(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-popper': 1.2.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-portal': 1.1.8(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-presence': 1.1.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: @@ -15469,6 +16348,13 @@ snapshots: optionalDependencies: '@types/react': 19.0.1 + '@radix-ui/react-id@1.1.1(@types/react@19.0.1)(react@19.0.0)': + dependencies: + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.0.1)(react@19.0.0) + react: 19.0.0 + optionalDependencies: + '@types/react': 19.0.1 + '@radix-ui/react-label@2.1.1(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: '@radix-ui/react-primitive': 2.0.1(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) @@ -15478,24 +16364,24 @@ snapshots: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-menu@2.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': - dependencies: - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-collection': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-direction': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-dismissable-layer': 1.1.5(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-focus-guards': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-focus-scope': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-id': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-popper': 1.2.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-portal': 1.1.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-presence': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-roving-focus': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-slot': 1.1.2(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-menu@2.1.14(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + dependencies: + '@radix-ui/primitive': 1.1.2 + '@radix-ui/react-collection': 1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-direction': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-dismissable-layer': 1.1.9(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-focus-guards': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-focus-scope': 1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-id': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-popper': 1.2.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-portal': 1.1.8(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-presence': 1.1.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-roving-focus': 1.1.9(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-slot': 1.2.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.0.1)(react@19.0.0) aria-hidden: 1.2.4 react: 19.0.0 react-dom: 19.0.0(react@19.0.0) @@ -15504,43 +16390,43 @@ snapshots: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-navigation-menu@1.2.5(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': - dependencies: - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-collection': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-direction': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-dismissable-layer': 1.1.5(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-id': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-presence': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-previous': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-visually-hidden': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-navigation-menu@1.2.12(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + dependencies: + '@radix-ui/primitive': 1.1.2 + '@radix-ui/react-collection': 1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-direction': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-dismissable-layer': 1.1.9(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-id': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-presence': 1.1.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-previous': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-visually-hidden': 1.2.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-popover@1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': - dependencies: - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-dismissable-layer': 1.1.5(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-focus-guards': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-focus-scope': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-id': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-popper': 1.2.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-portal': 1.1.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-presence': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-slot': 1.1.2(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-popover@1.1.13(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + dependencies: + '@radix-ui/primitive': 1.1.2 + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-dismissable-layer': 1.1.9(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-focus-guards': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-focus-scope': 1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-id': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-popper': 1.2.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-portal': 1.1.8(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-presence': 1.1.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-slot': 1.2.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.0.1)(react@19.0.0) aria-hidden: 1.2.4 react: 19.0.0 react-dom: 19.0.0(react@19.0.0) @@ -15549,38 +16435,38 @@ snapshots: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-popper@1.2.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@radix-ui/react-popper@1.2.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: '@floating-ui/react-dom': 2.1.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-arrow': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-rect': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-size': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/rect': 1.1.0 + '@radix-ui/react-arrow': 1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-rect': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-size': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/rect': 1.1.1 react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-portal@1.1.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@radix-ui/react-portal@1.1.8(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-presence@1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@radix-ui/react-presence@1.1.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: @@ -15596,98 +16482,98 @@ snapshots: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-primitive@2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@radix-ui/react-primitive@2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: - '@radix-ui/react-slot': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-slot': 1.2.2(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-progress@1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@radix-ui/react-progress@1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-radio-group@1.2.3(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': - dependencies: - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-direction': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-presence': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-roving-focus': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-previous': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-size': 1.1.0(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-radio-group@1.3.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + dependencies: + '@radix-ui/primitive': 1.1.2 + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-direction': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-presence': 1.1.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-roving-focus': 1.1.9(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-previous': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-size': 1.1.1(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-roving-focus@1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': - dependencies: - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-collection': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-direction': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-id': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-roving-focus@1.1.9(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + dependencies: + '@radix-ui/primitive': 1.1.2 + '@radix-ui/react-collection': 1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-direction': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-id': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-scroll-area@1.2.3(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': - dependencies: - '@radix-ui/number': 1.1.0 - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-direction': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-presence': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-scroll-area@1.2.8(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + dependencies: + '@radix-ui/number': 1.1.1 + '@radix-ui/primitive': 1.1.2 + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-direction': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-presence': 1.1.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-select@2.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': - dependencies: - '@radix-ui/number': 1.1.0 - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-collection': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-direction': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-dismissable-layer': 1.1.5(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-focus-guards': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-focus-scope': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-id': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-popper': 1.2.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-portal': 1.1.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-slot': 1.1.2(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-previous': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-visually-hidden': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-select@2.2.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + dependencies: + '@radix-ui/number': 1.1.1 + '@radix-ui/primitive': 1.1.2 + '@radix-ui/react-collection': 1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-direction': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-dismissable-layer': 1.1.9(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-focus-guards': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-focus-scope': 1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-id': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-popper': 1.2.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-portal': 1.1.8(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-slot': 1.2.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-previous': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-visually-hidden': 1.2.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) aria-hidden: 1.2.4 react: 19.0.0 react-dom: 19.0.0(react@19.0.0) @@ -15696,19 +16582,19 @@ snapshots: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-slider@1.2.3(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': - dependencies: - '@radix-ui/number': 1.1.0 - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-collection': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-direction': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-previous': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-size': 1.1.0(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-slider@1.3.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + dependencies: + '@radix-ui/number': 1.1.1 + '@radix-ui/primitive': 1.1.2 + '@radix-ui/react-collection': 1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-direction': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-previous': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-size': 1.1.1(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: @@ -15722,107 +16608,122 @@ snapshots: optionalDependencies: '@types/react': 19.0.1 - '@radix-ui/react-slot@1.1.2(@types/react@19.0.1)(react@19.0.0)': + '@radix-ui/react-slot@1.2.2(@types/react@19.0.1)(react@19.0.0)': dependencies: - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 optionalDependencies: '@types/react': 19.0.1 - '@radix-ui/react-switch@1.1.3(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@radix-ui/react-switch@1.2.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-previous': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-size': 1.1.0(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/primitive': 1.1.2 + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-previous': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-size': 1.1.1(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-tabs@1.1.3(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@radix-ui/react-tabs@1.1.11(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-direction': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-id': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-presence': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-roving-focus': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/primitive': 1.1.2 + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-direction': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-id': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-presence': 1.1.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-roving-focus': 1.1.9(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-toggle-group@1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@radix-ui/react-toggle-group@1.1.9(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-direction': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-roving-focus': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-toggle': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/primitive': 1.1.2 + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-direction': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-roving-focus': 1.1.9(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-toggle': 1.1.8(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-toggle@1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@radix-ui/react-toggle@1.1.8(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/primitive': 1.1.2 + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-tooltip@1.1.8(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': - dependencies: - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-dismissable-layer': 1.1.5(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-id': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-popper': 1.2.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-portal': 1.1.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-presence': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-slot': 1.1.2(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-visually-hidden': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-tooltip@1.2.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + dependencies: + '@radix-ui/primitive': 1.1.2 + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-dismissable-layer': 1.1.9(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-id': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-popper': 1.2.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-portal': 1.1.8(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-presence': 1.1.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-slot': 1.2.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-visually-hidden': 1.2.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/react-use-callback-ref@1.1.0(@types/react@19.0.1)(react@19.0.0)': + '@radix-ui/react-use-callback-ref@1.1.1(@types/react@19.0.1)(react@19.0.0)': + dependencies: + react: 19.0.0 + optionalDependencies: + '@types/react': 19.0.1 + + '@radix-ui/react-use-controllable-state@1.2.2(@types/react@19.0.1)(react@19.0.0)': + dependencies: + '@radix-ui/react-use-effect-event': 0.0.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.0.1)(react@19.0.0) + react: 19.0.0 + optionalDependencies: + '@types/react': 19.0.1 + + '@radix-ui/react-use-effect-event@0.0.2(@types/react@19.0.1)(react@19.0.0)': dependencies: + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 optionalDependencies: '@types/react': 19.0.1 - '@radix-ui/react-use-controllable-state@1.1.0(@types/react@19.0.1)(react@19.0.0)': + '@radix-ui/react-use-escape-keydown@1.1.1(@types/react@19.0.1)(react@19.0.0)': dependencies: - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 optionalDependencies: '@types/react': 19.0.1 - '@radix-ui/react-use-escape-keydown@1.1.0(@types/react@19.0.1)(react@19.0.0)': + '@radix-ui/react-use-is-hydrated@0.1.0(@types/react@19.0.1)(react@19.0.0)': dependencies: - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 + use-sync-external-store: 1.5.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 @@ -15832,109 +16733,92 @@ snapshots: optionalDependencies: '@types/react': 19.0.1 - '@radix-ui/react-use-previous@1.1.0(@types/react@19.0.1)(react@19.0.0)': + '@radix-ui/react-use-layout-effect@1.1.1(@types/react@19.0.1)(react@19.0.0)': dependencies: react: 19.0.0 optionalDependencies: '@types/react': 19.0.1 - '@radix-ui/react-use-rect@1.1.0(@types/react@19.0.1)(react@19.0.0)': + '@radix-ui/react-use-previous@1.1.1(@types/react@19.0.1)(react@19.0.0)': dependencies: - '@radix-ui/rect': 1.1.0 react: 19.0.0 optionalDependencies: '@types/react': 19.0.1 - '@radix-ui/react-use-size@1.1.0(@types/react@19.0.1)(react@19.0.0)': + '@radix-ui/react-use-rect@1.1.1(@types/react@19.0.1)(react@19.0.0)': dependencies: - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/rect': 1.1.1 + react: 19.0.0 + optionalDependencies: + '@types/react': 19.0.1 + + '@radix-ui/react-use-size@1.1.1(@types/react@19.0.1)(react@19.0.0)': + dependencies: + '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.0.1)(react@19.0.0) react: 19.0.0 optionalDependencies: '@types/react': 19.0.1 - '@radix-ui/react-visually-hidden@1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@radix-ui/react-visually-hidden@1.2.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) react: 19.0.0 react-dom: 19.0.0(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 '@types/react-dom': 19.0.1 - '@radix-ui/rect@1.1.0': {} + '@radix-ui/rect@1.1.1': {} '@radix-ui/themes@3.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: '@radix-ui/colors': 3.0.0 - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-accessible-icon': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-alert-dialog': 1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-aspect-ratio': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-avatar': 1.1.3(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-checkbox': 1.1.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-context': 1.1.1(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-context-menu': 2.2.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-dialog': 1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-direction': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-dropdown-menu': 2.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-hover-card': 1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-navigation-menu': 1.2.5(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-popover': 1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-portal': 1.1.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-progress': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-radio-group': 1.2.3(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-roving-focus': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-scroll-area': 1.2.3(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-select': 2.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-slider': 1.2.3(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-slot': 1.1.2(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-switch': 1.1.3(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-tabs': 1.1.3(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-toggle-group': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-tooltip': 1.1.8(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@19.0.1)(react@19.0.0) - '@radix-ui/react-visually-hidden': 1.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/primitive': 1.1.2 + '@radix-ui/react-accessible-icon': 1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-alert-dialog': 1.1.13(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-aspect-ratio': 1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-avatar': 1.1.9(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-checkbox': 1.3.1(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-context': 1.1.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-context-menu': 2.2.14(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-dialog': 1.1.13(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-direction': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-dropdown-menu': 2.1.14(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-hover-card': 1.1.13(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-navigation-menu': 1.2.12(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-popover': 1.1.13(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-portal': 1.1.8(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-progress': 1.1.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-radio-group': 1.3.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-roving-focus': 1.1.9(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-scroll-area': 1.2.8(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-select': 2.2.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-slider': 1.3.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-slot': 1.2.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-switch': 1.2.4(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-tabs': 1.1.11(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-toggle-group': 1.1.9(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-tooltip': 1.2.6(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.0.1)(react@19.0.0) + '@radix-ui/react-visually-hidden': 1.2.2(@types/react-dom@19.0.1)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) classnames: 2.5.1 react: 19.0.0 react-dom: 19.0.0(react@19.0.0) react-remove-scroll-bar: 2.3.8(@types/react@19.0.1)(react@19.0.0) optionalDependencies: '@types/react': 19.0.1 - '@types/react-dom': 19.0.1 - - '@redocly/ajv@8.11.2': - dependencies: - fast-deep-equal: 3.1.3 - json-schema-traverse: 1.0.0 - require-from-string: 2.0.2 - uri-js-replace: 1.0.1 - - '@redocly/config@0.22.1': {} - - '@redocly/openapi-core@1.33.1(supports-color@9.4.0)': - dependencies: - '@redocly/ajv': 8.11.2 - '@redocly/config': 0.22.1 - colorette: 1.4.0 - https-proxy-agent: 7.0.6(supports-color@9.4.0) - js-levenshtein: 1.1.6 - js-yaml: 4.1.0 - minimatch: 5.1.6 - pluralize: 8.0.0 - yaml-ast-parser: 0.0.43 - transitivePeerDependencies: - - supports-color + '@types/react-dom': 19.0.1 '@rollup/plugin-alias@5.1.1(rollup@3.29.5)': optionalDependencies: rollup: 3.29.5 - '@rollup/plugin-alias@5.1.1(rollup@4.41.1)': + '@rollup/plugin-alias@5.1.1(rollup@4.40.2)': optionalDependencies: - rollup: 4.41.1 + rollup: 4.40.2 '@rollup/plugin-commonjs@25.0.8(rollup@3.29.5)': dependencies: @@ -15947,25 +16831,25 @@ snapshots: optionalDependencies: rollup: 3.29.5 - '@rollup/plugin-commonjs@28.0.3(rollup@4.41.1)': + '@rollup/plugin-commonjs@28.0.3(rollup@4.40.2)': dependencies: - '@rollup/pluginutils': 5.1.4(rollup@4.41.1) + '@rollup/pluginutils': 5.1.4(rollup@4.40.2) commondir: 1.0.1 estree-walker: 2.0.2 - fdir: 6.4.3(picomatch@4.0.2) + fdir: 6.4.4(picomatch@4.0.2) is-reference: 1.2.1 magic-string: 0.30.17 picomatch: 4.0.2 optionalDependencies: - rollup: 4.41.1 + rollup: 4.40.2 - '@rollup/plugin-inject@5.0.5(rollup@4.41.1)': + '@rollup/plugin-inject@5.0.5(rollup@4.40.2)': dependencies: - '@rollup/pluginutils': 5.1.4(rollup@4.41.1) + '@rollup/pluginutils': 5.1.4(rollup@4.40.2) estree-walker: 2.0.2 magic-string: 0.30.17 optionalDependencies: - rollup: 4.41.1 + rollup: 4.40.2 '@rollup/plugin-json@6.1.0(rollup@3.29.5)': dependencies: @@ -15973,11 +16857,11 @@ snapshots: optionalDependencies: rollup: 3.29.5 - '@rollup/plugin-json@6.1.0(rollup@4.41.1)': + '@rollup/plugin-json@6.1.0(rollup@4.40.2)': dependencies: - '@rollup/pluginutils': 5.1.4(rollup@4.41.1) + '@rollup/pluginutils': 5.1.4(rollup@4.40.2) optionalDependencies: - rollup: 4.41.1 + rollup: 4.40.2 '@rollup/plugin-node-resolve@15.3.1(rollup@3.29.5)': dependencies: @@ -15989,15 +16873,15 @@ snapshots: optionalDependencies: rollup: 3.29.5 - '@rollup/plugin-node-resolve@16.0.1(rollup@4.41.1)': + '@rollup/plugin-node-resolve@16.0.1(rollup@4.40.2)': dependencies: - '@rollup/pluginutils': 5.1.4(rollup@4.41.1) + '@rollup/pluginutils': 5.1.4(rollup@4.40.2) '@types/resolve': 1.20.2 deepmerge: 4.3.1 is-module: 1.0.0 resolve: 1.22.10 optionalDependencies: - rollup: 4.41.1 + rollup: 4.40.2 '@rollup/plugin-replace@5.0.7(rollup@3.29.5)': dependencies: @@ -16013,20 +16897,20 @@ snapshots: optionalDependencies: rollup: 3.29.5 - '@rollup/plugin-replace@6.0.2(rollup@4.41.1)': + '@rollup/plugin-replace@6.0.2(rollup@4.40.2)': dependencies: - '@rollup/pluginutils': 5.1.4(rollup@4.41.1) + '@rollup/pluginutils': 5.1.4(rollup@4.40.2) magic-string: 0.30.17 optionalDependencies: - rollup: 4.41.1 + rollup: 4.40.2 - '@rollup/plugin-terser@0.4.4(rollup@4.41.1)': + '@rollup/plugin-terser@0.4.4(rollup@4.40.2)': dependencies: serialize-javascript: 6.0.2 smob: 1.5.0 - terser: 5.39.0 + terser: 5.39.1 optionalDependencies: - rollup: 4.41.1 + rollup: 4.40.2 '@rollup/pluginutils@5.1.4(rollup@3.29.5)': dependencies: @@ -16036,13 +16920,13 @@ snapshots: optionalDependencies: rollup: 3.29.5 - '@rollup/pluginutils@5.1.4(rollup@4.41.1)': + '@rollup/pluginutils@5.1.4(rollup@4.40.2)': dependencies: '@types/estree': 1.0.7 estree-walker: 2.0.2 picomatch: 4.0.2 optionalDependencies: - rollup: 4.41.1 + rollup: 4.40.2 '@rollup/rollup-android-arm-eabi@4.31.0': optional: true @@ -16050,10 +16934,7 @@ snapshots: '@rollup/rollup-android-arm-eabi@4.34.8': optional: true - '@rollup/rollup-android-arm-eabi@4.39.0': - optional: true - - '@rollup/rollup-android-arm-eabi@4.41.1': + '@rollup/rollup-android-arm-eabi@4.40.2': optional: true '@rollup/rollup-android-arm64@4.31.0': @@ -16062,10 +16943,7 @@ snapshots: '@rollup/rollup-android-arm64@4.34.8': optional: true - '@rollup/rollup-android-arm64@4.39.0': - optional: true - - '@rollup/rollup-android-arm64@4.41.1': + '@rollup/rollup-android-arm64@4.40.2': optional: true '@rollup/rollup-darwin-arm64@4.31.0': @@ -16074,10 +16952,7 @@ snapshots: '@rollup/rollup-darwin-arm64@4.34.8': optional: true - '@rollup/rollup-darwin-arm64@4.39.0': - optional: true - - '@rollup/rollup-darwin-arm64@4.41.1': + '@rollup/rollup-darwin-arm64@4.40.2': optional: true '@rollup/rollup-darwin-x64@4.31.0': @@ -16086,10 +16961,7 @@ snapshots: '@rollup/rollup-darwin-x64@4.34.8': optional: true - '@rollup/rollup-darwin-x64@4.39.0': - optional: true - - '@rollup/rollup-darwin-x64@4.41.1': + '@rollup/rollup-darwin-x64@4.40.2': optional: true '@rollup/rollup-freebsd-arm64@4.31.0': @@ -16098,10 +16970,7 @@ snapshots: '@rollup/rollup-freebsd-arm64@4.34.8': optional: true - '@rollup/rollup-freebsd-arm64@4.39.0': - optional: true - - '@rollup/rollup-freebsd-arm64@4.41.1': + '@rollup/rollup-freebsd-arm64@4.40.2': optional: true '@rollup/rollup-freebsd-x64@4.31.0': @@ -16110,10 +16979,7 @@ snapshots: '@rollup/rollup-freebsd-x64@4.34.8': optional: true - '@rollup/rollup-freebsd-x64@4.39.0': - optional: true - - '@rollup/rollup-freebsd-x64@4.41.1': + '@rollup/rollup-freebsd-x64@4.40.2': optional: true '@rollup/rollup-linux-arm-gnueabihf@4.31.0': @@ -16122,10 +16988,7 @@ snapshots: '@rollup/rollup-linux-arm-gnueabihf@4.34.8': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.39.0': - optional: true - - '@rollup/rollup-linux-arm-gnueabihf@4.41.1': + '@rollup/rollup-linux-arm-gnueabihf@4.40.2': optional: true '@rollup/rollup-linux-arm-musleabihf@4.31.0': @@ -16134,10 +16997,7 @@ snapshots: '@rollup/rollup-linux-arm-musleabihf@4.34.8': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.39.0': - optional: true - - '@rollup/rollup-linux-arm-musleabihf@4.41.1': + '@rollup/rollup-linux-arm-musleabihf@4.40.2': optional: true '@rollup/rollup-linux-arm64-gnu@4.31.0': @@ -16146,10 +17006,7 @@ snapshots: '@rollup/rollup-linux-arm64-gnu@4.34.8': optional: true - '@rollup/rollup-linux-arm64-gnu@4.39.0': - optional: true - - '@rollup/rollup-linux-arm64-gnu@4.41.1': + '@rollup/rollup-linux-arm64-gnu@4.40.2': optional: true '@rollup/rollup-linux-arm64-musl@4.31.0': @@ -16158,10 +17015,7 @@ snapshots: '@rollup/rollup-linux-arm64-musl@4.34.8': optional: true - '@rollup/rollup-linux-arm64-musl@4.39.0': - optional: true - - '@rollup/rollup-linux-arm64-musl@4.41.1': + '@rollup/rollup-linux-arm64-musl@4.40.2': optional: true '@rollup/rollup-linux-loongarch64-gnu@4.31.0': @@ -16170,10 +17024,7 @@ snapshots: '@rollup/rollup-linux-loongarch64-gnu@4.34.8': optional: true - '@rollup/rollup-linux-loongarch64-gnu@4.39.0': - optional: true - - '@rollup/rollup-linux-loongarch64-gnu@4.41.1': + '@rollup/rollup-linux-loongarch64-gnu@4.40.2': optional: true '@rollup/rollup-linux-powerpc64le-gnu@4.31.0': @@ -16182,10 +17033,7 @@ snapshots: '@rollup/rollup-linux-powerpc64le-gnu@4.34.8': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.39.0': - optional: true - - '@rollup/rollup-linux-powerpc64le-gnu@4.41.1': + '@rollup/rollup-linux-powerpc64le-gnu@4.40.2': optional: true '@rollup/rollup-linux-riscv64-gnu@4.31.0': @@ -16194,16 +17042,10 @@ snapshots: '@rollup/rollup-linux-riscv64-gnu@4.34.8': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.39.0': - optional: true - - '@rollup/rollup-linux-riscv64-gnu@4.41.1': + '@rollup/rollup-linux-riscv64-gnu@4.40.2': optional: true - '@rollup/rollup-linux-riscv64-musl@4.39.0': - optional: true - - '@rollup/rollup-linux-riscv64-musl@4.41.1': + '@rollup/rollup-linux-riscv64-musl@4.40.2': optional: true '@rollup/rollup-linux-s390x-gnu@4.31.0': @@ -16212,10 +17054,7 @@ snapshots: '@rollup/rollup-linux-s390x-gnu@4.34.8': optional: true - '@rollup/rollup-linux-s390x-gnu@4.39.0': - optional: true - - '@rollup/rollup-linux-s390x-gnu@4.41.1': + '@rollup/rollup-linux-s390x-gnu@4.40.2': optional: true '@rollup/rollup-linux-x64-gnu@4.31.0': @@ -16224,10 +17063,7 @@ snapshots: '@rollup/rollup-linux-x64-gnu@4.34.8': optional: true - '@rollup/rollup-linux-x64-gnu@4.39.0': - optional: true - - '@rollup/rollup-linux-x64-gnu@4.41.1': + '@rollup/rollup-linux-x64-gnu@4.40.2': optional: true '@rollup/rollup-linux-x64-gnu@4.44.0': @@ -16239,10 +17075,7 @@ snapshots: '@rollup/rollup-linux-x64-musl@4.34.8': optional: true - '@rollup/rollup-linux-x64-musl@4.39.0': - optional: true - - '@rollup/rollup-linux-x64-musl@4.41.1': + '@rollup/rollup-linux-x64-musl@4.40.2': optional: true '@rollup/rollup-win32-arm64-msvc@4.31.0': @@ -16251,10 +17084,7 @@ snapshots: '@rollup/rollup-win32-arm64-msvc@4.34.8': optional: true - '@rollup/rollup-win32-arm64-msvc@4.39.0': - optional: true - - '@rollup/rollup-win32-arm64-msvc@4.41.1': + '@rollup/rollup-win32-arm64-msvc@4.40.2': optional: true '@rollup/rollup-win32-ia32-msvc@4.31.0': @@ -16263,10 +17093,7 @@ snapshots: '@rollup/rollup-win32-ia32-msvc@4.34.8': optional: true - '@rollup/rollup-win32-ia32-msvc@4.39.0': - optional: true - - '@rollup/rollup-win32-ia32-msvc@4.41.1': + '@rollup/rollup-win32-ia32-msvc@4.40.2': optional: true '@rollup/rollup-win32-x64-msvc@4.31.0': @@ -16275,10 +17102,7 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.34.8': optional: true - '@rollup/rollup-win32-x64-msvc@4.39.0': - optional: true - - '@rollup/rollup-win32-x64-msvc@4.41.1': + '@rollup/rollup-win32-x64-msvc@4.40.2': optional: true '@rtsao/scc@1.1.0': {} @@ -16295,13 +17119,12 @@ snapshots: '@sec-ant/readable-stream@0.4.1': {} - '@seriousme/openapi-schema-validator@2.3.1': + '@seriousme/openapi-schema-validator@2.4.1': dependencies: ajv: 8.17.1 ajv-draft-04: 1.0.0(ajv@8.17.1) ajv-formats: 3.0.1(ajv@8.17.1) js-yaml: 4.1.0 - minimist: 1.2.8 '@shikijs/core@1.29.2': dependencies: @@ -16345,35 +17168,37 @@ snapshots: '@sigstore/bundle@3.1.0': dependencies: - '@sigstore/protobuf-specs': 0.4.0 + '@sigstore/protobuf-specs': 0.4.1 '@sigstore/core@2.0.0': {} - '@sigstore/protobuf-specs@0.4.0': {} + '@sigstore/protobuf-specs@0.4.1': {} '@sigstore/sign@3.1.0': dependencies: '@sigstore/bundle': 3.1.0 '@sigstore/core': 2.0.0 - '@sigstore/protobuf-specs': 0.4.0 + '@sigstore/protobuf-specs': 0.4.1 make-fetch-happen: 14.0.3 proc-log: 5.0.0 promise-retry: 2.0.1 transitivePeerDependencies: - supports-color - '@sigstore/tuf@3.1.0': + '@sigstore/tuf@3.1.1': dependencies: - '@sigstore/protobuf-specs': 0.4.0 + '@sigstore/protobuf-specs': 0.4.1 tuf-js: 3.0.1 transitivePeerDependencies: - supports-color - '@sigstore/verify@2.1.0': + '@sigstore/verify@2.1.1': dependencies: '@sigstore/bundle': 3.1.0 '@sigstore/core': 2.0.0 - '@sigstore/protobuf-specs': 0.4.0 + '@sigstore/protobuf-specs': 0.4.1 + + '@sinclair/typebox@0.27.8': {} '@sindresorhus/is@4.6.0': {} @@ -16389,14 +17214,14 @@ snapshots: '@stackblitz/sdk@1.11.0': {} - '@sveltejs/adapter-auto@4.0.0(@sveltejs/kit@2.17.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)))(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)))': + '@sveltejs/adapter-auto@4.0.0(@sveltejs/kit@2.17.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)))(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)))': dependencies: - '@sveltejs/kit': 2.17.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)))(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) + '@sveltejs/kit': 2.17.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)))(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) import-meta-resolve: 4.1.0 - '@sveltejs/kit@2.17.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)))(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))': + '@sveltejs/kit@2.17.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)))(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))': dependencies: - '@sveltejs/vite-plugin-svelte': 5.0.3(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) + '@sveltejs/vite-plugin-svelte': 5.0.3(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) '@types/cookie': 0.6.0 cookie: 0.6.0 devalue: 5.1.1 @@ -16409,27 +17234,27 @@ snapshots: set-cookie-parser: 2.7.1 sirv: 3.0.1 svelte: 5.19.9 - vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) - '@sveltejs/vite-plugin-svelte-inspector@4.0.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)))(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))': + '@sveltejs/vite-plugin-svelte-inspector@4.0.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)))(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))': dependencies: - '@sveltejs/vite-plugin-svelte': 5.0.3(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) - debug: 4.4.0(supports-color@9.4.0) + '@sveltejs/vite-plugin-svelte': 5.0.3(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) + debug: 4.4.1 svelte: 5.19.9 - vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) transitivePeerDependencies: - supports-color - '@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))': + '@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))': dependencies: - '@sveltejs/vite-plugin-svelte-inspector': 4.0.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)))(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) - debug: 4.4.0(supports-color@9.4.0) + '@sveltejs/vite-plugin-svelte-inspector': 4.0.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)))(svelte@5.19.9)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) + debug: 4.4.1 deepmerge: 4.3.1 kleur: 4.1.5 magic-string: 0.30.17 svelte: 5.19.9 - vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) - vitefu: 1.0.6(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) + vitefu: 1.0.6(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) transitivePeerDependencies: - supports-color @@ -16465,10 +17290,10 @@ snapshots: '@tanstack/query-core': 5.73.3 react: 19.0.0 - '@tanstack/solid-query@5.73.3(solid-js@1.9.7)': + '@tanstack/solid-query@5.73.3(solid-js@1.9.6)': dependencies: '@tanstack/query-core': 5.73.3 - solid-js: 1.9.7 + solid-js: 1.9.6 '@tanstack/svelte-query@5.73.3(svelte@5.19.9)': dependencies: @@ -16510,26 +17335,30 @@ snapshots: '@tufjs/canonical-json': 2.0.0 minimatch: 9.0.5 + '@tybys/wasm-util@0.9.0': + dependencies: + tslib: 2.8.1 + '@types/babel__core@7.20.5': dependencies: - '@babel/parser': 7.26.10 - '@babel/types': 7.26.10 - '@types/babel__generator': 7.6.8 + '@babel/parser': 7.27.2 + '@babel/types': 7.27.1 + '@types/babel__generator': 7.27.0 '@types/babel__template': 7.4.4 - '@types/babel__traverse': 7.20.6 + '@types/babel__traverse': 7.20.7 - '@types/babel__generator@7.6.8': + '@types/babel__generator@7.27.0': dependencies: - '@babel/types': 7.26.10 + '@babel/types': 7.27.1 '@types/babel__template@7.4.4': dependencies: - '@babel/parser': 7.26.10 - '@babel/types': 7.26.10 + '@babel/parser': 7.27.2 + '@babel/types': 7.27.1 - '@types/babel__traverse@7.20.6': + '@types/babel__traverse@7.20.7': dependencies: - '@babel/types': 7.26.10 + '@babel/types': 7.27.1 '@types/body-parser@1.19.5': dependencies: @@ -16557,7 +17386,7 @@ snapshots: '@types/cookie@0.6.0': {} - '@types/cors@2.8.17': + '@types/cors@2.8.18': dependencies: '@types/node': 22.10.5 @@ -16572,7 +17401,7 @@ snapshots: '@types/eslint@9.6.0': dependencies: - '@types/estree': 1.0.6 + '@types/estree': 1.0.7 '@types/json-schema': 7.0.15 '@types/estree@1.0.6': {} @@ -16610,13 +17439,13 @@ snapshots: dependencies: '@types/node': 22.10.5 - '@types/jasmine@5.1.7': {} + '@types/jasmine@5.1.8': {} '@types/jsdom@21.1.7': dependencies: '@types/node': 22.10.5 '@types/tough-cookie': 4.0.5 - parse5: 7.2.1 + parse5: 7.3.0 '@types/json-schema@7.0.15': {} @@ -16647,7 +17476,11 @@ snapshots: dependencies: undici-types: 6.20.0 - '@types/parse-path@7.0.3': {} + '@types/normalize-package-data@2.4.4': {} + + '@types/parse-path@7.1.0': + dependencies: + parse-path: 7.1.0 '@types/qs@6.9.18': {} @@ -16688,11 +17521,13 @@ snapshots: '@types/tough-cookie@4.0.5': {} + '@types/triple-beam@1.3.5': {} + '@types/unist@3.0.3': {} '@types/web-bluetooth@0.0.20': {} - '@types/ws@8.18.0': + '@types/ws@8.18.1': dependencies: '@types/node': 22.10.5 @@ -16713,7 +17548,7 @@ snapshots: graphemer: 1.4.0 ignore: 5.3.2 natural-compare: 1.4.0 - ts-api-utils: 2.0.1(typescript@5.8.3) + ts-api-utils: 2.1.0(typescript@5.8.3) typescript: 5.8.3 transitivePeerDependencies: - supports-color @@ -16732,7 +17567,7 @@ snapshots: '@typescript-eslint/types': 8.29.1 '@typescript-eslint/typescript-estree': 8.29.1(typescript@5.8.3) '@typescript-eslint/visitor-keys': 8.29.1 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 eslint: 9.17.0(jiti@2.4.2) typescript: 5.8.3 transitivePeerDependencies: @@ -16752,9 +17587,9 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 8.29.1(typescript@5.8.3) '@typescript-eslint/utils': 8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3) - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 eslint: 9.17.0(jiti@2.4.2) - ts-api-utils: 2.0.1(typescript@5.8.3) + ts-api-utils: 2.1.0(typescript@5.8.3) typescript: 5.8.3 transitivePeerDependencies: - supports-color @@ -16767,7 +17602,7 @@ snapshots: dependencies: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/visitor-keys': 5.62.0 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 globby: 11.1.0 is-glob: 4.0.3 semver: 7.7.2 @@ -16781,19 +17616,19 @@ snapshots: dependencies: '@typescript-eslint/types': 8.29.1 '@typescript-eslint/visitor-keys': 8.29.1 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.7.2 - ts-api-utils: 2.0.1(typescript@5.8.3) + ts-api-utils: 2.1.0(typescript@5.8.3) typescript: 5.8.3 transitivePeerDependencies: - supports-color '@typescript-eslint/utils@5.62.0(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3)': dependencies: - '@eslint-community/eslint-utils': 4.5.0(eslint@9.17.0(jiti@2.4.2)) + '@eslint-community/eslint-utils': 4.7.0(eslint@9.17.0(jiti@2.4.2)) '@types/json-schema': 7.0.15 '@types/semver': 7.7.0 '@typescript-eslint/scope-manager': 5.62.0 @@ -16808,7 +17643,7 @@ snapshots: '@typescript-eslint/utils@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3)': dependencies: - '@eslint-community/eslint-utils': 4.5.0(eslint@9.17.0(jiti@2.4.2)) + '@eslint-community/eslint-utils': 4.7.0(eslint@9.17.0(jiti@2.4.2)) '@typescript-eslint/scope-manager': 8.29.1 '@typescript-eslint/types': 8.29.1 '@typescript-eslint/typescript-estree': 8.29.1(typescript@5.8.3) @@ -16857,10 +17692,82 @@ snapshots: unhead: 1.11.20 vue: 3.5.13(typescript@5.8.3) - '@vercel/nft@0.29.2(encoding@0.1.13)(rollup@4.41.1)': + '@unrs/resolver-binding-darwin-arm64@1.7.2': + optional: true + + '@unrs/resolver-binding-darwin-x64@1.7.2': + optional: true + + '@unrs/resolver-binding-freebsd-x64@1.7.2': + optional: true + + '@unrs/resolver-binding-linux-arm-gnueabihf@1.7.2': + optional: true + + '@unrs/resolver-binding-linux-arm-musleabihf@1.7.2': + optional: true + + '@unrs/resolver-binding-linux-arm64-gnu@1.7.2': + optional: true + + '@unrs/resolver-binding-linux-arm64-musl@1.7.2': + optional: true + + '@unrs/resolver-binding-linux-ppc64-gnu@1.7.2': + optional: true + + '@unrs/resolver-binding-linux-riscv64-gnu@1.7.2': + optional: true + + '@unrs/resolver-binding-linux-riscv64-musl@1.7.2': + optional: true + + '@unrs/resolver-binding-linux-s390x-gnu@1.7.2': + optional: true + + '@unrs/resolver-binding-linux-x64-gnu@1.7.2': + optional: true + + '@unrs/resolver-binding-linux-x64-musl@1.7.2': + optional: true + + '@unrs/resolver-binding-wasm32-wasi@1.7.2': + dependencies: + '@napi-rs/wasm-runtime': 0.2.9 + optional: true + + '@unrs/resolver-binding-win32-arm64-msvc@1.7.2': + optional: true + + '@unrs/resolver-binding-win32-ia32-msvc@1.7.2': + optional: true + + '@unrs/resolver-binding-win32-x64-msvc@1.7.2': + optional: true + + '@vercel/nft@0.27.7(encoding@0.1.13)(rollup@4.40.2)': + dependencies: + '@mapbox/node-pre-gyp': 1.0.11(encoding@0.1.13) + '@rollup/pluginutils': 5.1.4(rollup@4.40.2) + acorn: 8.14.1 + acorn-import-attributes: 1.9.5(acorn@8.14.1) + async-sema: 3.1.1 + bindings: 1.5.0 + estree-walker: 2.0.2 + glob: 7.2.3 + graceful-fs: 4.2.11 + micromatch: 4.0.8 + node-gyp-build: 4.8.4 + resolve-from: 5.0.0 + transitivePeerDependencies: + - encoding + - rollup + - supports-color + + '@vercel/nft@0.29.3(encoding@0.1.13)(rollup@4.40.2)': dependencies: '@mapbox/node-pre-gyp': 2.0.0(encoding@0.1.13) - '@rollup/pluginutils': 5.1.4(rollup@4.41.1) + '@rollup/pluginutils': 5.1.4(rollup@4.40.2) acorn: 8.14.1 acorn-import-attributes: 1.9.5(acorn@8.14.1) async-sema: 3.1.1 @@ -16880,71 +17787,66 @@ snapshots: dependencies: vite: 6.1.0(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) - '@vitejs/plugin-basic-ssl@1.2.0(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))': + '@vitejs/plugin-basic-ssl@1.2.0(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))': dependencies: - vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) - '@vitejs/plugin-react@4.4.0-beta.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))': + '@vitejs/plugin-react@4.4.0-beta.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))': dependencies: - '@babel/core': 7.26.10 - '@babel/plugin-transform-react-jsx-self': 7.25.9(@babel/core@7.26.10) - '@babel/plugin-transform-react-jsx-source': 7.25.9(@babel/core@7.26.10) + '@babel/core': 7.27.1 + '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-transform-react-jsx-source': 7.27.1(@babel/core@7.27.1) '@types/babel__core': 7.20.5 react-refresh: 0.14.2 - vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue-jsx@4.1.1(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0))(vue@3.5.13(typescript@5.8.3))': + '@vitejs/plugin-vue-jsx@4.1.1(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1))(vue@3.5.13(typescript@5.8.3))': dependencies: - '@babel/core': 7.26.10 - '@babel/plugin-transform-typescript': 7.26.8(@babel/core@7.26.10) - '@vue/babel-plugin-jsx': 1.4.0(@babel/core@7.26.10) - vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0) + '@babel/core': 7.27.1 + '@babel/plugin-transform-typescript': 7.27.1(@babel/core@7.27.1) + '@vue/babel-plugin-jsx': 1.4.0(@babel/core@7.27.1) + vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1) vue: 3.5.13(typescript@5.8.3) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue-jsx@4.1.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3))': + '@vitejs/plugin-vue-jsx@4.1.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3))': dependencies: - '@babel/core': 7.26.10 - '@babel/plugin-transform-typescript': 7.26.8(@babel/core@7.26.10) - '@vue/babel-plugin-jsx': 1.4.0(@babel/core@7.26.10) - vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + '@babel/core': 7.27.1 + '@babel/plugin-transform-typescript': 7.27.1(@babel/core@7.27.1) + '@vue/babel-plugin-jsx': 1.4.0(@babel/core@7.27.1) + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) vue: 3.5.13(typescript@5.8.3) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue@5.2.1(vite@5.4.14(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0))(vue@3.5.13(typescript@5.8.3))': - dependencies: - vite: 5.4.14(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0) - vue: 3.5.13(typescript@5.8.3) - - '@vitejs/plugin-vue@5.2.1(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0))(vue@3.5.13(typescript@5.8.3))': + '@vitejs/plugin-vue@5.2.1(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1))(vue@3.5.13(typescript@5.8.3))': dependencies: - vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0) + vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1) vue: 3.5.13(typescript@5.8.3) - '@vitejs/plugin-vue@5.2.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3))': + '@vitejs/plugin-vue@5.2.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3))': dependencies: - vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) vue: 3.5.13(typescript@5.8.3) - '@vitest/coverage-v8@3.1.1(vitest@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))': + '@vitest/coverage-v8@3.1.1(vitest@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))': dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 1.0.2 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 istanbul-lib-coverage: 3.2.2 istanbul-lib-report: 3.0.1 istanbul-lib-source-maps: 5.0.6 istanbul-reports: 3.1.7 magic-string: 0.30.17 magicast: 0.3.5 - std-env: 3.8.1 + std-env: 3.9.0 test-exclude: 7.0.1 tinyrainbow: 2.0.0 - vitest: 3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + vitest: 3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) transitivePeerDependencies: - supports-color @@ -16955,18 +17857,22 @@ snapshots: chai: 5.2.0 tinyrainbow: 2.0.0 - '@vitest/mocker@3.1.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))': + '@vitest/mocker@3.1.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))': dependencies: '@vitest/spy': 3.1.1 estree-walker: 3.0.3 magic-string: 0.30.17 optionalDependencies: - vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) '@vitest/pretty-format@3.1.1': dependencies: tinyrainbow: 2.0.0 + '@vitest/pretty-format@3.1.3': + dependencies: + tinyrainbow: 2.0.0 + '@vitest/runner@3.1.1': dependencies: '@vitest/utils': 3.1.1 @@ -16988,22 +17894,22 @@ snapshots: loupe: 3.1.3 tinyrainbow: 2.0.0 - '@volar/language-core@2.4.12': + '@volar/language-core@2.4.13': dependencies: - '@volar/source-map': 2.4.12 + '@volar/source-map': 2.4.13 - '@volar/source-map@2.4.12': {} + '@volar/source-map@2.4.13': {} - '@volar/typescript@2.4.12': + '@volar/typescript@2.4.13': dependencies: - '@volar/language-core': 2.4.12 + '@volar/language-core': 2.4.13 path-browserify: 1.0.1 vscode-uri: 3.1.0 '@vue-macros/common@1.16.1(vue@3.5.13(typescript@5.8.3))': dependencies: '@vue/compiler-sfc': 3.5.13 - ast-kit: 1.4.2 + ast-kit: 1.4.3 local-pkg: 1.1.1 magic-string-ast: 0.7.1 pathe: 2.0.3 @@ -17013,36 +17919,36 @@ snapshots: '@vue/babel-helper-vue-transform-on@1.4.0': {} - '@vue/babel-plugin-jsx@1.4.0(@babel/core@7.26.10)': + '@vue/babel-plugin-jsx@1.4.0(@babel/core@7.27.1)': dependencies: - '@babel/helper-module-imports': 7.25.9 - '@babel/helper-plugin-utils': 7.26.5 - '@babel/plugin-syntax-jsx': 7.25.9(@babel/core@7.26.10) - '@babel/template': 7.26.9 - '@babel/traverse': 7.26.10 - '@babel/types': 7.26.10 + '@babel/helper-module-imports': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.27.1) + '@babel/template': 7.27.2 + '@babel/traverse': 7.27.1 + '@babel/types': 7.27.1 '@vue/babel-helper-vue-transform-on': 1.4.0 - '@vue/babel-plugin-resolve-type': 1.4.0(@babel/core@7.26.10) + '@vue/babel-plugin-resolve-type': 1.4.0(@babel/core@7.27.1) '@vue/shared': 3.5.13 optionalDependencies: - '@babel/core': 7.26.10 + '@babel/core': 7.27.1 transitivePeerDependencies: - supports-color - '@vue/babel-plugin-resolve-type@1.4.0(@babel/core@7.26.10)': + '@vue/babel-plugin-resolve-type@1.4.0(@babel/core@7.27.1)': dependencies: - '@babel/code-frame': 7.26.2 - '@babel/core': 7.26.10 - '@babel/helper-module-imports': 7.25.9 - '@babel/helper-plugin-utils': 7.26.5 - '@babel/parser': 7.26.10 + '@babel/code-frame': 7.27.1 + '@babel/core': 7.27.1 + '@babel/helper-module-imports': 7.27.1 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/parser': 7.27.2 '@vue/compiler-sfc': 3.5.13 transitivePeerDependencies: - supports-color '@vue/compiler-core@3.5.13': dependencies: - '@babel/parser': 7.26.10 + '@babel/parser': 7.27.2 '@vue/shared': 3.5.13 entities: 4.5.0 estree-walker: 2.0.2 @@ -17055,14 +17961,14 @@ snapshots: '@vue/compiler-sfc@3.5.13': dependencies: - '@babel/parser': 7.26.10 + '@babel/parser': 7.27.2 '@vue/compiler-core': 3.5.13 '@vue/compiler-dom': 3.5.13 '@vue/compiler-ssr': 3.5.13 '@vue/shared': 3.5.13 estree-walker: 2.0.2 magic-string: 0.30.17 - postcss: 8.5.4 + postcss: 8.5.3 source-map-js: 1.2.1 '@vue/compiler-ssr@3.5.13': @@ -17077,37 +17983,49 @@ snapshots: '@vue/devtools-api@6.6.4': {} - '@vue/devtools-api@7.7.2': + '@vue/devtools-api@7.7.6': + dependencies: + '@vue/devtools-kit': 7.7.6 + + '@vue/devtools-core@7.6.8(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1))(vue@3.5.13(typescript@5.8.3))': dependencies: - '@vue/devtools-kit': 7.7.2 + '@vue/devtools-kit': 7.7.6 + '@vue/devtools-shared': 7.7.6 + mitt: 3.0.1 + nanoid: 5.1.5 + pathe: 1.1.2 + vite-hot-client: 0.2.4(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)) + vue: 3.5.13(typescript@5.8.3) + transitivePeerDependencies: + - vite - '@vue/devtools-core@7.6.8(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3))': + '@vue/devtools-core@7.6.8(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3))': dependencies: - '@vue/devtools-kit': 7.7.2 - '@vue/devtools-shared': 7.7.2 + '@vue/devtools-kit': 7.7.6 + '@vue/devtools-shared': 7.7.6 mitt: 3.0.1 nanoid: 5.1.5 pathe: 1.1.2 - vite-hot-client: 0.2.4(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) + vite-hot-client: 0.2.4(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) vue: 3.5.13(typescript@5.8.3) transitivePeerDependencies: - vite - '@vue/devtools-core@7.7.2(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3))': + '@vue/devtools-core@7.7.6(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3))': dependencies: - '@vue/devtools-kit': 7.7.2 - '@vue/devtools-shared': 7.7.2 + '@vue/devtools-kit': 7.7.6 + '@vue/devtools-shared': 7.7.6 mitt: 3.0.1 - nanoid: 5.1.3 + nanoid: 5.1.5 pathe: 2.0.3 - vite-hot-client: 0.2.4(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) + vite-hot-client: 2.0.4(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) vue: 3.5.13(typescript@5.8.3) transitivePeerDependencies: - vite '@vue/devtools-kit@7.6.8': dependencies: - '@vue/devtools-shared': 7.7.2 + '@vue/devtools-shared': 7.7.6 birpc: 0.2.19 hookable: 5.5.3 mitt: 3.0.1 @@ -17115,17 +18033,17 @@ snapshots: speakingurl: 14.0.1 superjson: 2.2.2 - '@vue/devtools-kit@7.7.2': + '@vue/devtools-kit@7.7.6': dependencies: - '@vue/devtools-shared': 7.7.2 - birpc: 0.2.19 + '@vue/devtools-shared': 7.7.6 + birpc: 2.3.0 hookable: 5.5.3 mitt: 3.0.1 perfect-debounce: 1.0.0 speakingurl: 14.0.1 superjson: 2.2.2 - '@vue/devtools-shared@7.7.2': + '@vue/devtools-shared@7.7.6': dependencies: rfdc: 1.4.1 @@ -17133,7 +18051,7 @@ snapshots: dependencies: eslint: 9.17.0(jiti@2.4.2) eslint-config-prettier: 9.1.0(eslint@9.17.0(jiti@2.4.2)) - eslint-plugin-prettier: 5.2.3(@types/eslint@9.6.0)(eslint-config-prettier@9.1.0(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2))(prettier@3.4.2) + eslint-plugin-prettier: 5.4.0(@types/eslint@9.6.0)(eslint-config-prettier@9.1.0(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2))(prettier@3.4.2) prettier: 3.4.2 transitivePeerDependencies: - '@types/eslint' @@ -17152,7 +18070,7 @@ snapshots: '@vue/language-core@2.2.0(typescript@5.8.3)': dependencies: - '@volar/language-core': 2.4.12 + '@volar/language-core': 2.4.13 '@vue/compiler-dom': 3.5.13 '@vue/compiler-vue2': 2.7.16 '@vue/shared': 3.5.13 @@ -17190,7 +18108,7 @@ snapshots: '@vue/test-utils@2.4.6': dependencies: js-beautify: 1.15.4 - vue-component-type-helpers: 2.2.8 + vue-component-type-helpers: 2.2.10 '@vue/tsconfig@0.7.0(typescript@5.8.3)(vue@3.5.13(typescript@5.8.3))': optionalDependencies: @@ -17207,13 +18125,13 @@ snapshots: - '@vue/composition-api' - vue - '@vueuse/integrations@10.11.1(axios@1.8.2)(focus-trap@7.6.4)(vue@3.5.13(typescript@5.8.3))': + '@vueuse/integrations@10.11.1(axios@1.9.0)(focus-trap@7.6.4)(vue@3.5.13(typescript@5.8.3))': dependencies: '@vueuse/core': 10.11.1(vue@3.5.13(typescript@5.8.3)) '@vueuse/shared': 10.11.1(vue@3.5.13(typescript@5.8.3)) vue-demi: 0.14.10(vue@3.5.13(typescript@5.8.3)) optionalDependencies: - axios: 1.8.2 + axios: 1.9.0 focus-trap: 7.6.4 transitivePeerDependencies: - '@vue/composition-api' @@ -17304,15 +18222,54 @@ snapshots: '@webassemblyjs/ast': 1.14.1 '@xtuc/long': 4.2.2 + '@whatwg-node/disposablestack@0.0.6': + dependencies: + '@whatwg-node/promise-helpers': 1.3.2 + tslib: 2.8.1 + + '@whatwg-node/fetch@0.10.7': + dependencies: + '@whatwg-node/node-fetch': 0.7.19 + urlpattern-polyfill: 10.1.0 + + '@whatwg-node/node-fetch@0.7.19': + dependencies: + '@fastify/busboy': 3.1.1 + '@whatwg-node/disposablestack': 0.0.6 + '@whatwg-node/promise-helpers': 1.3.2 + tslib: 2.8.1 + + '@whatwg-node/promise-helpers@1.3.2': + dependencies: + tslib: 2.8.1 + + '@whatwg-node/server@0.9.71': + dependencies: + '@whatwg-node/disposablestack': 0.0.6 + '@whatwg-node/fetch': 0.10.7 + '@whatwg-node/promise-helpers': 1.3.2 + tslib: 2.8.1 + '@xtuc/ieee754@1.2.0': {} '@xtuc/long@4.2.2': {} '@yarnpkg/lockfile@1.1.0': {} + '@yarnpkg/parsers@3.0.2': + dependencies: + js-yaml: 3.14.1 + tslib: 2.8.1 + + '@zkochan/js-yaml@0.0.7': + dependencies: + argparse: 2.0.1 + + abbrev@1.1.1: {} + abbrev@2.0.0: {} - abbrev@3.0.0: {} + abbrev@3.0.1: {} abort-controller@3.0.0: dependencies: @@ -17356,6 +18313,12 @@ snapshots: loader-utils: 2.0.4 regex-parser: 2.3.1 + agent-base@6.0.2: + dependencies: + debug: 4.4.1 + transitivePeerDependencies: + - supports-color + agent-base@7.1.3: {} ajv-draft-04@1.0.0(ajv@8.17.1): @@ -17389,21 +18352,21 @@ snapshots: json-schema-traverse: 1.0.0 require-from-string: 2.0.2 - algoliasearch@5.21.0: - dependencies: - '@algolia/client-abtesting': 5.21.0 - '@algolia/client-analytics': 5.21.0 - '@algolia/client-common': 5.21.0 - '@algolia/client-insights': 5.21.0 - '@algolia/client-personalization': 5.21.0 - '@algolia/client-query-suggestions': 5.21.0 - '@algolia/client-search': 5.21.0 - '@algolia/ingestion': 1.21.0 - '@algolia/monitoring': 1.21.0 - '@algolia/recommend': 5.21.0 - '@algolia/requester-browser-xhr': 5.21.0 - '@algolia/requester-fetch': 5.21.0 - '@algolia/requester-node-http': 5.21.0 + algoliasearch@5.25.0: + dependencies: + '@algolia/client-abtesting': 5.25.0 + '@algolia/client-analytics': 5.25.0 + '@algolia/client-common': 5.25.0 + '@algolia/client-insights': 5.25.0 + '@algolia/client-personalization': 5.25.0 + '@algolia/client-query-suggestions': 5.25.0 + '@algolia/client-search': 5.25.0 + '@algolia/ingestion': 1.25.0 + '@algolia/monitoring': 1.25.0 + '@algolia/recommend': 5.25.0 + '@algolia/requester-browser-xhr': 5.25.0 + '@algolia/requester-fetch': 5.25.0 + '@algolia/requester-node-http': 5.25.0 alien-signals@0.4.14: {} @@ -17427,6 +18390,8 @@ snapshots: dependencies: color-convert: 2.0.1 + ansi-styles@5.2.0: {} + ansi-styles@6.2.1: {} any-promise@1.3.0: {} @@ -17436,6 +18401,34 @@ snapshots: normalize-path: 3.0.0 picomatch: 2.3.1 + aproba@2.0.0: {} + + archiver-utils@2.1.0: + dependencies: + glob: 7.2.3 + graceful-fs: 4.2.11 + lazystream: 1.0.1 + lodash.defaults: 4.2.0 + lodash.difference: 4.5.0 + lodash.flatten: 4.4.0 + lodash.isplainobject: 4.0.6 + lodash.union: 4.6.0 + normalize-path: 3.0.0 + readable-stream: 2.3.8 + + archiver-utils@3.0.4: + dependencies: + glob: 7.2.3 + graceful-fs: 4.2.11 + lazystream: 1.0.1 + lodash.defaults: 4.2.0 + lodash.difference: 4.5.0 + lodash.flatten: 4.4.0 + lodash.isplainobject: 4.0.6 + lodash.union: 4.6.0 + normalize-path: 3.0.0 + readable-stream: 3.6.2 + archiver-utils@5.0.2: dependencies: glob: 10.4.3 @@ -17446,6 +18439,16 @@ snapshots: normalize-path: 3.0.0 readable-stream: 4.7.0 + archiver@5.3.2: + dependencies: + archiver-utils: 2.1.0 + async: 3.2.6 + buffer-crc32: 0.2.13 + readable-stream: 3.6.2 + readdir-glob: 1.1.3 + tar-stream: 2.2.0 + zip-stream: 4.1.1 + archiver@7.0.1: dependencies: archiver-utils: 5.0.2 @@ -17456,6 +18459,11 @@ snapshots: tar-stream: 3.1.7 zip-stream: 6.0.1 + are-we-there-yet@2.0.0: + dependencies: + delegates: 1.0.0 + readable-stream: 3.6.2 + arg@4.1.3: {} arg@5.0.2: {} @@ -17499,9 +18507,10 @@ snapshots: es-object-atoms: 1.1.1 es-shim-unscopables: 1.1.0 - array.prototype.findlastindex@1.2.5: + array.prototype.findlastindex@1.2.6: dependencies: call-bind: 1.0.8 + call-bound: 1.0.4 define-properties: 1.2.1 es-abstract: 1.23.9 es-errors: 1.3.0 @@ -17540,13 +18549,17 @@ snapshots: get-intrinsic: 1.3.0 is-array-buffer: 3.0.5 + assert-plus@1.0.0: {} + assertion-error@2.0.1: {} - ast-kit@1.4.2: + ast-kit@1.4.3: dependencies: - '@babel/parser': 7.26.10 + '@babel/parser': 7.27.2 pathe: 2.0.3 + ast-module-types@5.0.0: {} + ast-types-flow@0.0.8: {} ast-types@0.13.4: @@ -17555,8 +18568,8 @@ snapshots: ast-walker-scope@0.6.2: dependencies: - '@babel/parser': 7.26.10 - ast-kit: 1.4.2 + '@babel/parser': 7.27.2 + ast-kit: 1.4.3 async-function@1.0.0: {} @@ -17570,8 +18583,8 @@ snapshots: autoprefixer@10.4.19(postcss@8.4.41): dependencies: - browserslist: 4.24.4 - caniuse-lite: 1.0.30001703 + browserslist: 4.24.5 + caniuse-lite: 1.0.30001718 fraction.js: 4.3.7 normalize-range: 0.1.2 picocolors: 1.1.1 @@ -17580,8 +18593,8 @@ snapshots: autoprefixer@10.4.20(postcss@8.4.41): dependencies: - browserslist: 4.24.4 - caniuse-lite: 1.0.30001703 + browserslist: 4.24.5 + caniuse-lite: 1.0.30001718 fraction.js: 4.3.7 normalize-range: 0.1.2 picocolors: 1.1.1 @@ -17590,22 +18603,22 @@ snapshots: autoprefixer@10.4.20(postcss@8.5.2): dependencies: - browserslist: 4.24.4 - caniuse-lite: 1.0.30001703 + browserslist: 4.24.5 + caniuse-lite: 1.0.30001718 fraction.js: 4.3.7 normalize-range: 0.1.2 picocolors: 1.1.1 postcss: 8.5.2 postcss-value-parser: 4.2.0 - autoprefixer@10.4.20(postcss@8.5.4): + autoprefixer@10.4.20(postcss@8.5.3): dependencies: - browserslist: 4.24.4 - caniuse-lite: 1.0.30001703 + browserslist: 4.24.5 + caniuse-lite: 1.0.30001718 fraction.js: 4.3.7 normalize-range: 0.1.2 picocolors: 1.1.1 - postcss: 8.5.4 + postcss: 8.5.3 postcss-value-parser: 4.2.0 available-typed-arrays@1.0.7: @@ -17614,14 +18627,22 @@ snapshots: avvio@9.1.0: dependencies: - '@fastify/error': 4.0.0 + '@fastify/error': 4.1.0 fastq: 1.19.1 axe-core@4.10.3: {} axios@1.8.2: dependencies: - follow-redirects: 1.15.9(debug@4.4.0) + follow-redirects: 1.15.9(debug@4.4.1) + form-data: 4.0.2 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + + axios@1.9.0: + dependencies: + follow-redirects: 1.15.9(debug@4.4.1) form-data: 4.0.2 proxy-from-env: 1.1.0 transitivePeerDependencies: @@ -17635,14 +18656,14 @@ snapshots: dependencies: '@babel/core': 7.26.9 find-cache-dir: 4.0.0 - schema-utils: 4.3.0 - webpack: 5.98.0(esbuild@0.25.2) + schema-utils: 4.3.2 + webpack: 5.98.0(esbuild@0.25.4) - babel-plugin-polyfill-corejs2@0.4.12(@babel/core@7.26.9): + babel-plugin-polyfill-corejs2@0.4.13(@babel/core@7.26.9): dependencies: - '@babel/compat-data': 7.26.8 + '@babel/compat-data': 7.27.2 '@babel/core': 7.26.9 - '@babel/helper-define-polyfill-provider': 0.6.3(@babel/core@7.26.9) + '@babel/helper-define-polyfill-provider': 0.6.4(@babel/core@7.26.9) semver: 6.3.1 transitivePeerDependencies: - supports-color @@ -17650,23 +18671,23 @@ snapshots: babel-plugin-polyfill-corejs3@0.10.6(@babel/core@7.26.9): dependencies: '@babel/core': 7.26.9 - '@babel/helper-define-polyfill-provider': 0.6.3(@babel/core@7.26.9) - core-js-compat: 3.41.0 + '@babel/helper-define-polyfill-provider': 0.6.4(@babel/core@7.26.9) + core-js-compat: 3.42.0 transitivePeerDependencies: - supports-color babel-plugin-polyfill-corejs3@0.11.1(@babel/core@7.26.9): dependencies: '@babel/core': 7.26.9 - '@babel/helper-define-polyfill-provider': 0.6.3(@babel/core@7.26.9) - core-js-compat: 3.41.0 + '@babel/helper-define-polyfill-provider': 0.6.4(@babel/core@7.26.9) + core-js-compat: 3.42.0 transitivePeerDependencies: - supports-color - babel-plugin-polyfill-regenerator@0.6.3(@babel/core@7.26.9): + babel-plugin-polyfill-regenerator@0.6.4(@babel/core@7.26.9): dependencies: '@babel/core': 7.26.9 - '@babel/helper-define-polyfill-provider': 0.6.3(@babel/core@7.26.9) + '@babel/helper-define-polyfill-provider': 0.6.4(@babel/core@7.26.9) transitivePeerDependencies: - supports-color @@ -17715,7 +18736,7 @@ snapshots: domhandler: 5.0.3 htmlparser2: 9.1.0 picocolors: 1.1.1 - postcss: 8.5.4 + postcss: 8.5.3 postcss-media-query-parser: 0.2.3 better-path-resolve@1.0.0: @@ -17732,6 +18753,8 @@ snapshots: birpc@0.2.19: {} + birpc@2.3.0: {} + bl@4.1.0: dependencies: buffer: 5.7.1 @@ -17775,12 +18798,12 @@ snapshots: dependencies: fill-range: 7.1.1 - browserslist@4.24.4: + browserslist@4.24.5: dependencies: - caniuse-lite: 1.0.30001703 - electron-to-chromium: 1.5.114 + caniuse-lite: 1.0.30001718 + electron-to-chromium: 1.5.152 node-releases: 2.0.19 - update-browserslist-db: 1.1.3(browserslist@4.24.4) + update-browserslist-db: 1.1.3(browserslist@4.24.5) buffer-crc32@0.2.13: {} @@ -17798,6 +18821,8 @@ snapshots: base64-js: 1.5.1 ieee754: 1.2.1 + builtin-modules@3.3.0: {} + bun-types@1.2.19(@types/react@19.0.1): dependencies: '@types/node': 22.10.5 @@ -17807,9 +18832,9 @@ snapshots: dependencies: run-applescript: 7.0.0 - bundle-require@5.1.0(esbuild@0.25.2): + bundle-require@5.1.0(esbuild@0.25.4): dependencies: - esbuild: 0.25.2 + esbuild: 0.25.4 load-tsconfig: 0.2.5 busboy@1.6.0: @@ -17823,7 +18848,7 @@ snapshots: chokidar: 4.0.3 confbox: 0.1.8 defu: 6.1.4 - dotenv: 16.4.7 + dotenv: 16.5.0 giget: 1.2.5 jiti: 2.4.2 mlly: 1.7.4 @@ -17835,13 +18860,13 @@ snapshots: optionalDependencies: magicast: 0.3.5 - c12@3.0.2(magicast@0.3.5): + c12@3.0.3(magicast@0.3.5): dependencies: chokidar: 4.0.3 - confbox: 0.1.8 + confbox: 0.2.2 defu: 6.1.4 - dotenv: 16.4.7 - exsolve: 1.0.4 + dotenv: 16.5.0 + exsolve: 1.0.5 giget: 2.0.0 jiti: 2.4.2 ohash: 2.0.11 @@ -17886,20 +18911,22 @@ snapshots: call-bind-apply-helpers: 1.0.2 get-intrinsic: 1.3.0 + call-me-maybe@1.0.2: {} + + callsite@1.0.0: {} + callsites@3.1.0: {} camelcase-css@2.0.1: {} caniuse-api@3.0.0: dependencies: - browserslist: 4.24.4 - caniuse-lite: 1.0.30001709 + browserslist: 4.24.5 + caniuse-lite: 1.0.30001718 lodash.memoize: 4.1.2 lodash.uniq: 4.5.0 - caniuse-lite@1.0.30001703: {} - - caniuse-lite@1.0.30001709: {} + caniuse-lite@1.0.30001718: {} ccount@2.0.1: {} @@ -17918,8 +18945,6 @@ snapshots: chalk@5.4.1: {} - change-case@5.4.4: {} - char-regex@1.0.2: {} character-entities-html4@2.1.0: {} @@ -17988,6 +19013,8 @@ snapshots: parse5-htmlparser2-tree-adapter: 6.0.1 yargs: 16.2.0 + cli-spinners@2.6.1: {} + cli-spinners@2.9.2: {} cli-table3@0.6.5: @@ -18035,10 +19062,16 @@ snapshots: cluster-key-slot@1.1.2: {} + color-convert@1.9.3: + dependencies: + color-name: 1.1.3 + color-convert@2.0.1: dependencies: color-name: 1.1.4 + color-name@1.1.3: {} + color-name@1.1.4: {} color-string@1.9.1: @@ -18048,6 +19081,11 @@ snapshots: color-support@1.1.3: {} + color@3.2.1: + dependencies: + color-convert: 1.9.3 + color-string: 1.9.1 + color@4.2.3: dependencies: color-convert: 2.0.1 @@ -18055,10 +19093,13 @@ snapshots: colord@2.9.3: {} - colorette@1.4.0: {} - colorette@2.0.20: {} + colorspace@1.1.4: + dependencies: + color: 3.2.1 + text-hex: 1.0.0 + combined-stream@1.0.8: dependencies: delayed-stream: 1.0.0 @@ -18079,12 +19120,24 @@ snapshots: commander@8.3.0: {} + commander@9.5.0: + optional: true + common-path-prefix@3.0.0: {} commondir@1.0.1: {} compatx@0.1.8: {} + compatx@0.2.0: {} + + compress-commons@4.1.2: + dependencies: + buffer-crc32: 0.2.13 + crc32-stream: 4.0.3 + normalize-path: 3.0.0 + readable-stream: 3.6.2 + compress-commons@6.0.2: dependencies: crc-32: 1.2.2 @@ -18113,7 +19166,7 @@ snapshots: confbox@0.1.8: {} - confbox@0.2.1: {} + confbox@0.2.2: {} config-chain@1.1.13: dependencies: @@ -18131,10 +19184,10 @@ snapshots: transitivePeerDependencies: - supports-color - consola@3.4.0: {} - consola@3.4.2: {} + console-control-strings@1.1.0: {} + content-disposition@0.5.4: dependencies: safe-buffer: 5.2.1 @@ -18145,6 +19198,11 @@ snapshots: convert-source-map@2.0.0: {} + convict@6.2.4: + dependencies: + lodash.clonedeep: 4.5.0 + yargs-parser: 20.2.9 + cookie-es@1.2.2: {} cookie-es@2.0.0: {} @@ -18173,13 +19231,15 @@ snapshots: glob-parent: 6.0.2 globby: 14.1.0 normalize-path: 3.0.0 - schema-utils: 4.3.0 + schema-utils: 4.3.2 serialize-javascript: 6.0.2 - webpack: 5.98.0(esbuild@0.25.2) + webpack: 5.98.0(esbuild@0.25.4) - core-js-compat@3.41.0: + core-js-compat@3.42.0: dependencies: - browserslist: 4.24.4 + browserslist: 4.24.5 + + core-util-is@1.0.2: {} core-util-is@1.0.3: {} @@ -18197,8 +19257,19 @@ snapshots: optionalDependencies: typescript: 5.8.3 + cp-file@10.0.0: + dependencies: + graceful-fs: 4.2.11 + nested-error-stacks: 2.1.1 + p-event: 5.0.1 + crc-32@1.2.2: {} + crc32-stream@4.0.3: + dependencies: + crc-32: 1.2.2 + readable-stream: 3.6.2 + crc32-stream@6.0.0: dependencies: crc-32: 1.2.2 @@ -18206,9 +19277,13 @@ snapshots: create-require@1.1.1: {} + cron-parser@4.9.0: + dependencies: + luxon: 3.6.1 + croner@9.0.0: {} - cronstrue@2.56.0: {} + cronstrue@2.61.0: {} cross-spawn@5.1.0: dependencies: @@ -18228,13 +19303,13 @@ snapshots: shebang-command: 2.0.0 which: 2.0.2 - crossws@0.3.4: + crossws@0.3.5: dependencies: uncrypto: 0.1.3 - css-declaration-sorter@7.2.0(postcss@8.5.4): + css-declaration-sorter@7.2.0(postcss@8.5.3): dependencies: - postcss: 8.5.4 + postcss: 8.5.3 css-loader@7.1.2(webpack@5.98.0(esbuild@0.25.0)): dependencies: @@ -18247,7 +19322,7 @@ snapshots: postcss-value-parser: 4.2.0 semver: 7.7.2 optionalDependencies: - webpack: 5.98.0(esbuild@0.25.2) + webpack: 5.98.0(esbuild@0.25.4) css-select@5.1.0: dependencies: @@ -18271,49 +19346,49 @@ snapshots: cssesc@3.0.0: {} - cssnano-preset-default@7.0.6(postcss@8.5.4): - dependencies: - browserslist: 4.24.4 - css-declaration-sorter: 7.2.0(postcss@8.5.4) - cssnano-utils: 5.0.0(postcss@8.5.4) - postcss: 8.5.4 - postcss-calc: 10.1.1(postcss@8.5.4) - postcss-colormin: 7.0.2(postcss@8.5.4) - postcss-convert-values: 7.0.4(postcss@8.5.4) - postcss-discard-comments: 7.0.3(postcss@8.5.4) - postcss-discard-duplicates: 7.0.1(postcss@8.5.4) - postcss-discard-empty: 7.0.0(postcss@8.5.4) - postcss-discard-overridden: 7.0.0(postcss@8.5.4) - postcss-merge-longhand: 7.0.4(postcss@8.5.4) - postcss-merge-rules: 7.0.4(postcss@8.5.4) - postcss-minify-font-values: 7.0.0(postcss@8.5.4) - postcss-minify-gradients: 7.0.0(postcss@8.5.4) - postcss-minify-params: 7.0.2(postcss@8.5.4) - postcss-minify-selectors: 7.0.4(postcss@8.5.4) - postcss-normalize-charset: 7.0.0(postcss@8.5.4) - postcss-normalize-display-values: 7.0.0(postcss@8.5.4) - postcss-normalize-positions: 7.0.0(postcss@8.5.4) - postcss-normalize-repeat-style: 7.0.0(postcss@8.5.4) - postcss-normalize-string: 7.0.0(postcss@8.5.4) - postcss-normalize-timing-functions: 7.0.0(postcss@8.5.4) - postcss-normalize-unicode: 7.0.2(postcss@8.5.4) - postcss-normalize-url: 7.0.0(postcss@8.5.4) - postcss-normalize-whitespace: 7.0.0(postcss@8.5.4) - postcss-ordered-values: 7.0.1(postcss@8.5.4) - postcss-reduce-initial: 7.0.2(postcss@8.5.4) - postcss-reduce-transforms: 7.0.0(postcss@8.5.4) - postcss-svgo: 7.0.1(postcss@8.5.4) - postcss-unique-selectors: 7.0.3(postcss@8.5.4) - - cssnano-utils@5.0.0(postcss@8.5.4): - dependencies: - postcss: 8.5.4 - - cssnano@7.0.6(postcss@8.5.4): - dependencies: - cssnano-preset-default: 7.0.6(postcss@8.5.4) + cssnano-preset-default@7.0.7(postcss@8.5.3): + dependencies: + browserslist: 4.24.5 + css-declaration-sorter: 7.2.0(postcss@8.5.3) + cssnano-utils: 5.0.1(postcss@8.5.3) + postcss: 8.5.3 + postcss-calc: 10.1.1(postcss@8.5.3) + postcss-colormin: 7.0.3(postcss@8.5.3) + postcss-convert-values: 7.0.5(postcss@8.5.3) + postcss-discard-comments: 7.0.4(postcss@8.5.3) + postcss-discard-duplicates: 7.0.2(postcss@8.5.3) + postcss-discard-empty: 7.0.1(postcss@8.5.3) + postcss-discard-overridden: 7.0.1(postcss@8.5.3) + postcss-merge-longhand: 7.0.5(postcss@8.5.3) + postcss-merge-rules: 7.0.5(postcss@8.5.3) + postcss-minify-font-values: 7.0.1(postcss@8.5.3) + postcss-minify-gradients: 7.0.1(postcss@8.5.3) + postcss-minify-params: 7.0.3(postcss@8.5.3) + postcss-minify-selectors: 7.0.5(postcss@8.5.3) + postcss-normalize-charset: 7.0.1(postcss@8.5.3) + postcss-normalize-display-values: 7.0.1(postcss@8.5.3) + postcss-normalize-positions: 7.0.1(postcss@8.5.3) + postcss-normalize-repeat-style: 7.0.1(postcss@8.5.3) + postcss-normalize-string: 7.0.1(postcss@8.5.3) + postcss-normalize-timing-functions: 7.0.1(postcss@8.5.3) + postcss-normalize-unicode: 7.0.3(postcss@8.5.3) + postcss-normalize-url: 7.0.1(postcss@8.5.3) + postcss-normalize-whitespace: 7.0.1(postcss@8.5.3) + postcss-ordered-values: 7.0.2(postcss@8.5.3) + postcss-reduce-initial: 7.0.3(postcss@8.5.3) + postcss-reduce-transforms: 7.0.1(postcss@8.5.3) + postcss-svgo: 7.0.2(postcss@8.5.3) + postcss-unique-selectors: 7.0.4(postcss@8.5.3) + + cssnano-utils@5.0.1(postcss@8.5.3): + dependencies: + postcss: 8.5.3 + + cssnano@7.0.7(postcss@8.5.3): + dependencies: + cssnano-preset-default: 7.0.7(postcss@8.5.3) lilconfig: 3.1.3 - postcss: 8.5.4 + postcss: 8.5.3 csso@5.0.5: dependencies: @@ -18336,7 +19411,7 @@ snapshots: data-urls@5.0.0: dependencies: whatwg-mimetype: 4.0.0 - whatwg-url: 14.1.1 + whatwg-url: 14.2.0 data-view-buffer@1.0.2: dependencies: @@ -18360,7 +19435,7 @@ snapshots: date-format@4.0.14: {} - db0@0.3.1: {} + db0@0.3.2: {} de-indent@1.0.2: {} @@ -18380,16 +19455,20 @@ snapshots: dependencies: ms: 2.1.3 - debug@4.4.0(supports-color@9.4.0): + debug@4.4.1: dependencies: ms: 2.1.3 - optionalDependencies: - supports-color: 9.4.0 + + decache@4.6.2: + dependencies: + callsite: 1.0.0 decimal.js@10.5.0: {} deep-eql@5.0.2: {} + deep-extend@0.6.0: {} + deep-is@0.1.4: {} deepmerge@4.3.1: {} @@ -18431,6 +19510,8 @@ snapshots: delayed-stream@1.0.0: {} + delegates@1.0.0: {} + denque@2.1.0: {} depd@1.1.2: {} @@ -18439,7 +19520,7 @@ snapshots: dequal@2.0.3: {} - destr@2.0.3: {} + destr@2.0.5: {} destroy@1.2.0: {} @@ -18447,12 +19528,55 @@ snapshots: detect-libc@1.0.3: {} - detect-libc@2.0.3: {} + detect-libc@2.0.4: {} detect-node-es@1.1.0: {} detect-node@2.1.0: {} + detective-amd@5.0.2: + dependencies: + ast-module-types: 5.0.0 + escodegen: 2.1.0 + get-amd-module-type: 5.0.1 + node-source-walk: 6.0.2 + + detective-cjs@5.0.1: + dependencies: + ast-module-types: 5.0.0 + node-source-walk: 6.0.2 + + detective-es6@4.0.1: + dependencies: + node-source-walk: 6.0.2 + + detective-postcss@6.1.3: + dependencies: + is-url: 1.2.4 + postcss: 8.4.41 + postcss-values-parser: 6.0.2(postcss@8.4.41) + + detective-sass@5.0.3: + dependencies: + gonzales-pe: 4.3.0 + node-source-walk: 6.0.2 + + detective-scss@4.0.3: + dependencies: + gonzales-pe: 4.3.0 + node-source-walk: 6.0.2 + + detective-stylus@4.0.0: {} + + detective-typescript@11.2.0: + dependencies: + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.8.3) + ast-module-types: 5.0.0 + node-source-walk: 6.0.2 + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + devalue@5.1.1: {} devlop@1.1.0: @@ -18465,6 +19589,8 @@ snapshots: didyoumean@1.2.2: {} + diff-sequences@29.6.3: {} + diff@4.0.2: {} diff@7.0.0: {} @@ -18510,10 +19636,16 @@ snapshots: dot-prop@9.0.0: dependencies: - type-fest: 4.37.0 + type-fest: 4.41.0 + + dotenv-expand@11.0.7: + dependencies: + dotenv: 16.5.0 dotenv@16.4.7: {} + dotenv@16.5.0: {} + dotenv@8.6.0: {} dunder-proto@1.0.1: @@ -18535,7 +19667,11 @@ snapshots: ee-first@1.1.1: {} - electron-to-chromium@1.5.114: {} + ejs@3.1.10: + dependencies: + jake: 10.9.2 + + electron-to-chromium@1.5.152: {} emoji-regex-xs@1.0.0: {} @@ -18549,6 +19685,8 @@ snapshots: emojis-list@3.0.0: {} + enabled@2.0.0: {} + encodeurl@1.0.2: {} encodeurl@2.0.0: {} @@ -18558,7 +19696,7 @@ snapshots: iconv-lite: 0.6.3 optional: true - end-of-stream@1.4.5: + end-of-stream@1.4.4: dependencies: once: 1.4.0 @@ -18566,7 +19704,7 @@ snapshots: engine.io@6.6.4: dependencies: - '@types/cors': 2.8.17 + '@types/cors': 2.8.18 '@types/node': 22.10.5 accepts: 1.3.8 base64id: 2.0.0 @@ -18585,6 +19723,10 @@ snapshots: graceful-fs: 4.2.11 tapable: 2.2.1 + enquirer@2.3.6: + dependencies: + ansi-colors: 4.1.3 + enquirer@2.4.1: dependencies: ansi-colors: 4.1.3 @@ -18599,8 +19741,12 @@ snapshots: entities@4.5.0: {} + entities@6.0.0: {} + env-paths@2.2.1: {} + env-paths@3.0.0: {} + environment@1.1.0: {} err-code@2.0.3: {} @@ -18697,7 +19843,7 @@ snapshots: iterator.prototype: 1.1.5 safe-array-concat: 1.1.3 - es-module-lexer@1.6.0: {} + es-module-lexer@1.7.0: {} es-object-atoms@1.1.1: dependencies: @@ -18830,66 +19976,40 @@ snapshots: '@esbuild/win32-ia32': 0.25.0 '@esbuild/win32-x64': 0.25.0 - esbuild@0.25.2: + esbuild@0.25.4: optionalDependencies: - '@esbuild/aix-ppc64': 0.25.2 - '@esbuild/android-arm': 0.25.2 - '@esbuild/android-arm64': 0.25.2 - '@esbuild/android-x64': 0.25.2 - '@esbuild/darwin-arm64': 0.25.2 - '@esbuild/darwin-x64': 0.25.2 - '@esbuild/freebsd-arm64': 0.25.2 - '@esbuild/freebsd-x64': 0.25.2 - '@esbuild/linux-arm': 0.25.2 - '@esbuild/linux-arm64': 0.25.2 - '@esbuild/linux-ia32': 0.25.2 - '@esbuild/linux-loong64': 0.25.2 - '@esbuild/linux-mips64el': 0.25.2 - '@esbuild/linux-ppc64': 0.25.2 - '@esbuild/linux-riscv64': 0.25.2 - '@esbuild/linux-s390x': 0.25.2 - '@esbuild/linux-x64': 0.25.2 - '@esbuild/netbsd-arm64': 0.25.2 - '@esbuild/netbsd-x64': 0.25.2 - '@esbuild/openbsd-arm64': 0.25.2 - '@esbuild/openbsd-x64': 0.25.2 - '@esbuild/sunos-x64': 0.25.2 - '@esbuild/win32-arm64': 0.25.2 - '@esbuild/win32-ia32': 0.25.2 - '@esbuild/win32-x64': 0.25.2 - - esbuild@0.25.5: - optionalDependencies: - '@esbuild/aix-ppc64': 0.25.5 - '@esbuild/android-arm': 0.25.5 - '@esbuild/android-arm64': 0.25.5 - '@esbuild/android-x64': 0.25.5 - '@esbuild/darwin-arm64': 0.25.5 - '@esbuild/darwin-x64': 0.25.5 - '@esbuild/freebsd-arm64': 0.25.5 - '@esbuild/freebsd-x64': 0.25.5 - '@esbuild/linux-arm': 0.25.5 - '@esbuild/linux-arm64': 0.25.5 - '@esbuild/linux-ia32': 0.25.5 - '@esbuild/linux-loong64': 0.25.5 - '@esbuild/linux-mips64el': 0.25.5 - '@esbuild/linux-ppc64': 0.25.5 - '@esbuild/linux-riscv64': 0.25.5 - '@esbuild/linux-s390x': 0.25.5 - '@esbuild/linux-x64': 0.25.5 - '@esbuild/netbsd-arm64': 0.25.5 - '@esbuild/netbsd-x64': 0.25.5 - '@esbuild/openbsd-arm64': 0.25.5 - '@esbuild/openbsd-x64': 0.25.5 - '@esbuild/sunos-x64': 0.25.5 - '@esbuild/win32-arm64': 0.25.5 - '@esbuild/win32-ia32': 0.25.5 - '@esbuild/win32-x64': 0.25.5 + '@esbuild/aix-ppc64': 0.25.4 + '@esbuild/android-arm': 0.25.4 + '@esbuild/android-arm64': 0.25.4 + '@esbuild/android-x64': 0.25.4 + '@esbuild/darwin-arm64': 0.25.4 + '@esbuild/darwin-x64': 0.25.4 + '@esbuild/freebsd-arm64': 0.25.4 + '@esbuild/freebsd-x64': 0.25.4 + '@esbuild/linux-arm': 0.25.4 + '@esbuild/linux-arm64': 0.25.4 + '@esbuild/linux-ia32': 0.25.4 + '@esbuild/linux-loong64': 0.25.4 + '@esbuild/linux-mips64el': 0.25.4 + '@esbuild/linux-ppc64': 0.25.4 + '@esbuild/linux-riscv64': 0.25.4 + '@esbuild/linux-s390x': 0.25.4 + '@esbuild/linux-x64': 0.25.4 + '@esbuild/netbsd-arm64': 0.25.4 + '@esbuild/netbsd-x64': 0.25.4 + '@esbuild/openbsd-arm64': 0.25.4 + '@esbuild/openbsd-x64': 0.25.4 + '@esbuild/sunos-x64': 0.25.4 + '@esbuild/win32-arm64': 0.25.4 + '@esbuild/win32-ia32': 0.25.4 + '@esbuild/win32-x64': 0.25.4 escalade@3.2.0: {} escape-html@1.0.3: {} + escape-string-regexp@1.0.5: {} + escape-string-regexp@4.0.0: {} escape-string-regexp@5.0.0: {} @@ -18915,10 +20035,10 @@ snapshots: '@typescript-eslint/parser': 8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3) eslint: 9.17.0(jiti@2.4.2) eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.8.5(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)) - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint-import-resolver-typescript@3.8.5(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)) + eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)) eslint-plugin-jsx-a11y: 6.10.2(eslint@9.17.0(jiti@2.4.2)) - eslint-plugin-react: 7.37.4(eslint@9.17.0(jiti@2.4.2)) + eslint-plugin-react: 7.37.5(eslint@9.17.0(jiti@2.4.2)) eslint-plugin-react-hooks: 5.2.0(eslint@9.17.0(jiti@2.4.2)) optionalDependencies: typescript: 5.8.3 @@ -18939,44 +20059,44 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.8.5(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)): + eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)): dependencies: '@nolyfill/is-core-module': 1.0.39 - debug: 4.4.0(supports-color@9.4.0) - enhanced-resolve: 5.18.1 + debug: 4.4.1 eslint: 9.17.0(jiti@2.4.2) get-tsconfig: 4.10.0 - is-bun-module: 1.3.0 - stable-hash: 0.0.4 - tinyglobby: 0.2.12 + is-bun-module: 2.0.0 + stable-hash: 0.0.5 + tinyglobby: 0.2.13 + unrs-resolver: 1.7.2 optionalDependencies: - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint-import-resolver-typescript@3.8.5(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)) transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.8.5(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)): + eslint-module-utils@2.12.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3) eslint: 9.17.0(jiti@2.4.2) eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.8.5(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)) + eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)) transitivePeerDependencies: - supports-color - eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint-import-resolver-typescript@3.8.5(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)): + eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.8 - array.prototype.findlastindex: 1.2.5 + array.prototype.findlastindex: 1.2.6 array.prototype.flat: 1.3.3 array.prototype.flatmap: 1.3.3 debug: 3.2.7 doctrine: 2.1.0 eslint: 9.17.0(jiti@2.4.2) eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.8.5(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2)) hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 @@ -19013,12 +20133,12 @@ snapshots: safe-regex-test: 1.1.0 string.prototype.includes: 2.0.1 - eslint-plugin-prettier@5.2.3(@types/eslint@9.6.0)(eslint-config-prettier@9.1.0(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2))(prettier@3.4.2): + eslint-plugin-prettier@5.4.0(@types/eslint@9.6.0)(eslint-config-prettier@9.1.0(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2))(prettier@3.4.2): dependencies: eslint: 9.17.0(jiti@2.4.2) prettier: 3.4.2 prettier-linter-helpers: 1.0.0 - synckit: 0.9.2 + synckit: 0.11.5 optionalDependencies: '@types/eslint': 9.6.0 eslint-config-prettier: 9.1.0(eslint@9.17.0(jiti@2.4.2)) @@ -19031,7 +20151,7 @@ snapshots: dependencies: eslint: 9.17.0(jiti@2.4.2) - eslint-plugin-react@7.37.4(eslint@9.17.0(jiti@2.4.2)): + eslint-plugin-react@7.37.5(eslint@9.17.0(jiti@2.4.2)): dependencies: array-includes: 3.1.8 array.prototype.findlast: 1.2.5 @@ -19044,7 +20164,7 @@ snapshots: hasown: 2.0.2 jsx-ast-utils: 3.3.5 minimatch: 3.1.2 - object.entries: 1.1.8 + object.entries: 1.1.9 object.fromentries: 2.0.8 object.values: 1.2.1 prop-types: 15.8.1 @@ -19071,9 +20191,9 @@ snapshots: eslint-plugin-svelte@2.36.0(eslint@9.17.0(jiti@2.4.2))(svelte@5.19.9)(ts-node@10.9.2(@types/node@22.10.5)(typescript@5.8.3)): dependencies: - '@eslint-community/eslint-utils': 4.5.0(eslint@9.17.0(jiti@2.4.2)) + '@eslint-community/eslint-utils': 4.7.0(eslint@9.17.0(jiti@2.4.2)) '@jridgewell/sourcemap-codec': 1.5.0 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 eslint: 9.17.0(jiti@2.4.2) eslint-compat-utils: 0.5.1(eslint@9.17.0(jiti@2.4.2)) esutils: 2.0.3 @@ -19082,7 +20202,7 @@ snapshots: postcss-load-config: 3.1.4(postcss@8.4.41)(ts-node@10.9.2(@types/node@22.10.5)(typescript@5.8.3)) postcss-safe-parser: 6.0.0(postcss@8.4.41) postcss-selector-parser: 6.1.2 - semver: 7.7.1 + semver: 7.7.2 svelte-eslint-parser: 0.43.0(svelte@5.19.9) optionalDependencies: svelte: 5.19.9 @@ -19103,13 +20223,13 @@ snapshots: eslint-plugin-vue@9.32.0(eslint@9.17.0(jiti@2.4.2)): dependencies: - '@eslint-community/eslint-utils': 4.5.0(eslint@9.17.0(jiti@2.4.2)) + '@eslint-community/eslint-utils': 4.7.0(eslint@9.17.0(jiti@2.4.2)) eslint: 9.17.0(jiti@2.4.2) globals: 13.24.0 natural-compare: 1.4.0 nth-check: 2.1.1 postcss-selector-parser: 6.1.2 - semver: 7.7.1 + semver: 7.7.2 vue-eslint-parser: 9.4.3(eslint@9.17.0(jiti@2.4.2)) xml-name-validator: 4.0.0 transitivePeerDependencies: @@ -19138,22 +20258,22 @@ snapshots: eslint@9.17.0(jiti@2.4.2): dependencies: - '@eslint-community/eslint-utils': 4.5.0(eslint@9.17.0(jiti@2.4.2)) + '@eslint-community/eslint-utils': 4.7.0(eslint@9.17.0(jiti@2.4.2)) '@eslint-community/regexpp': 4.12.1 '@eslint/config-array': 0.19.2 '@eslint/core': 0.9.1 - '@eslint/eslintrc': 3.3.0 + '@eslint/eslintrc': 3.3.1 '@eslint/js': 9.17.0 - '@eslint/plugin-kit': 0.2.7 + '@eslint/plugin-kit': 0.2.8 '@humanfs/node': 0.16.6 '@humanwhocodes/module-importer': 1.0.1 - '@humanwhocodes/retry': 0.4.2 - '@types/estree': 1.0.6 + '@humanwhocodes/retry': 0.4.3 + '@types/estree': 1.0.7 '@types/json-schema': 7.0.15 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.6 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 escape-string-regexp: 4.0.0 eslint-scope: 8.3.0 eslint-visitor-keys: 4.2.0 @@ -19203,7 +20323,7 @@ snapshots: dependencies: estraverse: 5.3.0 - esrap@1.4.5: + esrap@1.4.6: dependencies: '@jridgewell/sourcemap-codec': 1.5.0 @@ -19257,13 +20377,13 @@ snapshots: signal-exit: 4.1.0 strip-final-newline: 3.0.0 - execa@9.5.2: + execa@9.5.3: dependencies: '@sindresorhus/merge-streams': 4.0.0 cross-spawn: 7.0.5 figures: 6.1.0 get-stream: 9.0.1 - human-signals: 8.0.0 + human-signals: 8.0.1 is-plain-obj: 4.1.0 is-stream: 4.0.1 npm-run-path: 6.0.0 @@ -19348,7 +20468,7 @@ snapshots: transitivePeerDependencies: - supports-color - exsolve@1.0.4: {} + exsolve@1.0.5: {} extend@3.0.2: {} @@ -19365,11 +20485,11 @@ snapshots: enhanced-resolve: 5.18.1 mlly: 1.7.4 pathe: 1.1.2 - ufo: 1.5.4 + ufo: 1.6.1 extract-zip@2.0.1: dependencies: - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 get-stream: 5.2.0 yauzl: 2.10.0 optionalDependencies: @@ -19377,7 +20497,9 @@ snapshots: transitivePeerDependencies: - supports-color - fake-indexeddb@6.0.0: {} + extsprintf@1.4.1: {} + + fake-indexeddb@6.0.1: {} fast-decode-uri-component@1.0.1: {} @@ -19428,7 +20550,7 @@ snapshots: fastify-openapi-glue@4.8.0: dependencies: - '@seriousme/openapi-schema-validator': 2.3.1 + '@seriousme/openapi-schema-validator': 2.4.1 fastify-plugin: 5.0.1 js-yaml: 4.1.0 minimist: 1.2.8 @@ -19438,8 +20560,8 @@ snapshots: fastify@5.2.0: dependencies: '@fastify/ajv-compiler': 4.0.2 - '@fastify/error': 4.0.0 - '@fastify/fast-json-stringify-compiler': 5.0.2 + '@fastify/error': 4.1.0 + '@fastify/fast-json-stringify-compiler': 5.0.3 abstract-logging: 2.0.1 avvio: 9.1.0 fast-json-stringify: 6.0.1 @@ -19450,7 +20572,7 @@ snapshots: proxy-addr: 2.0.7 rfdc: 1.4.1 secure-json-parse: 3.0.2 - semver: 7.7.1 + semver: 7.7.2 toad-cache: 3.7.0 fastq@1.19.1: @@ -19465,10 +20587,12 @@ snapshots: dependencies: pend: 1.2.0 - fdir@6.4.3(picomatch@4.0.2): + fdir@6.4.4(picomatch@4.0.2): optionalDependencies: picomatch: 4.0.2 + fecha@4.2.3: {} + fetch-blob@3.2.0: dependencies: node-domexception: 1.0.0 @@ -19476,6 +20600,10 @@ snapshots: fflate@0.8.2: {} + figures@3.2.0: + dependencies: + escape-string-regexp: 1.0.5 + figures@6.1.0: dependencies: is-unicode-supported: 2.1.0 @@ -19486,10 +20614,16 @@ snapshots: file-uri-to-path@1.0.0: {} + filelist@1.0.4: + dependencies: + minimatch: 5.1.6 + fill-range@7.1.1: dependencies: to-regex-range: 5.0.1 + filter-obj@5.1.0: {} + finalhandler@1.1.2: dependencies: debug: 2.6.9 @@ -19525,6 +20659,8 @@ snapshots: fast-querystring: 1.1.2 safe-regex2: 4.0.1 + find-up-simple@1.0.1: {} + find-up@4.1.0: dependencies: locate-path: 5.0.0 @@ -19540,6 +20676,12 @@ snapshots: locate-path: 7.2.0 path-exists: 5.0.0 + find-up@7.0.0: + dependencies: + locate-path: 7.2.0 + path-exists: 5.0.0 + unicorn-magic: 0.1.0 + flat-cache@4.0.1: dependencies: flatted: 3.3.3 @@ -19549,13 +20691,15 @@ snapshots: flatted@3.3.3: {} + fn.name@1.1.0: {} + focus-trap@7.6.4: dependencies: tabbable: 6.2.0 - follow-redirects@1.15.9(debug@4.4.0): + follow-redirects@1.15.9(debug@4.4.1): optionalDependencies: - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 for-each@0.3.5: dependencies: @@ -19583,6 +20727,14 @@ snapshots: fresh@0.5.2: {} + fresh@2.0.0: {} + + front-matter@4.0.2: + dependencies: + js-yaml: 3.14.1 + + fs-constants@1.0.0: {} + fs-extra@11.3.0: dependencies: graceful-fs: 4.2.11 @@ -19627,8 +20779,25 @@ snapshots: functions-have-names@1.2.3: {} + gauge@3.0.2: + dependencies: + aproba: 2.0.0 + color-support: 1.1.3 + console-control-strings: 1.1.0 + has-unicode: 2.0.1 + object-assign: 4.1.1 + signal-exit: 3.0.7 + string-width: 4.2.3 + strip-ansi: 6.0.1 + wide-align: 1.1.5 + gensync@1.0.0-beta.2: {} + get-amd-module-type@5.0.1: + dependencies: + ast-module-types: 5.0.0 + node-source-walk: 6.0.2 + get-caller-file@2.0.5: {} get-east-asian-width@1.3.0: {} @@ -19657,7 +20826,7 @@ snapshots: get-stream@5.2.0: dependencies: - pump: 3.0.3 + pump: 3.0.2 get-stream@6.0.1: {} @@ -19678,18 +20847,18 @@ snapshots: dependencies: resolve-pkg-maps: 1.0.0 - get-uri@6.0.5: + get-uri@6.0.4: dependencies: basic-ftp: 5.0.5 data-uri-to-buffer: 6.0.2 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 transitivePeerDependencies: - supports-color giget@1.2.5: dependencies: citty: 0.1.6 - consola: 3.4.0 + consola: 3.4.2 defu: 6.1.4 node-fetch-native: 1.6.6 nypm: 0.5.4 @@ -19705,16 +20874,14 @@ snapshots: nypm: 0.6.0 pathe: 2.0.3 - git-config-path@2.0.0: {} - - git-up@8.0.1: + git-up@8.1.1: dependencies: is-ssh: 1.4.1 parse-url: 9.2.0 - git-url-parse@16.0.1: + git-url-parse@16.1.0: dependencies: - git-up: 8.0.1 + git-up: 8.1.1 glob-parent@5.1.2: dependencies: @@ -19801,13 +20968,19 @@ snapshots: dependencies: '@sindresorhus/merge-streams': 2.3.0 fast-glob: 3.3.3 - ignore: 7.0.3 + ignore: 7.0.4 path-type: 6.0.0 slash: 5.1.0 unicorn-magic: 0.3.0 + gonzales-pe@4.3.0: + dependencies: + minimist: 1.2.8 + gopd@1.2.0: {} + graceful-fs@4.2.10: {} + graceful-fs@4.2.11: {} graphemer@1.4.0: {} @@ -19816,16 +20989,16 @@ snapshots: dependencies: duplexer: 0.1.2 - h3@1.15.1: + h3@1.15.3: dependencies: cookie-es: 1.2.2 - crossws: 0.3.4 + crossws: 0.3.5 defu: 6.1.4 - destr: 2.0.3 + destr: 2.0.5 iron-webcrypto: 1.2.1 node-mock-http: 1.0.0 radix3: 1.1.2 - ufo: 1.5.4 + ufo: 1.6.1 uncrypto: 0.1.3 handle-thing@2.0.1: {} @@ -19857,6 +21030,8 @@ snapshots: dependencies: has-symbols: 1.1.0 + has-unicode@2.0.1: {} + hash-sum@2.0.0: {} hasown@2.0.2: @@ -19872,7 +21047,7 @@ snapshots: hast-util-whitespace: 3.0.0 html-void-elements: 3.0.0 mdast-util-to-hast: 13.2.0 - property-information: 7.0.0 + property-information: 7.1.0 space-separated-tokens: 2.0.2 stringify-entities: 4.0.4 zwitch: 2.0.4 @@ -19887,7 +21062,11 @@ snapshots: hookable@5.5.3: {} - hosted-git-info@8.0.2: + hosted-git-info@7.0.2: + dependencies: + lru-cache: 10.4.3 + + hosted-git-info@8.1.0: dependencies: lru-cache: 10.4.3 @@ -19913,7 +21092,7 @@ snapshots: domutils: 3.2.2 entities: 4.5.0 - http-cache-semantics@4.1.1: {} + http-cache-semantics@4.2.0: {} http-deceiver@1.2.7: {} @@ -19932,19 +21111,19 @@ snapshots: statuses: 2.0.1 toidentifier: 1.0.1 - http-parser-js@0.5.9: {} + http-parser-js@0.5.10: {} http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.3 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 transitivePeerDependencies: - supports-color - http-proxy-middleware@2.0.7(@types/express@4.17.21): + http-proxy-middleware@2.0.9(@types/express@4.17.21): dependencies: '@types/http-proxy': 1.17.16 - http-proxy: 1.18.1(debug@4.4.0) + http-proxy: 1.18.1(debug@4.4.1) is-glob: 4.0.3 is-plain-obj: 3.0.0 micromatch: 4.0.8 @@ -19956,28 +21135,35 @@ snapshots: http-proxy-middleware@3.0.3: dependencies: '@types/http-proxy': 1.17.16 - debug: 4.4.0(supports-color@9.4.0) - http-proxy: 1.18.1(debug@4.4.0) + debug: 4.4.1 + http-proxy: 1.18.1(debug@4.4.1) is-glob: 4.0.3 is-plain-object: 5.0.0 micromatch: 4.0.8 transitivePeerDependencies: - supports-color - http-proxy@1.18.1(debug@4.4.0): + http-proxy@1.18.1(debug@4.4.1): dependencies: eventemitter3: 4.0.7 - follow-redirects: 1.15.9(debug@4.4.0) + follow-redirects: 1.15.9(debug@4.4.1) requires-port: 1.0.0 transitivePeerDependencies: - debug http-shutdown@1.2.2: {} - https-proxy-agent@7.0.6(supports-color@9.4.0): + https-proxy-agent@5.0.1: + dependencies: + agent-base: 6.0.2 + debug: 4.4.1 + transitivePeerDependencies: + - supports-color + + https-proxy-agent@7.0.6: dependencies: agent-base: 7.1.3 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 transitivePeerDependencies: - supports-color @@ -19989,7 +21175,7 @@ snapshots: human-signals@5.0.0: {} - human-signals@8.0.0: {} + human-signals@8.0.1: {} husky@9.1.7: {} @@ -20017,14 +21203,14 @@ snapshots: ignore@6.0.2: {} - ignore@7.0.3: {} + ignore@7.0.4: {} image-meta@0.2.1: {} image-size@0.5.5: optional: true - immutable@5.0.3: {} + immutable@5.1.2: {} import-fresh@3.3.1: dependencies: @@ -20039,23 +21225,23 @@ snapshots: mlly: 1.7.4 mocked-exports: 0.1.1 pathe: 2.0.3 - unplugin: 2.3.2 + unplugin: 2.3.4 transitivePeerDependencies: - rollup - impound@0.2.2(rollup@4.41.1): + impound@0.2.2(rollup@4.40.2): dependencies: - '@rollup/pluginutils': 5.1.4(rollup@4.41.1) + '@rollup/pluginutils': 5.1.4(rollup@4.40.2) mlly: 1.7.4 mocked-exports: 0.1.1 pathe: 2.0.3 - unplugin: 2.3.2 + unplugin: 2.3.4 transitivePeerDependencies: - rollup imurmurhash@0.1.4: {} - index-to-position@0.1.2: {} + index-to-position@1.1.0: {} inflight@1.0.6: dependencies: @@ -20078,11 +21264,11 @@ snapshots: hasown: 2.0.2 side-channel: 1.1.0 - ioredis@5.6.0: + ioredis@5.6.1: dependencies: '@ioredis/commands': 1.2.0 cluster-key-slot: 1.1.2 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 denque: 2.1.0 lodash.defaults: 4.2.0 lodash.isarguments: 3.1.0 @@ -20134,7 +21320,11 @@ snapshots: call-bound: 1.0.4 has-tostringtag: 1.0.2 - is-bun-module@1.3.0: + is-builtin-module@3.2.1: + dependencies: + builtin-modules: 3.3.0 + + is-bun-module@2.0.0: dependencies: semver: 7.7.2 @@ -20210,6 +21400,8 @@ snapshots: is-path-inside@4.0.0: {} + is-plain-obj@2.1.0: {} + is-plain-obj@3.0.0: {} is-plain-obj@4.1.0: {} @@ -20276,6 +21468,10 @@ snapshots: is-unicode-supported@2.1.0: {} + is-url-superb@4.0.0: {} + + is-url@1.2.4: {} + is-weakmap@2.0.2: {} is-weakref@1.1.1: @@ -20321,8 +21517,8 @@ snapshots: istanbul-lib-instrument@5.2.1: dependencies: - '@babel/core': 7.26.10 - '@babel/parser': 7.26.10 + '@babel/core': 7.27.1 + '@babel/parser': 7.27.2 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 semver: 6.3.1 @@ -20331,8 +21527,8 @@ snapshots: istanbul-lib-instrument@6.0.3: dependencies: - '@babel/core': 7.26.10 - '@babel/parser': 7.26.10 + '@babel/core': 7.26.9 + '@babel/parser': 7.27.2 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 semver: 7.7.2 @@ -20347,7 +21543,7 @@ snapshots: istanbul-lib-source-maps@4.0.1: dependencies: - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 istanbul-lib-coverage: 3.2.2 source-map: 0.6.1 transitivePeerDependencies: @@ -20356,7 +21552,7 @@ snapshots: istanbul-lib-source-maps@5.0.6: dependencies: '@jridgewell/trace-mapping': 0.3.25 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 istanbul-lib-coverage: 3.2.2 transitivePeerDependencies: - supports-color @@ -20381,10 +21577,26 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 + jake@10.9.2: + dependencies: + async: 3.2.6 + chalk: 4.1.2 + filelist: 1.0.4 + minimatch: 3.1.2 + jasmine-core@4.6.1: {} jasmine-core@5.2.0: {} + jest-diff@29.7.0: + dependencies: + chalk: 4.1.2 + diff-sequences: 29.6.3 + jest-get-type: 29.6.3 + pretty-format: 29.7.0 + + jest-get-type@29.6.3: {} + jest-worker@27.5.1: dependencies: '@types/node': 22.10.5 @@ -20407,8 +21619,6 @@ snapshots: js-cookie@3.0.5: {} - js-levenshtein@1.1.6: {} - js-tokens@4.0.0: {} js-tokens@9.0.1: {} @@ -20432,10 +21642,10 @@ snapshots: form-data: 4.0.2 html-encoding-sniffer: 4.0.0 http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.6(supports-color@9.4.0) + https-proxy-agent: 7.0.6 is-potential-custom-element-name: 1.0.1 - nwsapi: 2.2.18 - parse5: 7.2.1 + nwsapi: 2.2.20 + parse5: 7.3.0 rrweb-cssom: 0.6.0 saxes: 6.0.0 symbol-tree: 3.2.4 @@ -20444,8 +21654,8 @@ snapshots: webidl-conversions: 7.0.0 whatwg-encoding: 3.1.1 whatwg-mimetype: 4.0.0 - whatwg-url: 14.1.1 - ws: 8.18.1 + whatwg-url: 14.2.0 + ws: 8.18.2 xml-name-validator: 5.0.0 transitivePeerDependencies: - bufferutil @@ -20464,10 +21674,26 @@ snapshots: json-parse-even-better-errors@4.0.0: {} + json-schema-diff@0.18.1: + dependencies: + ajv: 8.17.1 + commander: 10.0.1 + convict: 6.2.4 + json-schema-ref-parser: 9.0.9 + json-schema-spec-types: 0.1.2 + lodash: 4.17.21 + verror: 1.10.1 + + json-schema-ref-parser@9.0.9: + dependencies: + '@apidevtools/json-schema-ref-parser': 9.0.9 + json-schema-ref-resolver@2.0.1: dependencies: dequal: 2.0.3 + json-schema-spec-types@0.1.2: {} + json-schema-traverse@0.4.1: {} json-schema-traverse@1.0.0: {} @@ -20482,6 +21708,8 @@ snapshots: json5@2.2.3: {} + jsonc-parser@3.2.0: {} + jsonc-parser@3.3.1: {} jsonfile@4.0.0: @@ -20496,6 +21724,8 @@ snapshots: jsonparse@1.3.1: {} + jsonpointer@5.0.1: {} + jsx-ast-utils@3.3.5: dependencies: array-includes: 3.1.8 @@ -20503,6 +21733,10 @@ snapshots: object.assign: 4.1.7 object.values: 1.2.1 + junk@4.0.1: {} + + jwt-decode@4.0.0: {} + karma-chrome-launcher@3.2.0: dependencies: which: 1.3.1 @@ -20544,7 +21778,7 @@ snapshots: dom-serialize: 2.2.1 glob: 7.2.3 graceful-fs: 4.2.11 - http-proxy: 1.18.1(debug@4.4.0) + http-proxy: 1.18.1(debug@4.4.1) isbinaryfile: 4.0.10 lodash: 4.17.21 log4js: 6.9.1 @@ -20583,12 +21817,26 @@ snapshots: kolorist@1.8.0: {} + kuler@2.0.0: {} + + ky@1.8.1: {} + + lambda-local@2.2.0: + dependencies: + commander: 10.0.1 + dotenv: 16.5.0 + winston: 3.17.0 + language-subtag-registry@0.3.23: {} language-tags@1.0.9: dependencies: language-subtag-registry: 0.3.23 + latest-version@9.0.0: + dependencies: + package-json: 10.0.1 + launch-editor@2.10.0: dependencies: picocolors: 1.1.1 @@ -20602,7 +21850,7 @@ snapshots: dependencies: less: 4.2.2 optionalDependencies: - webpack: 5.98.0(esbuild@0.25.2) + webpack: 5.98.0(esbuild@0.25.4) less@4.2.2: dependencies: @@ -20627,7 +21875,7 @@ snapshots: dependencies: webpack-sources: 3.2.3 optionalDependencies: - webpack: 5.98.0(esbuild@0.25.2) + webpack: 5.98.0(esbuild@0.25.4) light-my-request@6.6.0: dependencies: @@ -20641,11 +21889,13 @@ snapshots: lines-and-columns@1.2.4: {} + lines-and-columns@2.0.3: {} + lint-staged@15.3.0: dependencies: chalk: 5.4.1 commander: 12.1.0 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 execa: 8.0.1 lilconfig: 3.1.3 listr2: 8.2.5 @@ -20663,17 +21913,17 @@ snapshots: citty: 0.1.6 clipboardy: 4.0.0 consola: 3.4.2 - crossws: 0.3.4 + crossws: 0.3.5 defu: 6.1.4 get-port-please: 3.1.2 - h3: 1.15.1 + h3: 1.15.3 http-shutdown: 1.2.2 jiti: 2.4.2 mlly: 1.7.4 node-forge: 1.3.1 pathe: 1.1.2 - std-env: 3.8.1 - ufo: 1.5.4 + std-env: 3.9.0 + ufo: 1.6.1 untun: 0.1.3 uqr: 0.1.2 @@ -20723,7 +21973,7 @@ snapshots: dependencies: mlly: 1.7.4 pkg-types: 2.1.0 - quansync: 0.2.8 + quansync: 0.2.10 locate-character@3.0.0: {} @@ -20739,12 +21989,26 @@ snapshots: dependencies: p-locate: 6.0.0 + lodash-es@4.17.21: {} + + lodash.clonedeep@4.5.0: {} + lodash.debounce@4.0.8: {} lodash.defaults@4.2.0: {} + lodash.difference@4.5.0: {} + + lodash.flatten@4.4.0: {} + + lodash.get@4.4.2: {} + lodash.isarguments@3.1.0: {} + lodash.isequal@4.5.0: {} + + lodash.isplainobject@4.0.6: {} + lodash.memoize@4.1.2: {} lodash.merge@4.6.2: {} @@ -20753,6 +22017,8 @@ snapshots: lodash.startcase@4.4.0: {} + lodash.union@4.6.0: {} + lodash.uniq@4.5.0: {} lodash@4.17.21: {} @@ -20773,13 +22039,22 @@ snapshots: log4js@6.9.1: dependencies: date-format: 4.0.14 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 flatted: 3.3.3 rfdc: 1.4.1 streamroller: 3.1.5 transitivePeerDependencies: - supports-color + logform@2.7.0: + dependencies: + '@colors/colors': 1.6.0 + '@types/triple-beam': 1.3.5 + fecha: 4.2.3 + ms: 2.1.3 + safe-stable-stringify: 2.5.0 + triple-beam: 1.4.1 + loose-envify@1.4.0: dependencies: js-tokens: 4.0.0 @@ -20803,6 +22078,8 @@ snapshots: lru-cache@7.18.3: {} + luxon@3.6.1: {} + magic-regexp@0.8.0: dependencies: estree-walker: 3.0.3 @@ -20810,7 +22087,7 @@ snapshots: mlly: 1.7.4 regexp-tree: 0.1.27 type-level-regexp: 0.1.17 - ufo: 1.5.4 + ufo: 1.6.1 unplugin: 1.16.1 magic-string-ast@0.7.1: @@ -20823,8 +22100,8 @@ snapshots: magicast@0.3.5: dependencies: - '@babel/parser': 7.26.10 - '@babel/types': 7.26.10 + '@babel/parser': 7.27.2 + '@babel/types': 7.27.1 source-map-js: 1.2.1 make-dir@2.1.0: @@ -20833,6 +22110,10 @@ snapshots: semver: 5.7.2 optional: true + make-dir@3.1.0: + dependencies: + semver: 6.3.1 + make-dir@4.0.0: dependencies: semver: 7.7.2 @@ -20843,7 +22124,7 @@ snapshots: dependencies: '@npmcli/agent': 3.0.0 cacache: 19.0.1 - http-cache-semantics: 4.1.1 + http-cache-semantics: 4.2.0 minipass: 7.1.2 minipass-fetch: 4.0.1 minipass-flush: 1.0.5 @@ -20890,10 +22171,10 @@ snapshots: media-typer@0.3.0: {} - memfs@4.17.0: + memfs@4.17.1: dependencies: '@jsonjoy.com/json-pack': 1.2.0(tslib@2.8.1) - '@jsonjoy.com/util': 1.5.0(tslib@2.8.1) + '@jsonjoy.com/util': 1.6.0(tslib@2.8.1) tree-dump: 1.0.2(tslib@2.8.1) tslib: 2.8.1 @@ -20901,12 +22182,18 @@ snapshots: merge-descriptors@1.0.3: {} + merge-options@3.0.4: + dependencies: + is-plain-obj: 2.1.0 + merge-stream@2.0.0: {} merge2@1.4.1: {} methods@1.1.2: {} + micro-api-client@3.3.0: {} + micromark-util-character@2.1.1: dependencies: micromark-util-symbol: 2.0.1 @@ -20937,13 +22224,17 @@ snapshots: dependencies: mime-db: 1.52.0 + mime-types@3.0.1: + dependencies: + mime-db: 1.54.0 + mime@1.6.0: {} mime@2.6.0: {} mime@3.0.0: {} - mime@4.0.6: {} + mime@4.0.7: {} mimic-fn@2.1.0: {} @@ -20953,9 +22244,9 @@ snapshots: mini-css-extract-plugin@2.9.2(webpack@5.98.0(esbuild@0.25.0)): dependencies: - schema-utils: 4.3.0 + schema-utils: 4.3.2 tapable: 2.2.1 - webpack: 5.98.0(esbuild@0.25.2) + webpack: 5.98.0(esbuild@0.25.4) minimalistic-assert@1.0.1: {} @@ -20971,6 +22262,10 @@ snapshots: dependencies: brace-expansion: 2.0.1 + minimatch@9.0.3: + dependencies: + brace-expansion: 2.0.1 + minimatch@9.0.5: dependencies: brace-expansion: 2.0.1 @@ -20985,7 +22280,7 @@ snapshots: dependencies: minipass: 7.1.2 minipass-sized: 1.0.3 - minizlib: 3.0.1 + minizlib: 3.0.2 optionalDependencies: encoding: 0.1.13 @@ -21016,10 +22311,9 @@ snapshots: minipass: 3.3.6 yallist: 4.0.0 - minizlib@3.0.1: + minizlib@3.0.2: dependencies: minipass: 7.1.2 - rimraf: 5.0.10 mitt@3.0.1: {} @@ -21033,19 +22327,19 @@ snapshots: mkdist@1.6.0(sass@1.85.0)(typescript@5.8.3): dependencies: - autoprefixer: 10.4.20(postcss@8.5.4) + autoprefixer: 10.4.20(postcss@8.5.3) citty: 0.1.6 - cssnano: 7.0.6(postcss@8.5.4) + cssnano: 7.0.7(postcss@8.5.3) defu: 6.1.4 esbuild: 0.24.2 jiti: 1.21.7 mlly: 1.7.4 pathe: 1.1.2 pkg-types: 1.3.1 - postcss: 8.5.4 - postcss-nested: 6.2.0(postcss@8.5.4) + postcss: 8.5.3 + postcss-nested: 6.2.0(postcss@8.5.3) semver: 7.7.2 - tinyglobby: 0.2.12 + tinyglobby: 0.2.13 optionalDependencies: sass: 1.85.0 typescript: 5.8.3 @@ -21055,10 +22349,15 @@ snapshots: acorn: 8.14.1 pathe: 2.0.3 pkg-types: 1.3.1 - ufo: 1.5.4 + ufo: 1.6.1 mocked-exports@0.1.1: {} + module-definition@5.0.1: + dependencies: + ast-module-types: 5.0.0 + node-source-walk: 6.0.2 + mri@1.2.0: {} mrmime@2.0.1: {} @@ -21105,14 +22404,12 @@ snapshots: nanoid@3.3.11: {} - nanoid@3.3.9: {} - - nanoid@5.1.3: {} - nanoid@5.1.5: {} nanotar@0.1.1: {} + napi-postinstall@0.2.4: {} + natural-compare-lite@1.4.0: {} natural-compare@1.4.0: {} @@ -21131,6 +22428,17 @@ snapshots: neo-async@2.6.2: {} + nested-error-stacks@2.1.1: {} + + netlify@13.3.5: + dependencies: + '@netlify/open-api': 2.37.0 + lodash-es: 4.17.21 + micro-api-client: 3.3.0 + node-fetch: 3.3.2 + p-wait-for: 5.0.2 + qs: 6.14.0 + netmask@2.0.2: {} next@15.2.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.85.0): @@ -21139,7 +22447,7 @@ snapshots: '@swc/counter': 0.1.3 '@swc/helpers': 0.5.15 busboy: 1.6.0 - caniuse-lite: 1.0.30001709 + caniuse-lite: 1.0.30001718 postcss: 8.4.31 react: 19.0.0 react-dom: 19.0.0(react@19.0.0) @@ -21159,81 +22467,78 @@ snapshots: - '@babel/core' - babel-plugin-macros - nitropack@2.11.6(encoding@0.1.13)(typescript@5.8.3): - dependencies: - '@cloudflare/kv-asset-handler': 0.3.4 - '@netlify/functions': 3.0.0 - '@rollup/plugin-alias': 5.1.1(rollup@4.41.1) - '@rollup/plugin-commonjs': 28.0.3(rollup@4.41.1) - '@rollup/plugin-inject': 5.0.5(rollup@4.41.1) - '@rollup/plugin-json': 6.1.0(rollup@4.41.1) - '@rollup/plugin-node-resolve': 16.0.1(rollup@4.41.1) - '@rollup/plugin-replace': 6.0.2(rollup@4.41.1) - '@rollup/plugin-terser': 0.4.4(rollup@4.41.1) - '@types/http-proxy': 1.17.16 - '@vercel/nft': 0.29.2(encoding@0.1.13)(rollup@4.41.1) + nitropack@2.11.12(encoding@0.1.13): + dependencies: + '@cloudflare/kv-asset-handler': 0.4.0 + '@netlify/functions': 3.1.8(encoding@0.1.13)(rollup@4.40.2) + '@rollup/plugin-alias': 5.1.1(rollup@4.40.2) + '@rollup/plugin-commonjs': 28.0.3(rollup@4.40.2) + '@rollup/plugin-inject': 5.0.5(rollup@4.40.2) + '@rollup/plugin-json': 6.1.0(rollup@4.40.2) + '@rollup/plugin-node-resolve': 16.0.1(rollup@4.40.2) + '@rollup/plugin-replace': 6.0.2(rollup@4.40.2) + '@rollup/plugin-terser': 0.4.4(rollup@4.40.2) + '@vercel/nft': 0.29.3(encoding@0.1.13)(rollup@4.40.2) archiver: 7.0.1 - c12: 3.0.2(magicast@0.3.5) + c12: 3.0.3(magicast@0.3.5) chokidar: 4.0.3 citty: 0.1.6 - compatx: 0.1.8 - confbox: 0.2.1 + compatx: 0.2.0 + confbox: 0.2.2 consola: 3.4.2 cookie-es: 2.0.0 croner: 9.0.0 - crossws: 0.3.4 - db0: 0.3.1 + crossws: 0.3.5 + db0: 0.3.2 defu: 6.1.4 - destr: 2.0.3 + destr: 2.0.5 dot-prop: 9.0.0 - esbuild: 0.25.5 + esbuild: 0.25.4 escape-string-regexp: 5.0.0 etag: 1.8.1 - exsolve: 1.0.4 - fs-extra: 11.3.0 + exsolve: 1.0.5 globby: 14.1.0 gzip-size: 7.0.0 - h3: 1.15.1 + h3: 1.15.3 hookable: 5.5.3 httpxy: 0.1.7 - ioredis: 5.6.0 + ioredis: 5.6.1 jiti: 2.4.2 klona: 2.0.6 knitwork: 1.2.0 listhen: 1.9.0 magic-string: 0.30.17 magicast: 0.3.5 - mime: 4.0.6 + mime: 4.0.7 mlly: 1.7.4 node-fetch-native: 1.6.6 node-mock-http: 1.0.0 ofetch: 1.4.1 ohash: 2.0.11 - openapi-typescript: 7.6.1(typescript@5.8.3) pathe: 2.0.3 perfect-debounce: 1.0.0 pkg-types: 2.1.0 pretty-bytes: 6.1.1 radix3: 1.1.2 - rollup: 4.41.1 - rollup-plugin-visualizer: 5.14.0(rollup@4.41.1) + rollup: 4.40.2 + rollup-plugin-visualizer: 5.14.0(rollup@4.40.2) scule: 1.3.0 semver: 7.7.2 serve-placeholder: 2.0.2 - serve-static: 1.16.2 + serve-static: 2.2.0 source-map: 0.7.4 - std-env: 3.8.1 - ufo: 1.5.4 - ultrahtml: 1.5.3 + std-env: 3.9.0 + ufo: 1.6.1 + ultrahtml: 1.6.0 uncrypto: 0.1.3 unctx: 2.4.1 - unenv: 2.0.0-rc.14 - unimport: 4.2.0 + unenv: 2.0.0-rc.17 + unimport: 5.0.1 unplugin-utils: 0.2.4 - unstorage: 1.15.0(db0@0.3.1)(ioredis@5.6.0) + unstorage: 1.16.0(db0@0.3.2)(ioredis@5.6.1) untyped: 2.0.0 unwasm: 0.3.9 - youch: 4.1.0-beta.6 + youch: 4.1.0-beta.7 youch-core: 0.3.2 transitivePeerDependencies: - '@azure/app-configuration' @@ -21260,7 +22565,6 @@ snapshots: - rolldown - sqlite3 - supports-color - - typescript - uploadthing node-addon-api@6.1.0: @@ -21295,37 +22599,57 @@ snapshots: node-gyp-build-optional-packages@5.2.2: dependencies: - detect-libc: 2.0.3 + detect-libc: 2.0.4 optional: true node-gyp-build@4.8.4: {} - node-gyp@11.1.0: + node-gyp@11.2.0: dependencies: env-paths: 2.2.1 exponential-backoff: 3.1.2 - glob: 10.4.3 graceful-fs: 4.2.11 make-fetch-happen: 14.0.3 nopt: 8.1.0 proc-log: 5.0.0 semver: 7.7.2 tar: 7.4.3 + tinyglobby: 0.2.13 which: 5.0.0 transitivePeerDependencies: - supports-color + node-machine-id@1.1.12: {} + node-mock-http@1.0.0: {} node-releases@2.0.19: {} + node-source-walk@6.0.2: + dependencies: + '@babel/parser': 7.27.2 + + nopt@5.0.0: + dependencies: + abbrev: 1.1.1 + nopt@7.2.1: dependencies: abbrev: 2.0.0 nopt@8.1.0: dependencies: - abbrev: 3.0.0 + abbrev: 3.0.1 + + normalize-package-data@6.0.2: + dependencies: + hosted-git-info: 7.0.2 + semver: 7.7.2 + validate-npm-package-license: 3.0.4 + + normalize-path@2.1.1: + dependencies: + remove-trailing-separator: 1.1.0 normalize-path@3.0.0: {} @@ -21345,7 +22669,7 @@ snapshots: npm-package-arg@12.0.2: dependencies: - hosted-git-info: 8.0.2 + hosted-git-info: 8.1.0 proc-log: 5.0.0 semver: 7.7.2 validate-npm-package-name: 6.0.0 @@ -21363,12 +22687,12 @@ snapshots: npm-registry-fetch@18.0.2: dependencies: - '@npmcli/redact': 3.1.1 + '@npmcli/redact': 3.2.2 jsonparse: 1.3.1 make-fetch-happen: 14.0.3 minipass: 7.1.2 minipass-fetch: 4.0.1 - minizlib: 3.0.1 + minizlib: 3.0.2 npm-package-arg: 12.0.2 proc-log: 5.0.0 transitivePeerDependencies: @@ -21397,20 +22721,27 @@ snapshots: path-key: 4.0.0 unicorn-magic: 0.3.0 + npmlog@5.0.1: + dependencies: + are-we-there-yet: 2.0.0 + console-control-strings: 1.1.0 + gauge: 3.0.2 + set-blocking: 2.0.0 + nth-check@2.1.1: dependencies: boolbase: 1.0.0 - nuxi@3.22.5: {} + nuxi@3.25.1: {} - nuxt@3.14.1592(@parcel/watcher@2.5.1)(@types/node@22.10.5)(db0@0.3.1)(encoding@0.1.13)(eslint@9.17.0(jiti@2.4.2))(ioredis@5.6.0)(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@3.29.5)(sass@1.85.0)(terser@5.39.0)(typescript@5.8.3)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)): + nuxt@3.14.1592(@parcel/watcher@2.5.1)(@types/node@22.10.5)(db0@0.3.2)(encoding@0.1.13)(eslint@9.17.0(jiti@2.4.2))(ioredis@5.6.1)(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@3.29.5)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)): dependencies: '@nuxt/devalue': 2.0.2 - '@nuxt/devtools': 1.7.0(rollup@3.29.5)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3)) + '@nuxt/devtools': 1.7.0(rollup@3.29.5)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3)) '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5) '@nuxt/schema': 3.14.1592(magicast@0.3.5)(rollup@3.29.5) - '@nuxt/telemetry': 2.6.5(magicast@0.3.5) - '@nuxt/vite-builder': 3.14.1592(@types/node@22.10.5)(eslint@9.17.0(jiti@2.4.2))(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@3.29.5)(sass@1.85.0)(terser@5.39.0)(typescript@5.8.3)(vue@3.5.13(typescript@5.8.3)) + '@nuxt/telemetry': 2.6.6(magicast@0.3.5) + '@nuxt/vite-builder': 3.14.1592(@types/node@22.10.5)(eslint@9.17.0(jiti@2.4.2))(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@3.29.5)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vue@3.5.13(typescript@5.8.3)) '@unhead/dom': 1.11.20 '@unhead/shared': 1.11.20 '@unhead/ssr': 1.11.20 @@ -21423,14 +22754,14 @@ snapshots: consola: 3.4.2 cookie-es: 1.2.2 defu: 6.1.4 - destr: 2.0.3 + destr: 2.0.5 devalue: 5.1.1 errx: 0.1.0 esbuild: 0.24.2 escape-string-regexp: 5.0.0 estree-walker: 3.0.3 globby: 14.1.0 - h3: 1.15.1 + h3: 1.15.3 hookable: 5.5.3 ignore: 6.0.2 impound: 0.2.2(rollup@3.29.5) @@ -21440,8 +22771,8 @@ snapshots: magic-string: 0.30.17 mlly: 1.7.4 nanotar: 0.1.1 - nitropack: 2.11.6(encoding@0.1.13)(typescript@5.8.3) - nuxi: 3.22.5 + nitropack: 2.11.12(encoding@0.1.13) + nuxi: 3.25.1 nypm: 0.3.12 ofetch: 1.4.1 ohash: 1.1.6 @@ -21451,11 +22782,11 @@ snapshots: radix3: 1.1.2 scule: 1.3.0 semver: 7.7.2 - std-env: 3.8.1 + std-env: 3.9.0 strip-literal: 2.1.1 tinyglobby: 0.2.10 - ufo: 1.5.4 - ultrahtml: 1.5.3 + ufo: 1.6.1 + ultrahtml: 1.6.0 uncrypto: 0.1.3 unctx: 2.4.1 unenv: 1.10.0 @@ -21463,7 +22794,127 @@ snapshots: unimport: 3.14.6(rollup@3.29.5) unplugin: 1.16.1 unplugin-vue-router: 0.10.9(rollup@3.29.5)(vue-router@4.5.0(vue@3.5.13(typescript@5.8.3)))(vue@3.5.13(typescript@5.8.3)) - unstorage: 1.15.0(db0@0.3.1)(ioredis@5.6.0) + unstorage: 1.16.0(db0@0.3.2)(ioredis@5.6.1) + untyped: 1.5.2 + vue: 3.5.13(typescript@5.8.3) + vue-bundle-renderer: 2.1.1 + vue-devtools-stub: 0.1.0 + vue-router: 4.5.0(vue@3.5.13(typescript@5.8.3)) + optionalDependencies: + '@parcel/watcher': 2.5.1 + '@types/node': 22.10.5 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@biomejs/biome' + - '@capacitor/preferences' + - '@deno/kv' + - '@electric-sql/pglite' + - '@libsql/client' + - '@netlify/blobs' + - '@planetscale/database' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/kv' + - aws4fetch + - better-sqlite3 + - bufferutil + - db0 + - drizzle-orm + - encoding + - eslint + - idb-keyval + - ioredis + - less + - lightningcss + - magicast + - meow + - mysql2 + - optionator + - rolldown + - rollup + - sass + - sass-embedded + - sqlite3 + - stylelint + - stylus + - sugarss + - supports-color + - terser + - typescript + - uploadthing + - utf-8-validate + - vite + - vls + - vti + - vue-tsc + - xml2js + + nuxt@3.14.1592(@parcel/watcher@2.5.1)(@types/node@22.10.5)(db0@0.3.2)(encoding@0.1.13)(eslint@9.17.0(jiti@2.4.2))(ioredis@5.6.1)(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.40.2)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)): + dependencies: + '@nuxt/devalue': 2.0.2 + '@nuxt/devtools': 1.7.0(rollup@4.40.2)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1))(vue@3.5.13(typescript@5.8.3)) + '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.40.2) + '@nuxt/schema': 3.14.1592(magicast@0.3.5)(rollup@4.40.2) + '@nuxt/telemetry': 2.6.6(magicast@0.3.5) + '@nuxt/vite-builder': 3.14.1592(@types/node@22.10.5)(eslint@9.17.0(jiti@2.4.2))(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.40.2)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vue@3.5.13(typescript@5.8.3)) + '@unhead/dom': 1.11.20 + '@unhead/shared': 1.11.20 + '@unhead/ssr': 1.11.20 + '@unhead/vue': 1.11.20(vue@3.5.13(typescript@5.8.3)) + '@vue/shared': 3.5.13 + acorn: 8.14.0 + c12: 2.0.1(magicast@0.3.5) + chokidar: 4.0.3 + compatx: 0.1.8 + consola: 3.4.2 + cookie-es: 1.2.2 + defu: 6.1.4 + destr: 2.0.5 + devalue: 5.1.1 + errx: 0.1.0 + esbuild: 0.24.2 + escape-string-regexp: 5.0.0 + estree-walker: 3.0.3 + globby: 14.1.0 + h3: 1.15.3 + hookable: 5.5.3 + ignore: 6.0.2 + impound: 0.2.2(rollup@4.40.2) + jiti: 2.4.2 + klona: 2.0.6 + knitwork: 1.2.0 + magic-string: 0.30.17 + mlly: 1.7.4 + nanotar: 0.1.1 + nitropack: 2.11.12(encoding@0.1.13) + nuxi: 3.25.1 + nypm: 0.3.12 + ofetch: 1.4.1 + ohash: 1.1.6 + pathe: 1.1.2 + perfect-debounce: 1.0.0 + pkg-types: 1.3.1 + radix3: 1.1.2 + scule: 1.3.0 + semver: 7.7.2 + std-env: 3.9.0 + strip-literal: 2.1.1 + tinyglobby: 0.2.10 + ufo: 1.6.1 + ultrahtml: 1.6.0 + uncrypto: 0.1.3 + unctx: 2.4.1 + unenv: 1.10.0 + unhead: 1.11.20 + unimport: 3.14.6(rollup@4.40.2) + unplugin: 1.16.1 + unplugin-vue-router: 0.10.9(rollup@4.40.2)(vue-router@4.5.0(vue@3.5.13(typescript@5.8.3)))(vue@3.5.13(typescript@5.8.3)) + unstorage: 1.16.0(db0@0.3.2)(ioredis@5.6.1) untyped: 1.5.2 vue: 3.5.13(typescript@5.8.3) vue-bundle-renderer: 2.1.1 @@ -21523,14 +22974,14 @@ snapshots: - vue-tsc - xml2js - nuxt@3.14.1592(@parcel/watcher@2.5.1)(@types/node@22.10.5)(db0@0.3.1)(encoding@0.1.13)(eslint@9.17.0(jiti@2.4.2))(ioredis@5.6.0)(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.41.1)(sass@1.85.0)(terser@5.39.0)(typescript@5.8.3)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)): + nuxt@3.14.1592(@parcel/watcher@2.5.1)(@types/node@22.10.5)(db0@0.3.2)(encoding@0.1.13)(eslint@9.17.0(jiti@2.4.2))(ioredis@5.6.1)(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.40.2)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)): dependencies: '@nuxt/devalue': 2.0.2 - '@nuxt/devtools': 1.7.0(rollup@4.41.1)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3)) - '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.41.1) - '@nuxt/schema': 3.14.1592(magicast@0.3.5)(rollup@4.41.1) - '@nuxt/telemetry': 2.6.5(magicast@0.3.5) - '@nuxt/vite-builder': 3.14.1592(@types/node@22.10.5)(eslint@9.17.0(jiti@2.4.2))(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.41.1)(sass@1.85.0)(terser@5.39.0)(typescript@5.8.3)(vue@3.5.13(typescript@5.8.3)) + '@nuxt/devtools': 1.7.0(rollup@4.40.2)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3)) + '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.40.2) + '@nuxt/schema': 3.14.1592(magicast@0.3.5)(rollup@4.40.2) + '@nuxt/telemetry': 2.6.6(magicast@0.3.5) + '@nuxt/vite-builder': 3.14.1592(@types/node@22.10.5)(eslint@9.17.0(jiti@2.4.2))(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.40.2)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vue@3.5.13(typescript@5.8.3)) '@unhead/dom': 1.11.20 '@unhead/shared': 1.11.20 '@unhead/ssr': 1.11.20 @@ -21543,25 +22994,25 @@ snapshots: consola: 3.4.2 cookie-es: 1.2.2 defu: 6.1.4 - destr: 2.0.3 + destr: 2.0.5 devalue: 5.1.1 errx: 0.1.0 esbuild: 0.24.2 escape-string-regexp: 5.0.0 estree-walker: 3.0.3 globby: 14.1.0 - h3: 1.15.1 + h3: 1.15.3 hookable: 5.5.3 ignore: 6.0.2 - impound: 0.2.2(rollup@4.41.1) + impound: 0.2.2(rollup@4.40.2) jiti: 2.4.2 klona: 2.0.6 knitwork: 1.2.0 magic-string: 0.30.17 mlly: 1.7.4 nanotar: 0.1.1 - nitropack: 2.11.6(encoding@0.1.13)(typescript@5.8.3) - nuxi: 3.22.5 + nitropack: 2.11.12(encoding@0.1.13) + nuxi: 3.25.1 nypm: 0.3.12 ofetch: 1.4.1 ohash: 1.1.6 @@ -21571,19 +23022,19 @@ snapshots: radix3: 1.1.2 scule: 1.3.0 semver: 7.7.2 - std-env: 3.8.1 + std-env: 3.9.0 strip-literal: 2.1.1 tinyglobby: 0.2.10 - ufo: 1.5.4 - ultrahtml: 1.5.3 + ufo: 1.6.1 + ultrahtml: 1.6.0 uncrypto: 0.1.3 unctx: 2.4.1 unenv: 1.10.0 unhead: 1.11.20 - unimport: 3.14.6(rollup@4.41.1) + unimport: 3.14.6(rollup@4.40.2) unplugin: 1.16.1 - unplugin-vue-router: 0.10.9(rollup@4.41.1)(vue-router@4.5.0(vue@3.5.13(typescript@5.8.3)))(vue@3.5.13(typescript@5.8.3)) - unstorage: 1.15.0(db0@0.3.1)(ioredis@5.6.0) + unplugin-vue-router: 0.10.9(rollup@4.40.2)(vue-router@4.5.0(vue@3.5.13(typescript@5.8.3)))(vue@3.5.13(typescript@5.8.3)) + unstorage: 1.16.0(db0@0.3.2)(ioredis@5.6.1) untyped: 1.5.2 vue: 3.5.13(typescript@5.8.3) vue-bundle-renderer: 2.1.1 @@ -21643,7 +23094,58 @@ snapshots: - vue-tsc - xml2js - nwsapi@2.2.18: {} + nwsapi@2.2.20: {} + + nx@21.0.3: + dependencies: + '@napi-rs/wasm-runtime': 0.2.4 + '@yarnpkg/lockfile': 1.1.0 + '@yarnpkg/parsers': 3.0.2 + '@zkochan/js-yaml': 0.0.7 + axios: 1.9.0 + chalk: 4.1.2 + cli-cursor: 3.1.0 + cli-spinners: 2.6.1 + cliui: 8.0.1 + dotenv: 16.4.7 + dotenv-expand: 11.0.7 + enquirer: 2.3.6 + figures: 3.2.0 + flat: 5.0.2 + front-matter: 4.0.2 + ignore: 5.3.2 + jest-diff: 29.7.0 + jsonc-parser: 3.2.0 + lines-and-columns: 2.0.3 + minimatch: 9.0.3 + node-machine-id: 1.1.12 + npm-run-path: 4.0.1 + open: 8.4.2 + ora: 5.3.0 + resolve.exports: 2.0.3 + semver: 7.7.2 + string-width: 4.2.3 + tar-stream: 2.2.0 + tmp: 0.2.3 + tree-kill: 1.2.2 + tsconfig-paths: 4.2.0 + tslib: 2.8.1 + yaml: 2.8.0 + yargs: 17.7.2 + yargs-parser: 21.1.1 + optionalDependencies: + '@nx/nx-darwin-arm64': 21.0.3 + '@nx/nx-darwin-x64': 21.0.3 + '@nx/nx-freebsd-x64': 21.0.3 + '@nx/nx-linux-arm-gnueabihf': 21.0.3 + '@nx/nx-linux-arm64-gnu': 21.0.3 + '@nx/nx-linux-arm64-musl': 21.0.3 + '@nx/nx-linux-x64-gnu': 21.0.3 + '@nx/nx-linux-x64-musl': 21.0.3 + '@nx/nx-win32-arm64-msvc': 21.0.3 + '@nx/nx-win32-x64-msvc': 21.0.3 + transitivePeerDependencies: + - debug nypm@0.3.12: dependencies: @@ -21652,7 +23154,7 @@ snapshots: execa: 8.0.1 pathe: 1.1.2 pkg-types: 1.3.1 - ufo: 1.5.4 + ufo: 1.6.1 nypm@0.4.1: dependencies: @@ -21661,7 +23163,7 @@ snapshots: pathe: 1.1.2 pkg-types: 1.3.1 tinyexec: 0.3.2 - ufo: 1.5.4 + ufo: 1.6.1 nypm@0.5.4: dependencies: @@ -21670,7 +23172,7 @@ snapshots: pathe: 2.0.3 pkg-types: 1.3.1 tinyexec: 0.3.2 - ufo: 1.5.4 + ufo: 1.6.1 nypm@0.6.0: dependencies: @@ -21697,9 +23199,10 @@ snapshots: has-symbols: 1.1.0 object-keys: 1.1.1 - object.entries@1.1.8: + object.entries@1.1.9: dependencies: call-bind: 1.0.8 + call-bound: 1.0.4 define-properties: 1.2.1 es-object-atoms: 1.1.1 @@ -21727,9 +23230,9 @@ snapshots: ofetch@1.4.1: dependencies: - destr: 2.0.3 + destr: 2.0.5 node-fetch-native: 1.6.6 - ufo: 1.5.4 + ufo: 1.6.1 ohash@1.1.6: {} @@ -21751,6 +23254,10 @@ snapshots: dependencies: wrappy: 1.0.2 + one-time@1.0.0: + dependencies: + fn.name: 1.1.0 + onetime@5.1.2: dependencies: mimic-fn: 2.1.0 @@ -21789,15 +23296,26 @@ snapshots: is-docker: 2.2.1 is-wsl: 2.2.0 - openapi-typescript@7.6.1(typescript@5.8.3): + openapi-diff@0.23.7(openapi-types@12.1.3): dependencies: - '@redocly/openapi-core': 1.33.1(supports-color@9.4.0) - ansi-colors: 4.1.3 - change-case: 5.4.4 - parse-json: 8.1.0 - supports-color: 9.4.0 - typescript: 5.8.3 - yargs-parser: 21.1.1 + axios: 1.8.2 + commander: 8.3.0 + js-yaml: 4.1.0 + json-schema-diff: 0.18.1 + jsonpointer: 5.0.1 + lodash: 4.17.21 + openapi3-ts: 2.0.2 + swagger-parser: 10.0.3(openapi-types@12.1.3) + verror: 1.10.1 + transitivePeerDependencies: + - debug + - openapi-types + + openapi-types@12.1.3: {} + + openapi3-ts@2.0.2: + dependencies: + yaml: 1.10.2 optionator@0.9.4: dependencies: @@ -21808,6 +23326,17 @@ snapshots: type-check: 0.4.0 word-wrap: 1.2.5 + ora@5.3.0: + dependencies: + bl: 4.1.0 + chalk: 4.1.2 + cli-cursor: 3.1.0 + cli-spinners: 2.9.2 + is-interactive: 1.0.0 + log-symbols: 4.1.0 + strip-ansi: 6.0.1 + wcwidth: 1.0.1 + ora@5.4.1: dependencies: bl: 4.1.0 @@ -21833,6 +23362,10 @@ snapshots: object-keys: 1.1.1 safe-push-apply: 1.0.0 + p-event@5.0.1: + dependencies: + p-timeout: 5.1.0 + p-filter@2.1.0: dependencies: p-map: 2.1.0 @@ -21847,7 +23380,7 @@ snapshots: p-limit@4.0.0: dependencies: - yocto-queue: 1.2.0 + yocto-queue: 1.2.1 p-locate@4.1.0: dependencies: @@ -21871,16 +23404,24 @@ snapshots: is-network-error: 1.1.0 retry: 0.13.1 + p-timeout@5.1.0: {} + + p-timeout@6.1.4: {} + p-try@2.2.0: {} + p-wait-for@5.0.2: + dependencies: + p-timeout: 6.1.4 + pac-proxy-agent@7.2.0: dependencies: '@tootallnate/quickjs-emscripten': 0.23.0 agent-base: 7.1.3 - debug: 4.4.0(supports-color@9.4.0) - get-uri: 6.0.5 + debug: 4.4.1 + get-uri: 6.0.4 http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.6(supports-color@9.4.0) + https-proxy-agent: 7.0.6 pac-resolver: 7.0.1 socks-proxy-agent: 8.0.5 transitivePeerDependencies: @@ -21893,9 +23434,18 @@ snapshots: package-json-from-dist@1.0.1: {} + package-json@10.0.1: + dependencies: + ky: 1.8.1 + registry-auth-token: 5.1.0 + registry-url: 6.0.1 + semver: 7.7.2 + package-manager-detector@0.2.11: dependencies: - quansync: 0.2.8 + quansync: 0.2.10 + + package-manager-detector@1.3.0: {} packrup@0.1.2: {} @@ -21925,41 +23475,38 @@ snapshots: dependencies: callsites: 3.1.0 - parse-git-config@3.0.0: - dependencies: - git-config-path: 2.0.0 - ini: 1.3.8 + parse-gitignore@2.0.0: {} parse-json@5.2.0: dependencies: - '@babel/code-frame': 7.26.2 + '@babel/code-frame': 7.27.1 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 - parse-json@8.1.0: + parse-json@8.3.0: dependencies: - '@babel/code-frame': 7.26.2 - index-to-position: 0.1.2 - type-fest: 4.37.0 + '@babel/code-frame': 7.27.1 + index-to-position: 1.1.0 + type-fest: 4.41.0 parse-ms@4.0.0: {} parse-node-version@1.0.1: {} - parse-path@7.0.1: + parse-path@7.1.0: dependencies: protocols: 2.0.2 parse-url@9.2.0: dependencies: - '@types/parse-path': 7.0.3 - parse-path: 7.0.1 + '@types/parse-path': 7.1.0 + parse-path: 7.1.0 parse5-html-rewriting-stream@7.0.0: dependencies: entities: 4.5.0 - parse5: 7.2.1 + parse5: 7.3.0 parse5-sax-parser: 7.0.0 parse5-htmlparser2-tree-adapter@6.0.1: @@ -21968,15 +23515,15 @@ snapshots: parse5-sax-parser@7.0.0: dependencies: - parse5: 7.2.1 + parse5: 7.3.0 parse5@5.1.1: {} parse5@6.0.1: {} - parse5@7.2.1: + parse5@7.3.0: dependencies: - entities: 4.5.0 + entities: 6.0.0 parseurl@1.3.3: {} @@ -22059,7 +23606,7 @@ snapshots: sonic-boom: 4.2.0 thread-stream: 3.1.0 - pirates@4.0.6: {} + pirates@4.0.7: {} piscina@4.8.0: optionalDependencies: @@ -22077,62 +23624,60 @@ snapshots: pkg-types@2.1.0: dependencies: - confbox: 0.2.1 - exsolve: 1.0.4 + confbox: 0.2.2 + exsolve: 1.0.5 pathe: 2.0.3 - pluralize@8.0.0: {} - possible-typed-array-names@1.1.0: {} - postcss-calc@10.1.1(postcss@8.5.4): + postcss-calc@10.1.1(postcss@8.5.3): dependencies: - postcss: 8.5.4 + postcss: 8.5.3 postcss-selector-parser: 7.1.0 postcss-value-parser: 4.2.0 - postcss-colormin@7.0.2(postcss@8.5.4): + postcss-colormin@7.0.3(postcss@8.5.3): dependencies: - browserslist: 4.24.4 + browserslist: 4.24.5 caniuse-api: 3.0.0 colord: 2.9.3 - postcss: 8.5.4 + postcss: 8.5.3 postcss-value-parser: 4.2.0 - postcss-convert-values@7.0.4(postcss@8.5.4): + postcss-convert-values@7.0.5(postcss@8.5.3): dependencies: - browserslist: 4.24.4 - postcss: 8.5.4 + browserslist: 4.24.5 + postcss: 8.5.3 postcss-value-parser: 4.2.0 - postcss-discard-comments@7.0.3(postcss@8.5.4): + postcss-discard-comments@7.0.4(postcss@8.5.3): dependencies: - postcss: 8.5.4 - postcss-selector-parser: 6.1.2 + postcss: 8.5.3 + postcss-selector-parser: 7.1.0 - postcss-discard-duplicates@7.0.1(postcss@8.5.4): + postcss-discard-duplicates@7.0.2(postcss@8.5.3): dependencies: - postcss: 8.5.4 + postcss: 8.5.3 - postcss-discard-empty@7.0.0(postcss@8.5.4): + postcss-discard-empty@7.0.1(postcss@8.5.3): dependencies: - postcss: 8.5.4 + postcss: 8.5.3 - postcss-discard-overridden@7.0.0(postcss@8.5.4): + postcss-discard-overridden@7.0.1(postcss@8.5.3): dependencies: - postcss: 8.5.4 + postcss: 8.5.3 - postcss-import@15.1.0(postcss@8.5.4): + postcss-import@15.1.0(postcss@8.4.41): dependencies: - postcss: 8.5.4 + postcss: 8.4.41 postcss-value-parser: 4.2.0 read-cache: 1.0.0 resolve: 1.22.10 - postcss-js@4.0.1(postcss@8.5.4): + postcss-js@4.0.1(postcss@8.4.41): dependencies: camelcase-css: 2.0.1 - postcss: 8.5.4 + postcss: 8.4.41 postcss-load-config@3.1.4(postcss@8.4.41)(ts-node@10.9.2(@types/node@22.10.5)(typescript@5.8.3)): dependencies: @@ -22142,20 +23687,20 @@ snapshots: postcss: 8.4.41 ts-node: 10.9.2(@types/node@22.10.5)(typescript@5.8.3) - postcss-load-config@4.0.2(postcss@8.5.4)(ts-node@10.9.2(@types/node@22.10.5)(typescript@5.8.3)): + postcss-load-config@4.0.2(postcss@8.4.41)(ts-node@10.9.2(@types/node@22.10.5)(typescript@5.8.3)): dependencies: lilconfig: 3.1.3 yaml: 2.8.0 optionalDependencies: - postcss: 8.5.4 + postcss: 8.4.41 ts-node: 10.9.2(@types/node@22.10.5)(typescript@5.8.3) - postcss-load-config@6.0.1(jiti@2.4.2)(postcss@8.5.4)(yaml@2.8.0): + postcss-load-config@6.0.1(jiti@2.4.2)(postcss@8.5.3)(yaml@2.8.0): dependencies: lilconfig: 3.1.3 optionalDependencies: jiti: 2.4.2 - postcss: 8.5.4 + postcss: 8.5.3 yaml: 2.8.0 postcss-loader@8.1.1(postcss@8.5.2)(typescript@5.8.3)(webpack@5.98.0(esbuild@0.25.0)): @@ -22165,50 +23710,50 @@ snapshots: postcss: 8.5.2 semver: 7.7.2 optionalDependencies: - webpack: 5.98.0(esbuild@0.25.2) + webpack: 5.98.0(esbuild@0.25.4) transitivePeerDependencies: - typescript postcss-media-query-parser@0.2.3: {} - postcss-merge-longhand@7.0.4(postcss@8.5.4): + postcss-merge-longhand@7.0.5(postcss@8.5.3): dependencies: - postcss: 8.5.4 + postcss: 8.5.3 postcss-value-parser: 4.2.0 - stylehacks: 7.0.4(postcss@8.5.4) + stylehacks: 7.0.5(postcss@8.5.3) - postcss-merge-rules@7.0.4(postcss@8.5.4): + postcss-merge-rules@7.0.5(postcss@8.5.3): dependencies: - browserslist: 4.24.4 + browserslist: 4.24.5 caniuse-api: 3.0.0 - cssnano-utils: 5.0.0(postcss@8.5.4) - postcss: 8.5.4 - postcss-selector-parser: 6.1.2 + cssnano-utils: 5.0.1(postcss@8.5.3) + postcss: 8.5.3 + postcss-selector-parser: 7.1.0 - postcss-minify-font-values@7.0.0(postcss@8.5.4): + postcss-minify-font-values@7.0.1(postcss@8.5.3): dependencies: - postcss: 8.5.4 + postcss: 8.5.3 postcss-value-parser: 4.2.0 - postcss-minify-gradients@7.0.0(postcss@8.5.4): + postcss-minify-gradients@7.0.1(postcss@8.5.3): dependencies: colord: 2.9.3 - cssnano-utils: 5.0.0(postcss@8.5.4) - postcss: 8.5.4 + cssnano-utils: 5.0.1(postcss@8.5.3) + postcss: 8.5.3 postcss-value-parser: 4.2.0 - postcss-minify-params@7.0.2(postcss@8.5.4): + postcss-minify-params@7.0.3(postcss@8.5.3): dependencies: - browserslist: 4.24.4 - cssnano-utils: 5.0.0(postcss@8.5.4) - postcss: 8.5.4 + browserslist: 4.24.5 + cssnano-utils: 5.0.1(postcss@8.5.3) + postcss: 8.5.3 postcss-value-parser: 4.2.0 - postcss-minify-selectors@7.0.4(postcss@8.5.4): + postcss-minify-selectors@7.0.5(postcss@8.5.3): dependencies: cssesc: 3.0.0 - postcss: 8.5.4 - postcss-selector-parser: 6.1.2 + postcss: 8.5.3 + postcss-selector-parser: 7.1.0 postcss-modules-extract-imports@3.1.0(postcss@8.4.41): dependencies: @@ -22231,71 +23776,76 @@ snapshots: icss-utils: 5.1.0(postcss@8.4.41) postcss: 8.4.41 - postcss-nested@6.2.0(postcss@8.5.4): + postcss-nested@6.2.0(postcss@8.4.41): + dependencies: + postcss: 8.4.41 + postcss-selector-parser: 6.1.2 + + postcss-nested@6.2.0(postcss@8.5.3): dependencies: - postcss: 8.5.4 + postcss: 8.5.3 postcss-selector-parser: 6.1.2 - postcss-normalize-charset@7.0.0(postcss@8.5.4): + postcss-normalize-charset@7.0.1(postcss@8.5.3): dependencies: - postcss: 8.5.4 + postcss: 8.5.3 - postcss-normalize-display-values@7.0.0(postcss@8.5.4): + postcss-normalize-display-values@7.0.1(postcss@8.5.3): dependencies: - postcss: 8.5.4 + postcss: 8.5.3 postcss-value-parser: 4.2.0 - postcss-normalize-positions@7.0.0(postcss@8.5.4): + postcss-normalize-positions@7.0.1(postcss@8.5.3): dependencies: - postcss: 8.5.4 + postcss: 8.5.3 postcss-value-parser: 4.2.0 - postcss-normalize-repeat-style@7.0.0(postcss@8.5.4): + postcss-normalize-repeat-style@7.0.1(postcss@8.5.3): dependencies: - postcss: 8.5.4 + postcss: 8.5.3 postcss-value-parser: 4.2.0 - postcss-normalize-string@7.0.0(postcss@8.5.4): + postcss-normalize-string@7.0.1(postcss@8.5.3): dependencies: - postcss: 8.5.4 + postcss: 8.5.3 postcss-value-parser: 4.2.0 - postcss-normalize-timing-functions@7.0.0(postcss@8.5.4): + postcss-normalize-timing-functions@7.0.1(postcss@8.5.3): dependencies: - postcss: 8.5.4 + postcss: 8.5.3 postcss-value-parser: 4.2.0 - postcss-normalize-unicode@7.0.2(postcss@8.5.4): + postcss-normalize-unicode@7.0.3(postcss@8.5.3): dependencies: - browserslist: 4.24.4 - postcss: 8.5.4 + browserslist: 4.24.5 + postcss: 8.5.3 postcss-value-parser: 4.2.0 - postcss-normalize-url@7.0.0(postcss@8.5.4): + postcss-normalize-url@7.0.1(postcss@8.5.3): dependencies: - postcss: 8.5.4 + postcss: 8.5.3 postcss-value-parser: 4.2.0 - postcss-normalize-whitespace@7.0.0(postcss@8.5.4): + postcss-normalize-whitespace@7.0.1(postcss@8.5.3): dependencies: - postcss: 8.5.4 + postcss: 8.5.3 postcss-value-parser: 4.2.0 - postcss-ordered-values@7.0.1(postcss@8.5.4): + postcss-ordered-values@7.0.2(postcss@8.5.3): dependencies: - cssnano-utils: 5.0.0(postcss@8.5.4) - postcss: 8.5.4 + cssnano-utils: 5.0.1(postcss@8.5.3) + postcss: 8.5.3 postcss-value-parser: 4.2.0 - postcss-reduce-initial@7.0.2(postcss@8.5.4): + postcss-reduce-initial@7.0.3(postcss@8.5.3): dependencies: - browserslist: 4.24.4 + browserslist: 4.24.5 caniuse-api: 3.0.0 - postcss: 8.5.4 + postcss: 8.5.3 - postcss-reduce-transforms@7.0.0(postcss@8.5.4): + postcss-reduce-transforms@7.0.1(postcss@8.5.3): dependencies: - postcss: 8.5.4 + postcss: 8.5.3 postcss-value-parser: 4.2.0 postcss-safe-parser@6.0.0(postcss@8.4.41): @@ -22316,19 +23866,26 @@ snapshots: cssesc: 3.0.0 util-deprecate: 1.0.2 - postcss-svgo@7.0.1(postcss@8.5.4): + postcss-svgo@7.0.2(postcss@8.5.3): dependencies: - postcss: 8.5.4 + postcss: 8.5.3 postcss-value-parser: 4.2.0 svgo: 3.3.2 - postcss-unique-selectors@7.0.3(postcss@8.5.4): + postcss-unique-selectors@7.0.4(postcss@8.5.3): dependencies: - postcss: 8.5.4 - postcss-selector-parser: 6.1.2 + postcss: 8.5.3 + postcss-selector-parser: 7.1.0 postcss-value-parser@4.2.0: {} + postcss-values-parser@6.0.2(postcss@8.4.41): + dependencies: + color-name: 1.1.4 + is-url-superb: 4.0.0 + postcss: 8.4.41 + quote-unquote: 1.0.0 + postcss@8.4.31: dependencies: nanoid: 3.3.11 @@ -22337,23 +23894,40 @@ snapshots: postcss@8.4.41: dependencies: - nanoid: 3.3.9 + nanoid: 3.3.11 picocolors: 1.1.1 source-map-js: 1.2.1 postcss@8.5.2: dependencies: - nanoid: 3.3.9 + nanoid: 3.3.11 picocolors: 1.1.1 source-map-js: 1.2.1 - postcss@8.5.4: + postcss@8.5.3: dependencies: nanoid: 3.3.11 picocolors: 1.1.1 source-map-js: 1.2.1 - preact@10.26.4: {} + preact@10.26.6: {} + + precinct@11.0.5: + dependencies: + '@dependents/detective-less': 4.1.0 + commander: 10.0.1 + detective-amd: 5.0.2 + detective-cjs: 5.0.1 + detective-es6: 4.0.1 + detective-postcss: 6.1.3 + detective-sass: 5.0.3 + detective-scss: 4.0.3 + detective-stylus: 4.0.0 + detective-typescript: 11.2.0 + module-definition: 5.0.1 + node-source-walk: 6.0.2 + transitivePeerDependencies: + - supports-color prelude-ls@1.2.1: {} @@ -22372,6 +23946,12 @@ snapshots: pretty-bytes@6.1.1: {} + pretty-format@29.7.0: + dependencies: + '@jest/schemas': 29.6.3 + ansi-styles: 5.2.0 + react-is: 18.3.1 + pretty-ms@9.2.0: dependencies: parse-ms: 4.0.0 @@ -22402,7 +23982,7 @@ snapshots: object-assign: 4.1.1 react-is: 16.13.1 - property-information@7.0.0: {} + property-information@7.1.0: {} proto-list@1.2.4: {} @@ -22416,9 +23996,9 @@ snapshots: proxy-agent@6.4.0: dependencies: agent-base: 7.1.3 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.6(supports-color@9.4.0) + https-proxy-agent: 7.0.6 lru-cache: 7.18.3 pac-proxy-agent: 7.2.0 proxy-from-env: 1.1.0 @@ -22437,9 +24017,9 @@ snapshots: dependencies: punycode: 2.3.1 - pump@3.0.3: + pump@3.0.2: dependencies: - end-of-stream: 1.4.5 + end-of-stream: 1.4.4 once: 1.4.0 punycode@1.4.1: {} @@ -22450,9 +24030,9 @@ snapshots: dependencies: '@puppeteer/browsers': 2.2.3 chromium-bidi: 0.5.24(devtools-protocol@0.0.1299070) - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 devtools-protocol: 0.0.1299070 - ws: 8.18.1 + ws: 8.18.2 transitivePeerDependencies: - bare-buffer - bufferutil @@ -22478,7 +24058,11 @@ snapshots: dependencies: side-channel: 1.1.0 - quansync@0.2.8: {} + qs@6.14.0: + dependencies: + side-channel: 1.1.0 + + quansync@0.2.10: {} querystringify@2.2.0: {} @@ -22486,6 +24070,8 @@ snapshots: quick-format-unescaped@4.0.4: {} + quote-unquote@1.0.0: {} + radix3@1.1.2: {} randombytes@2.1.0: @@ -22504,7 +24090,14 @@ snapshots: rc9@2.1.2: dependencies: defu: 6.1.4 - destr: 2.0.3 + destr: 2.0.5 + + rc@1.2.8: + dependencies: + deep-extend: 0.6.0 + ini: 1.3.8 + minimist: 1.2.8 + strip-json-comments: 2.0.1 react-dom@19.0.0(react@19.0.0): dependencies: @@ -22513,6 +24106,8 @@ snapshots: react-is@16.13.1: {} + react-is@18.3.1: {} + react-refresh@0.14.2: {} react-remove-scroll-bar@2.3.8(@types/react@19.0.1)(react@19.0.0): @@ -22553,6 +24148,20 @@ snapshots: json-parse-even-better-errors: 3.0.2 npm-normalize-package-bin: 3.0.1 + read-package-up@11.0.0: + dependencies: + find-up-simple: 1.0.1 + read-pkg: 9.0.1 + type-fest: 4.41.0 + + read-pkg@9.0.1: + dependencies: + '@types/normalize-package-data': 2.4.4 + normalize-package-data: 6.0.2 + parse-json: 8.3.0 + type-fest: 4.41.0 + unicorn-magic: 0.1.0 + read-yaml-file@1.1.0: dependencies: graceful-fs: 4.2.11 @@ -22623,10 +24232,6 @@ snapshots: regenerator-runtime@0.14.1: {} - regenerator-transform@0.15.2: - dependencies: - '@babel/runtime': 7.26.10 - regex-parser@2.3.1: {} regex-recursion@5.1.1: @@ -22660,6 +24265,14 @@ snapshots: unicode-match-property-ecmascript: 2.0.0 unicode-match-property-value-ecmascript: 2.2.0 + registry-auth-token@5.1.0: + dependencies: + '@pnpm/npm-conf': 2.3.1 + + registry-url@6.0.1: + dependencies: + rc: 1.2.8 + regjsgen@0.8.0: {} regjsparser@0.12.0: @@ -22668,10 +24281,14 @@ snapshots: remove-accents@0.5.0: {} + remove-trailing-separator@1.1.0: {} + require-directory@2.1.1: {} require-from-string@2.0.2: {} + require-package-name@2.0.1: {} + requireindex@1.2.0: {} requires-port@1.0.0: {} @@ -22690,6 +24307,8 @@ snapshots: postcss: 8.4.41 source-map: 0.6.1 + resolve.exports@2.0.3: {} + resolve@1.22.10: dependencies: is-core-module: 2.16.1 @@ -22726,17 +24345,13 @@ snapshots: dependencies: glob: 7.2.3 - rimraf@5.0.10: - dependencies: - glob: 10.4.3 - rollup-plugin-dts@6.1.1(rollup@3.29.5)(typescript@5.8.3): dependencies: magic-string: 0.30.17 rollup: 3.29.5 typescript: 5.8.3 optionalDependencies: - '@babel/code-frame': 7.26.2 + '@babel/code-frame': 7.27.1 rollup-plugin-dts@6.1.1(rollup@4.31.0)(typescript@5.8.3): dependencies: @@ -22744,7 +24359,7 @@ snapshots: rollup: 4.31.0 typescript: 5.8.3 optionalDependencies: - '@babel/code-frame': 7.26.2 + '@babel/code-frame': 7.27.1 rollup-plugin-visualizer@5.14.0(rollup@3.29.5): dependencies: @@ -22755,14 +24370,14 @@ snapshots: optionalDependencies: rollup: 3.29.5 - rollup-plugin-visualizer@5.14.0(rollup@4.41.1): + rollup-plugin-visualizer@5.14.0(rollup@4.40.2): dependencies: open: 8.4.2 picomatch: 4.0.2 source-map: 0.7.4 yargs: 17.7.2 optionalDependencies: - rollup: 4.41.1 + rollup: 4.40.2 rollup@3.29.5: optionalDependencies: @@ -22818,56 +24433,30 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.34.8 fsevents: 2.3.3 - rollup@4.39.0: - dependencies: - '@types/estree': 1.0.7 - optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.39.0 - '@rollup/rollup-android-arm64': 4.39.0 - '@rollup/rollup-darwin-arm64': 4.39.0 - '@rollup/rollup-darwin-x64': 4.39.0 - '@rollup/rollup-freebsd-arm64': 4.39.0 - '@rollup/rollup-freebsd-x64': 4.39.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.39.0 - '@rollup/rollup-linux-arm-musleabihf': 4.39.0 - '@rollup/rollup-linux-arm64-gnu': 4.39.0 - '@rollup/rollup-linux-arm64-musl': 4.39.0 - '@rollup/rollup-linux-loongarch64-gnu': 4.39.0 - '@rollup/rollup-linux-powerpc64le-gnu': 4.39.0 - '@rollup/rollup-linux-riscv64-gnu': 4.39.0 - '@rollup/rollup-linux-riscv64-musl': 4.39.0 - '@rollup/rollup-linux-s390x-gnu': 4.39.0 - '@rollup/rollup-linux-x64-gnu': 4.39.0 - '@rollup/rollup-linux-x64-musl': 4.39.0 - '@rollup/rollup-win32-arm64-msvc': 4.39.0 - '@rollup/rollup-win32-ia32-msvc': 4.39.0 - '@rollup/rollup-win32-x64-msvc': 4.39.0 - fsevents: 2.3.3 - - rollup@4.41.1: + rollup@4.40.2: dependencies: '@types/estree': 1.0.7 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.41.1 - '@rollup/rollup-android-arm64': 4.41.1 - '@rollup/rollup-darwin-arm64': 4.41.1 - '@rollup/rollup-darwin-x64': 4.41.1 - '@rollup/rollup-freebsd-arm64': 4.41.1 - '@rollup/rollup-freebsd-x64': 4.41.1 - '@rollup/rollup-linux-arm-gnueabihf': 4.41.1 - '@rollup/rollup-linux-arm-musleabihf': 4.41.1 - '@rollup/rollup-linux-arm64-gnu': 4.41.1 - '@rollup/rollup-linux-arm64-musl': 4.41.1 - '@rollup/rollup-linux-loongarch64-gnu': 4.41.1 - '@rollup/rollup-linux-powerpc64le-gnu': 4.41.1 - '@rollup/rollup-linux-riscv64-gnu': 4.41.1 - '@rollup/rollup-linux-riscv64-musl': 4.41.1 - '@rollup/rollup-linux-s390x-gnu': 4.41.1 - '@rollup/rollup-linux-x64-gnu': 4.41.1 - '@rollup/rollup-linux-x64-musl': 4.41.1 - '@rollup/rollup-win32-arm64-msvc': 4.41.1 - '@rollup/rollup-win32-ia32-msvc': 4.41.1 - '@rollup/rollup-win32-x64-msvc': 4.41.1 + '@rollup/rollup-android-arm-eabi': 4.40.2 + '@rollup/rollup-android-arm64': 4.40.2 + '@rollup/rollup-darwin-arm64': 4.40.2 + '@rollup/rollup-darwin-x64': 4.40.2 + '@rollup/rollup-freebsd-arm64': 4.40.2 + '@rollup/rollup-freebsd-x64': 4.40.2 + '@rollup/rollup-linux-arm-gnueabihf': 4.40.2 + '@rollup/rollup-linux-arm-musleabihf': 4.40.2 + '@rollup/rollup-linux-arm64-gnu': 4.40.2 + '@rollup/rollup-linux-arm64-musl': 4.40.2 + '@rollup/rollup-linux-loongarch64-gnu': 4.40.2 + '@rollup/rollup-linux-powerpc64le-gnu': 4.40.2 + '@rollup/rollup-linux-riscv64-gnu': 4.40.2 + '@rollup/rollup-linux-riscv64-musl': 4.40.2 + '@rollup/rollup-linux-s390x-gnu': 4.40.2 + '@rollup/rollup-linux-x64-gnu': 4.40.2 + '@rollup/rollup-linux-x64-musl': 4.40.2 + '@rollup/rollup-win32-arm64-msvc': 4.40.2 + '@rollup/rollup-win32-ia32-msvc': 4.40.2 + '@rollup/rollup-win32-x64-msvc': 4.40.2 fsevents: 2.3.3 rrweb-cssom@0.6.0: {} @@ -22922,12 +24511,12 @@ snapshots: neo-async: 2.6.2 optionalDependencies: sass: 1.85.0 - webpack: 5.98.0(esbuild@0.25.2) + webpack: 5.98.0(esbuild@0.25.4) sass@1.85.0: dependencies: chokidar: 4.0.3 - immutable: 5.0.3 + immutable: 5.1.2 source-map-js: 1.2.1 optionalDependencies: '@parcel/watcher': 2.5.1 @@ -22941,7 +24530,7 @@ snapshots: scheduler@0.25.0: {} - schema-utils@4.3.0: + schema-utils@4.3.2: dependencies: '@types/json-schema': 7.0.15 ajv: 8.17.1 @@ -22992,15 +24581,31 @@ snapshots: transitivePeerDependencies: - supports-color + send@1.2.0: + dependencies: + debug: 4.4.1 + encodeurl: 2.0.0 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 2.0.0 + http-errors: 2.0.0 + mime-types: 3.0.1 + ms: 2.1.3 + on-finished: 2.4.1 + range-parser: 1.2.1 + statuses: 2.0.1 + transitivePeerDependencies: + - supports-color + serialize-javascript@6.0.2: dependencies: randombytes: 2.1.0 - seroval-plugins@1.3.2(seroval@1.3.2): + seroval-plugins@1.3.1(seroval@1.3.1): dependencies: - seroval: 1.3.2 + seroval: 1.3.1 - seroval@1.3.2: {} + seroval@1.3.1: {} serve-index@1.9.1: dependencies: @@ -23027,6 +24632,17 @@ snapshots: transitivePeerDependencies: - supports-color + serve-static@2.2.0: + dependencies: + encodeurl: 2.0.0 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 1.2.0 + transitivePeerDependencies: + - supports-color + + set-blocking@2.0.0: {} + set-cookie-parser@2.7.1: {} set-function-length@1.2.2: @@ -23062,8 +24678,8 @@ snapshots: sharp@0.33.5: dependencies: color: 4.2.3 - detect-libc: 2.0.3 - semver: 7.7.1 + detect-libc: 2.0.4 + semver: 7.7.2 optionalDependencies: '@img/sharp-darwin-arm64': 0.33.5 '@img/sharp-darwin-x64': 0.33.5 @@ -23148,10 +24764,10 @@ snapshots: dependencies: '@sigstore/bundle': 3.1.0 '@sigstore/core': 2.0.0 - '@sigstore/protobuf-specs': 0.4.0 + '@sigstore/protobuf-specs': 0.4.1 '@sigstore/sign': 3.1.0 - '@sigstore/tuf': 3.1.0 - '@sigstore/verify': 2.1.0 + '@sigstore/tuf': 3.1.1 + '@sigstore/verify': 2.1.1 transitivePeerDependencies: - supports-color @@ -23159,7 +24775,7 @@ snapshots: dependencies: '@kwsites/file-exists': 1.1.1 '@kwsites/promise-deferred': 1.1.1 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 transitivePeerDependencies: - supports-color @@ -23169,7 +24785,7 @@ snapshots: sirv@3.0.1: dependencies: - '@polka/url': 1.0.0-next.28 + '@polka/url': 1.0.0-next.29 mrmime: 2.0.1 totalist: 3.0.1 @@ -23238,7 +24854,7 @@ snapshots: socks-proxy-agent@8.0.5: dependencies: agent-base: 7.1.3 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 socks: 2.8.4 transitivePeerDependencies: - supports-color @@ -23248,11 +24864,11 @@ snapshots: ip-address: 9.0.5 smart-buffer: 4.2.0 - solid-js@1.9.7: + solid-js@1.9.6: dependencies: csstype: 3.1.3 - seroval: 1.3.2 - seroval-plugins: 1.3.2(seroval@1.3.2) + seroval: 1.3.1 + seroval-plugins: 1.3.1(seroval@1.3.1) sonic-boom@4.2.0: dependencies: @@ -23264,7 +24880,7 @@ snapshots: dependencies: iconv-lite: 0.6.3 source-map-js: 1.2.1 - webpack: 5.98.0(esbuild@0.25.2) + webpack: 5.98.0(esbuild@0.25.4) source-map-support@0.5.21: dependencies: @@ -23307,7 +24923,7 @@ snapshots: spdy-transport@3.0.0: dependencies: - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 detect-node: 2.1.0 hpack.js: 2.1.6 obuf: 1.1.2 @@ -23318,7 +24934,7 @@ snapshots: spdy@4.0.2: dependencies: - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 handle-thing: 2.0.1 http-deceiver: 1.2.7 select-hose: 2.0.0 @@ -23338,7 +24954,9 @@ snapshots: dependencies: minipass: 7.1.2 - stable-hash@0.0.4: {} + stable-hash@0.0.5: {} + + stack-trace@0.0.10: {} stackback@0.0.2: {} @@ -23348,12 +24966,12 @@ snapshots: statuses@2.0.1: {} - std-env@3.8.1: {} + std-env@3.9.0: {} streamroller@3.1.5: dependencies: date-format: 4.0.14 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 fs-extra: 8.1.0 transitivePeerDependencies: - supports-color @@ -23464,6 +25082,8 @@ snapshots: strip-final-newline@4.0.0: {} + strip-json-comments@2.0.1: {} + strip-json-comments@3.1.1: {} strip-literal@2.1.1: @@ -23479,11 +25099,11 @@ snapshots: client-only: 0.0.1 react: 19.0.0 - stylehacks@7.0.4(postcss@8.5.4): + stylehacks@7.0.5(postcss@8.5.3): dependencies: - browserslist: 4.24.4 - postcss: 8.5.4 - postcss-selector-parser: 6.1.2 + browserslist: 4.24.5 + postcss: 8.5.3 + postcss-selector-parser: 7.1.0 sucrase@3.35.0: dependencies: @@ -23492,7 +25112,7 @@ snapshots: glob: 10.4.3 lines-and-columns: 1.2.4 mz: 2.7.0 - pirates: 4.0.6 + pirates: 4.0.7 ts-interface-checker: 0.1.13 superjson@2.2.2: @@ -23509,8 +25129,6 @@ snapshots: dependencies: has-flag: 4.0.0 - supports-color@9.4.0: {} - supports-hyperlinks@3.2.0: dependencies: has-flag: 4.0.0 @@ -23522,7 +25140,7 @@ snapshots: dependencies: '@jridgewell/trace-mapping': 0.3.25 chokidar: 4.0.3 - fdir: 6.4.3(picomatch@4.0.2) + fdir: 6.4.4(picomatch@4.0.2) picocolors: 1.1.1 sade: 1.8.1 svelte: 5.19.9 @@ -23551,7 +25169,7 @@ snapshots: axobject-query: 4.1.0 clsx: 2.1.1 esm-env: 1.2.2 - esrap: 1.4.5 + esrap: 1.4.6 is-reference: 3.0.3 locate-character: 3.0.0 magic-string: 0.30.17 @@ -23567,13 +25185,19 @@ snapshots: csso: 5.0.5 picocolors: 1.1.1 + swagger-parser@10.0.3(openapi-types@12.1.3): + dependencies: + '@apidevtools/swagger-parser': 10.0.3(openapi-types@12.1.3) + transitivePeerDependencies: + - openapi-types + symbol-observable@4.0.0: {} symbol-tree@3.2.4: {} - synckit@0.9.2: + synckit@0.11.5: dependencies: - '@pkgr/core': 0.1.1 + '@pkgr/core': 0.2.4 tslib: 2.8.1 system-architecture@0.1.0: {} @@ -23596,11 +25220,11 @@ snapshots: normalize-path: 3.0.0 object-hash: 3.0.0 picocolors: 1.1.1 - postcss: 8.5.4 - postcss-import: 15.1.0(postcss@8.5.4) - postcss-js: 4.0.1(postcss@8.5.4) - postcss-load-config: 4.0.2(postcss@8.5.4)(ts-node@10.9.2(@types/node@22.10.5)(typescript@5.8.3)) - postcss-nested: 6.2.0(postcss@8.5.4) + postcss: 8.4.41 + postcss-import: 15.1.0(postcss@8.4.41) + postcss-js: 4.0.1(postcss@8.4.41) + postcss-load-config: 4.0.2(postcss@8.4.41)(ts-node@10.9.2(@types/node@22.10.5)(typescript@5.8.3)) + postcss-nested: 6.2.0(postcss@8.4.41) postcss-selector-parser: 6.1.2 resolve: 1.22.10 sucrase: 3.35.0 @@ -23611,7 +25235,7 @@ snapshots: tar-fs@3.0.5: dependencies: - pump: 3.0.3 + pump: 3.0.2 tar-stream: 3.1.7 optionalDependencies: bare-fs: 2.3.5 @@ -23619,6 +25243,14 @@ snapshots: transitivePeerDependencies: - bare-buffer + tar-stream@2.2.0: + dependencies: + bl: 4.1.0 + end-of-stream: 1.4.4 + fs-constants: 1.0.0 + inherits: 2.0.4 + readable-stream: 3.6.2 + tar-stream@3.1.7: dependencies: b4a: 1.6.7 @@ -23639,22 +25271,22 @@ snapshots: '@isaacs/fs-minipass': 4.0.1 chownr: 3.0.0 minipass: 7.1.2 - minizlib: 3.0.1 + minizlib: 3.0.2 mkdirp: 3.0.1 yallist: 5.0.0 term-size@2.2.1: {} - terser-webpack-plugin@5.3.14(esbuild@0.25.2)(webpack@5.98.0(esbuild@0.25.0)): + terser-webpack-plugin@5.3.14(esbuild@0.25.4)(webpack@5.98.0(esbuild@0.25.0)): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 - schema-utils: 4.3.0 + schema-utils: 4.3.2 serialize-javascript: 6.0.2 terser: 5.39.0 - webpack: 5.98.0(esbuild@0.25.2) + webpack: 5.98.0(esbuild@0.25.4) optionalDependencies: - esbuild: 0.25.2 + esbuild: 0.25.4 terser@5.39.0: dependencies: @@ -23663,6 +25295,13 @@ snapshots: commander: 2.20.3 source-map-support: 0.5.21 + terser@5.39.1: + dependencies: + '@jridgewell/source-map': 0.3.6 + acorn: 8.14.1 + commander: 2.20.3 + source-map-support: 0.5.21 + test-exclude@7.0.1: dependencies: '@istanbuljs/schema': 0.1.3 @@ -23673,6 +25312,8 @@ snapshots: dependencies: b4a: 1.6.7 + text-hex@1.0.0: {} + thenify-all@1.6.0: dependencies: thenify: 3.3.1 @@ -23701,12 +25342,12 @@ snapshots: tinyglobby@0.2.10: dependencies: - fdir: 6.4.3(picomatch@4.0.2) + fdir: 6.4.4(picomatch@4.0.2) picomatch: 4.0.2 - tinyglobby@0.2.12: + tinyglobby@0.2.13: dependencies: - fdir: 6.4.3(picomatch@4.0.2) + fdir: 6.4.4(picomatch@4.0.2) picomatch: 4.0.2 tinypool@1.0.2: {} @@ -23715,6 +25356,10 @@ snapshots: tinyspy@3.0.2: {} + tmp-promise@3.0.3: + dependencies: + tmp: 0.2.3 + tmp@0.0.33: dependencies: os-tmpdir: 1.0.2 @@ -23729,6 +25374,8 @@ snapshots: toidentifier@1.0.1: {} + toml@3.0.0: {} + totalist@3.0.1: {} tough-cookie@4.1.4: @@ -23744,7 +25391,7 @@ snapshots: dependencies: punycode: 2.3.1 - tr46@5.0.0: + tr46@5.1.1: dependencies: punycode: 2.3.1 @@ -23756,7 +25403,9 @@ snapshots: trim-lines@3.0.1: {} - ts-api-utils@2.0.1(typescript@5.8.3): + triple-beam@1.4.1: {} + + ts-api-utils@2.1.0(typescript@5.8.3): dependencies: typescript: 5.8.3 @@ -23791,30 +25440,36 @@ snapshots: minimist: 1.2.8 strip-bom: 3.0.0 + tsconfig-paths@4.2.0: + dependencies: + json5: 2.2.3 + minimist: 1.2.8 + strip-bom: 3.0.0 + tslib@1.14.1: {} tslib@2.8.1: {} - tsup@8.4.0(jiti@2.4.2)(postcss@8.5.4)(typescript@5.8.3)(yaml@2.8.0): + tsup@8.4.0(jiti@2.4.2)(postcss@8.5.3)(typescript@5.8.3)(yaml@2.8.0): dependencies: - bundle-require: 5.1.0(esbuild@0.25.2) + bundle-require: 5.1.0(esbuild@0.25.4) cac: 6.7.14 chokidar: 4.0.3 - consola: 3.4.0 - debug: 4.4.0(supports-color@9.4.0) - esbuild: 0.25.2 + consola: 3.4.2 + debug: 4.4.1 + esbuild: 0.25.4 joycon: 3.1.1 picocolors: 1.1.1 - postcss-load-config: 6.0.1(jiti@2.4.2)(postcss@8.5.4)(yaml@2.8.0) + postcss-load-config: 6.0.1(jiti@2.4.2)(postcss@8.5.3)(yaml@2.8.0) resolve-from: 5.0.0 - rollup: 4.39.0 + rollup: 4.40.2 source-map: 0.8.0-beta.0 sucrase: 3.35.0 tinyexec: 0.3.2 - tinyglobby: 0.2.12 + tinyglobby: 0.2.13 tree-kill: 1.2.2 optionalDependencies: - postcss: 8.5.4 + postcss: 8.5.3 typescript: 5.8.3 transitivePeerDependencies: - jiti @@ -23830,7 +25485,7 @@ snapshots: tuf-js@3.0.1: dependencies: '@tufjs/models': 3.0.1 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 make-fetch-happen: 14.0.3 transitivePeerDependencies: - supports-color @@ -23870,7 +25525,7 @@ snapshots: type-fest@0.21.3: {} - type-fest@4.37.0: {} + type-fest@4.41.0: {} type-is@1.6.18: dependencies: @@ -23930,12 +25585,12 @@ snapshots: ua-parser-js@0.7.40: {} - ufo@1.5.4: {} + ufo@1.6.1: {} uglify-js@3.19.3: optional: true - ultrahtml@1.5.3: {} + ultrahtml@1.6.0: {} unbox-primitive@1.1.0: dependencies: @@ -23986,10 +25641,10 @@ snapshots: unctx@2.4.1: dependencies: - acorn: 8.14.1 + acorn: 8.14.0 estree-walker: 3.0.3 magic-string: 0.30.17 - unplugin: 2.3.2 + unplugin: 2.3.4 undici-types@6.20.0: {} @@ -24001,13 +25656,13 @@ snapshots: node-fetch-native: 1.6.6 pathe: 1.1.2 - unenv@2.0.0-rc.14: + unenv@2.0.0-rc.17: dependencies: defu: 6.1.4 - exsolve: 1.0.4 + exsolve: 1.0.5 ohash: 2.0.11 pathe: 2.0.3 - ufo: 1.5.4 + ufo: 1.6.1 unhead@1.11.20: dependencies: @@ -24029,6 +25684,8 @@ snapshots: unicode-property-aliases-ecmascript@2.1.0: {} + unicorn-magic@0.1.0: {} + unicorn-magic@0.3.0: {} unimport@3.14.6(rollup@3.29.5): @@ -24050,9 +25707,9 @@ snapshots: transitivePeerDependencies: - rollup - unimport@3.14.6(rollup@4.41.1): + unimport@3.14.6(rollup@4.40.2): dependencies: - '@rollup/pluginutils': 5.1.4(rollup@4.41.1) + '@rollup/pluginutils': 5.1.4(rollup@4.40.2) acorn: 8.14.1 escape-string-regexp: 5.0.0 estree-walker: 3.0.3 @@ -24069,7 +25726,7 @@ snapshots: transitivePeerDependencies: - rollup - unimport@4.1.2: + unimport@4.2.0: dependencies: acorn: 8.14.1 escape-string-regexp: 5.0.0 @@ -24079,14 +25736,14 @@ snapshots: mlly: 1.7.4 pathe: 2.0.3 picomatch: 4.0.2 - pkg-types: 1.3.1 + pkg-types: 2.1.0 scule: 1.3.0 strip-literal: 3.0.0 - tinyglobby: 0.2.12 - unplugin: 2.3.2 + tinyglobby: 0.2.13 + unplugin: 2.3.4 unplugin-utils: 0.2.4 - unimport@4.2.0: + unimport@5.0.1: dependencies: acorn: 8.14.1 escape-string-regexp: 5.0.0 @@ -24099,8 +25756,8 @@ snapshots: pkg-types: 2.1.0 scule: 1.3.0 strip-literal: 3.0.0 - tinyglobby: 0.2.12 - unplugin: 2.3.2 + tinyglobby: 0.2.13 + unplugin: 2.3.4 unplugin-utils: 0.2.4 unique-filename@4.0.0: @@ -24140,6 +25797,10 @@ snapshots: universalify@2.0.1: {} + unixify@1.0.0: + dependencies: + normalize-path: 2.1.1 + unpipe@1.0.0: {} unplugin-utils@0.2.4: @@ -24149,7 +25810,7 @@ snapshots: unplugin-vue-router@0.10.9(rollup@3.29.5)(vue-router@4.5.0(vue@3.5.13(typescript@5.8.3)))(vue@3.5.13(typescript@5.8.3)): dependencies: - '@babel/types': 7.26.10 + '@babel/types': 7.27.1 '@rollup/pluginutils': 5.1.4(rollup@3.29.5) '@vue-macros/common': 1.16.1(vue@3.5.13(typescript@5.8.3)) ast-walker-scope: 0.6.2 @@ -24169,10 +25830,10 @@ snapshots: - rollup - vue - unplugin-vue-router@0.10.9(rollup@4.41.1)(vue-router@4.5.0(vue@3.5.13(typescript@5.8.3)))(vue@3.5.13(typescript@5.8.3)): + unplugin-vue-router@0.10.9(rollup@4.40.2)(vue-router@4.5.0(vue@3.5.13(typescript@5.8.3)))(vue@3.5.13(typescript@5.8.3)): dependencies: - '@babel/types': 7.26.10 - '@rollup/pluginutils': 5.1.4(rollup@4.41.1) + '@babel/types': 7.27.1 + '@rollup/pluginutils': 5.1.4(rollup@4.40.2) '@vue-macros/common': 1.16.1(vue@3.5.13(typescript@5.8.3)) ast-walker-scope: 0.6.2 chokidar: 3.6.0 @@ -24193,7 +25854,7 @@ snapshots: unplugin@1.16.1: dependencies: - acorn: 8.14.1 + acorn: 8.14.0 webpack-virtual-modules: 0.6.2 unplugin@2.0.0-beta.1: @@ -24201,30 +25862,47 @@ snapshots: acorn: 8.14.1 webpack-virtual-modules: 0.6.2 - unplugin@2.2.0: - dependencies: - acorn: 8.14.1 - webpack-virtual-modules: 0.6.2 - - unplugin@2.3.2: + unplugin@2.3.4: dependencies: acorn: 8.14.1 picomatch: 4.0.2 webpack-virtual-modules: 0.6.2 - unstorage@1.15.0(db0@0.3.1)(ioredis@5.6.0): + unrs-resolver@1.7.2: + dependencies: + napi-postinstall: 0.2.4 + optionalDependencies: + '@unrs/resolver-binding-darwin-arm64': 1.7.2 + '@unrs/resolver-binding-darwin-x64': 1.7.2 + '@unrs/resolver-binding-freebsd-x64': 1.7.2 + '@unrs/resolver-binding-linux-arm-gnueabihf': 1.7.2 + '@unrs/resolver-binding-linux-arm-musleabihf': 1.7.2 + '@unrs/resolver-binding-linux-arm64-gnu': 1.7.2 + '@unrs/resolver-binding-linux-arm64-musl': 1.7.2 + '@unrs/resolver-binding-linux-ppc64-gnu': 1.7.2 + '@unrs/resolver-binding-linux-riscv64-gnu': 1.7.2 + '@unrs/resolver-binding-linux-riscv64-musl': 1.7.2 + '@unrs/resolver-binding-linux-s390x-gnu': 1.7.2 + '@unrs/resolver-binding-linux-x64-gnu': 1.7.2 + '@unrs/resolver-binding-linux-x64-musl': 1.7.2 + '@unrs/resolver-binding-wasm32-wasi': 1.7.2 + '@unrs/resolver-binding-win32-arm64-msvc': 1.7.2 + '@unrs/resolver-binding-win32-ia32-msvc': 1.7.2 + '@unrs/resolver-binding-win32-x64-msvc': 1.7.2 + + unstorage@1.16.0(db0@0.3.2)(ioredis@5.6.1): dependencies: anymatch: 3.1.3 chokidar: 4.0.3 - destr: 2.0.3 - h3: 1.15.1 + destr: 2.0.5 + h3: 1.15.3 lru-cache: 10.4.3 node-fetch-native: 1.6.6 ofetch: 1.4.1 - ufo: 1.5.4 + ufo: 1.6.1 optionalDependencies: - db0: 0.3.1 - ioredis: 5.6.0 + db0: 0.3.2 + ioredis: 5.6.1 untun@0.1.3: dependencies: @@ -24234,9 +25912,9 @@ snapshots: untyped@1.5.2: dependencies: - '@babel/core': 7.26.10 - '@babel/standalone': 7.26.10 - '@babel/types': 7.26.10 + '@babel/core': 7.27.1 + '@babel/standalone': 7.27.2 + '@babel/types': 7.27.1 citty: 0.1.6 defu: 6.1.4 jiti: 2.4.2 @@ -24262,16 +25940,14 @@ snapshots: pkg-types: 1.3.1 unplugin: 1.16.1 - update-browserslist-db@1.1.3(browserslist@4.24.4): + update-browserslist-db@1.1.3(browserslist@4.24.5): dependencies: - browserslist: 4.24.4 + browserslist: 4.24.5 escalade: 3.2.0 picocolors: 1.1.1 uqr@0.1.2: {} - uri-js-replace@1.0.1: {} - uri-js@4.4.1: dependencies: punycode: 2.3.1 @@ -24283,6 +25959,8 @@ snapshots: urlpattern-polyfill@10.0.0: {} + urlpattern-polyfill@10.1.0: {} + urlpattern-polyfill@8.0.2: {} use-callback-ref@1.3.3(@types/react@19.0.1)(react@19.0.0): @@ -24300,10 +25978,16 @@ snapshots: optionalDependencies: '@types/react': 19.0.1 + use-sync-external-store@1.5.0(react@19.0.0): + dependencies: + react: 19.0.0 + util-deprecate@1.0.2: {} utils-merge@1.0.1: {} + uuid@11.1.0: {} + uuid@8.3.2: {} v8-compile-cache-lib@3.0.1: {} @@ -24321,8 +26005,16 @@ snapshots: validate-npm-package-name@6.0.0: {} + validator@13.15.15: {} + vary@1.1.2: {} + verror@1.10.1: + dependencies: + assert-plus: 1.0.0 + core-util-is: 1.0.2 + extsprintf: 1.4.1 + vfile-message@4.0.2: dependencies: '@types/unist': 3.0.3 @@ -24333,17 +26025,25 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.2 - vite-hot-client@0.2.4(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)): + vite-hot-client@0.2.4(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)): + dependencies: + vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1) + + vite-hot-client@0.2.4(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)): + dependencies: + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) + + vite-hot-client@2.0.4(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)): dependencies: - vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) - vite-node@2.1.9(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0): + vite-node@2.1.9(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1): dependencies: cac: 6.7.14 - debug: 4.4.0(supports-color@9.4.0) - es-module-lexer: 1.6.0 + debug: 4.4.1 + es-module-lexer: 1.7.0 pathe: 1.1.2 - vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0) + vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1) transitivePeerDependencies: - '@types/node' - less @@ -24355,13 +26055,13 @@ snapshots: - supports-color - terser - vite-node@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0): + vite-node@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0): dependencies: cac: 6.7.14 - debug: 4.4.0(supports-color@9.4.0) - es-module-lexer: 1.6.0 + debug: 4.4.1 + es-module-lexer: 1.7.0 pathe: 2.0.3 - vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) transitivePeerDependencies: - '@types/node' - jiti @@ -24376,9 +26076,9 @@ snapshots: - tsx - yaml - vite-plugin-checker@0.8.0(eslint@9.17.0(jiti@2.4.2))(optionator@0.9.4)(typescript@5.8.3)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)): + vite-plugin-checker@0.8.0(eslint@9.17.0(jiti@2.4.2))(optionator@0.9.4)(typescript@5.8.3)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)): dependencies: - '@babel/code-frame': 7.26.2 + '@babel/code-frame': 7.27.1 ansi-escapes: 4.3.2 chalk: 4.1.2 chokidar: 3.6.0 @@ -24388,7 +26088,7 @@ snapshots: npm-run-path: 4.0.1 strip-ansi: 6.0.1 tiny-invariant: 1.3.3 - vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0) + vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1) vscode-languageclient: 7.0.0 vscode-languageserver: 7.0.0 vscode-languageserver-textdocument: 1.0.12 @@ -24398,101 +26098,122 @@ snapshots: optionator: 0.9.4 typescript: 5.8.3 - vite-plugin-inspect@0.8.9(@nuxt/kit@3.15.4(magicast@0.3.5))(rollup@3.29.5)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)): + vite-plugin-inspect@0.8.9(@nuxt/kit@3.15.4(magicast@0.3.5))(rollup@3.29.5)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)): dependencies: '@antfu/utils': 0.7.10 '@rollup/pluginutils': 5.1.4(rollup@3.29.5) - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 error-stack-parser-es: 0.1.5 fs-extra: 11.3.0 - open: 10.1.0 + open: 10.1.2 perfect-debounce: 1.0.0 picocolors: 1.1.1 sirv: 3.0.1 - vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) optionalDependencies: '@nuxt/kit': 3.15.4(magicast@0.3.5) transitivePeerDependencies: - rollup - supports-color - vite-plugin-inspect@0.8.9(@nuxt/kit@3.15.4(magicast@0.3.5))(rollup@4.41.1)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)): + vite-plugin-inspect@0.8.9(@nuxt/kit@3.15.4(magicast@0.3.5))(rollup@4.40.2)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)): dependencies: '@antfu/utils': 0.7.10 - '@rollup/pluginutils': 5.1.4(rollup@4.41.1) - debug: 4.4.0(supports-color@9.4.0) + '@rollup/pluginutils': 5.1.4(rollup@4.40.2) + debug: 4.4.1 error-stack-parser-es: 0.1.5 fs-extra: 11.3.0 - open: 10.1.0 + open: 10.1.2 + perfect-debounce: 1.0.0 + picocolors: 1.1.1 + sirv: 3.0.1 + vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1) + optionalDependencies: + '@nuxt/kit': 3.15.4(magicast@0.3.5) + transitivePeerDependencies: + - rollup + - supports-color + + vite-plugin-inspect@0.8.9(@nuxt/kit@3.15.4(magicast@0.3.5))(rollup@4.40.2)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)): + dependencies: + '@antfu/utils': 0.7.10 + '@rollup/pluginutils': 5.1.4(rollup@4.40.2) + debug: 4.4.1 + error-stack-parser-es: 0.1.5 + fs-extra: 11.3.0 + open: 10.1.2 perfect-debounce: 1.0.0 picocolors: 1.1.1 sirv: 3.0.1 - vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) optionalDependencies: '@nuxt/kit': 3.15.4(magicast@0.3.5) transitivePeerDependencies: - rollup - supports-color - vite-plugin-vue-devtools@7.7.0(rollup@4.41.1)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3)): + vite-plugin-vue-devtools@7.7.0(rollup@4.40.2)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3)): dependencies: - '@vue/devtools-core': 7.7.2(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3)) - '@vue/devtools-kit': 7.7.2 - '@vue/devtools-shared': 7.7.2 - execa: 9.5.2 + '@vue/devtools-core': 7.7.6(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3)) + '@vue/devtools-kit': 7.7.6 + '@vue/devtools-shared': 7.7.6 + execa: 9.5.3 sirv: 3.0.1 - vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) - vite-plugin-inspect: 0.8.9(@nuxt/kit@3.15.4(magicast@0.3.5))(rollup@4.41.1)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) - vite-plugin-vue-inspector: 5.3.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) + vite-plugin-inspect: 0.8.9(@nuxt/kit@3.15.4(magicast@0.3.5))(rollup@4.40.2)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) + vite-plugin-vue-inspector: 5.3.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) transitivePeerDependencies: - '@nuxt/kit' - rollup - supports-color - vue - vite-plugin-vue-inspector@5.3.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)): + vite-plugin-vue-inspector@5.3.1(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)): dependencies: - '@babel/core': 7.26.10 - '@babel/plugin-proposal-decorators': 7.25.9(@babel/core@7.26.10) - '@babel/plugin-syntax-import-attributes': 7.26.0(@babel/core@7.26.10) - '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.26.10) - '@babel/plugin-transform-typescript': 7.26.8(@babel/core@7.26.10) - '@vue/babel-plugin-jsx': 1.4.0(@babel/core@7.26.10) + '@babel/core': 7.27.1 + '@babel/plugin-proposal-decorators': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-syntax-import-attributes': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.27.1) + '@babel/plugin-transform-typescript': 7.27.1(@babel/core@7.27.1) + '@vue/babel-plugin-jsx': 1.4.0(@babel/core@7.27.1) '@vue/compiler-dom': 3.5.13 kolorist: 1.8.0 magic-string: 0.30.17 - vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1) transitivePeerDependencies: - supports-color - vite@5.4.14(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0): + vite-plugin-vue-inspector@5.3.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)): dependencies: - esbuild: 0.21.5 - postcss: 8.5.4 - rollup: 4.41.1 - optionalDependencies: - '@types/node': 22.10.5 - fsevents: 2.3.3 - less: 4.2.2 - sass: 1.85.0 - terser: 5.39.0 + '@babel/core': 7.27.1 + '@babel/plugin-proposal-decorators': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-syntax-import-attributes': 7.27.1(@babel/core@7.27.1) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.27.1) + '@babel/plugin-transform-typescript': 7.27.1(@babel/core@7.27.1) + '@vue/babel-plugin-jsx': 1.4.0(@babel/core@7.27.1) + '@vue/compiler-dom': 3.5.13 + kolorist: 1.8.0 + magic-string: 0.30.17 + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) + transitivePeerDependencies: + - supports-color - vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0): + vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1): dependencies: esbuild: 0.21.5 - postcss: 8.5.4 + postcss: 8.5.3 rollup: 4.31.0 optionalDependencies: '@types/node': 22.10.5 fsevents: 2.3.3 less: 4.2.2 sass: 1.85.0 - terser: 5.39.0 + terser: 5.39.1 vite@6.1.0(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0): dependencies: esbuild: 0.24.2 - postcss: 8.5.4 + postcss: 8.5.3 rollup: 4.31.0 optionalDependencies: '@types/node': 22.10.5 @@ -24503,10 +26224,10 @@ snapshots: terser: 5.39.0 yaml: 2.8.0 - vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0): + vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0): dependencies: - esbuild: 0.25.5 - postcss: 8.5.4 + esbuild: 0.25.4 + postcss: 8.5.3 rollup: 4.31.0 optionalDependencies: '@types/node': 22.10.5 @@ -24514,33 +26235,33 @@ snapshots: jiti: 2.4.2 less: 4.2.2 sass: 1.85.0 - terser: 5.39.0 + terser: 5.39.1 yaml: 2.8.0 - vitefu@1.0.6(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)): + vitefu@1.0.6(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)): optionalDependencies: - vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) - vitepress@1.3.0(@algolia/client-search@5.21.0)(@types/node@22.10.5)(@types/react@19.0.1)(axios@1.8.2)(less@4.2.2)(postcss@8.5.4)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.85.0)(search-insights@2.17.3)(terser@5.39.0)(typescript@5.8.3): + vitepress@1.3.0(@algolia/client-search@5.25.0)(@types/node@22.10.5)(@types/react@19.0.1)(axios@1.9.0)(less@4.2.2)(postcss@8.5.3)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.85.0)(search-insights@2.17.3)(terser@5.39.1)(typescript@5.8.3): dependencies: '@docsearch/css': 3.9.0 - '@docsearch/js': 3.9.0(@algolia/client-search@5.21.0)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(search-insights@2.17.3) + '@docsearch/js': 3.9.0(@algolia/client-search@5.25.0)(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(search-insights@2.17.3) '@shikijs/core': 1.29.2 '@shikijs/transformers': 1.29.2 '@types/markdown-it': 14.1.2 - '@vitejs/plugin-vue': 5.2.1(vite@5.4.14(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0))(vue@3.5.13(typescript@5.8.3)) - '@vue/devtools-api': 7.7.2 + '@vitejs/plugin-vue': 5.2.1(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1))(vue@3.5.13(typescript@5.8.3)) + '@vue/devtools-api': 7.7.6 '@vue/shared': 3.5.13 '@vueuse/core': 10.11.1(vue@3.5.13(typescript@5.8.3)) - '@vueuse/integrations': 10.11.1(axios@1.8.2)(focus-trap@7.6.4)(vue@3.5.13(typescript@5.8.3)) + '@vueuse/integrations': 10.11.1(axios@1.9.0)(focus-trap@7.6.4)(vue@3.5.13(typescript@5.8.3)) focus-trap: 7.6.4 mark.js: 8.11.1 minisearch: 6.3.0 shiki: 1.29.2 - vite: 5.4.14(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0) + vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1) vue: 3.5.13(typescript@5.8.3) optionalDependencies: - postcss: 8.5.4 + postcss: 8.5.3 transitivePeerDependencies: - '@algolia/client-search' - '@types/node' @@ -24569,9 +26290,9 @@ snapshots: - typescript - universal-cookie - vitest-environment-nuxt@1.0.1(@types/node@22.10.5)(@vue/test-utils@2.4.6)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(magicast@0.3.5)(sass@1.85.0)(terser@5.39.0)(typescript@5.8.3)(vitest@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))(yaml@2.8.0): + vitest-environment-nuxt@1.0.1(@types/node@22.10.5)(@vue/test-utils@2.4.6)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(magicast@0.3.5)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vitest@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(yaml@2.8.0): dependencies: - '@nuxt/test-utils': 3.17.2(@types/node@22.10.5)(@vue/test-utils@2.4.6)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(magicast@0.3.5)(sass@1.85.0)(terser@5.39.0)(typescript@5.8.3)(vitest@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0))(yaml@2.8.0) + '@nuxt/test-utils': 3.17.2(@types/node@22.10.5)(@vue/test-utils@2.4.6)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(magicast@0.3.5)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vitest@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(yaml@2.8.0) transitivePeerDependencies: - '@cucumber/cucumber' - '@jest/globals' @@ -24597,27 +26318,27 @@ snapshots: - vitest - yaml - vitest@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0): + vitest@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0): dependencies: '@vitest/expect': 3.1.1 - '@vitest/mocker': 3.1.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)) - '@vitest/pretty-format': 3.1.1 + '@vitest/mocker': 3.1.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) + '@vitest/pretty-format': 3.1.3 '@vitest/runner': 3.1.1 '@vitest/snapshot': 3.1.1 '@vitest/spy': 3.1.1 '@vitest/utils': 3.1.1 chai: 5.2.0 - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 expect-type: 1.2.1 magic-string: 0.30.17 pathe: 2.0.3 - std-env: 3.8.1 + std-env: 3.9.0 tinybench: 2.9.0 tinyexec: 0.3.2 tinypool: 1.0.2 tinyrainbow: 2.0.0 - vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) - vite-node: 3.1.1(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0) + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) + vite-node: 3.1.1(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 22.10.5 @@ -24663,9 +26384,9 @@ snapshots: vue-bundle-renderer@2.1.1: dependencies: - ufo: 1.5.4 + ufo: 1.6.1 - vue-component-type-helpers@2.2.8: {} + vue-component-type-helpers@2.2.10: {} vue-demi@0.14.10(vue@3.5.13(typescript@5.8.3)): dependencies: @@ -24675,7 +26396,7 @@ snapshots: vue-eslint-parser@9.4.3(eslint@9.17.0(jiti@2.4.2)): dependencies: - debug: 4.4.0(supports-color@9.4.0) + debug: 4.4.1 eslint: 9.17.0(jiti@2.4.2) eslint-scope: 7.2.2 eslint-visitor-keys: 3.4.3 @@ -24693,7 +26414,7 @@ snapshots: vue-tsc@2.2.0(typescript@5.8.3): dependencies: - '@volar/typescript': 2.4.12 + '@volar/typescript': 2.4.13 '@vue/language-core': 2.2.0(typescript@5.8.3) typescript: 5.8.3 @@ -24744,13 +26465,13 @@ snapshots: webpack-dev-middleware@7.4.2(webpack@5.98.0(esbuild@0.25.0)): dependencies: colorette: 2.0.20 - memfs: 4.17.0 + memfs: 4.17.1 mime-types: 2.1.35 on-finished: 2.4.1 range-parser: 1.2.1 - schema-utils: 4.3.0 + schema-utils: 4.3.2 optionalDependencies: - webpack: 5.98.0(esbuild@0.25.2) + webpack: 5.98.0(esbuild@0.25.4) webpack-dev-server@5.2.0(webpack@5.98.0(esbuild@0.25.0)): dependencies: @@ -24760,7 +26481,7 @@ snapshots: '@types/serve-index': 1.9.4 '@types/serve-static': 1.15.7 '@types/sockjs': 0.3.36 - '@types/ws': 8.18.0 + '@types/ws': 8.18.1 ansi-html-community: 0.0.8 bonjour-service: 1.3.0 chokidar: 3.6.0 @@ -24769,20 +26490,20 @@ snapshots: connect-history-api-fallback: 2.0.0 express: 4.21.2 graceful-fs: 4.2.11 - http-proxy-middleware: 2.0.7(@types/express@4.17.21) + http-proxy-middleware: 2.0.9(@types/express@4.17.21) ipaddr.js: 2.2.0 launch-editor: 2.10.0 - open: 10.1.0 + open: 10.1.2 p-retry: 6.2.1 - schema-utils: 4.3.0 + schema-utils: 4.3.2 selfsigned: 2.4.1 serve-index: 1.9.1 sockjs: 0.3.24 spdy: 4.0.2 webpack-dev-middleware: 7.4.2(webpack@5.98.0(esbuild@0.25.0)) - ws: 8.18.1 + ws: 8.18.2 optionalDependencies: - webpack: 5.98.0(esbuild@0.25.2) + webpack: 5.98.0(esbuild@0.25.4) transitivePeerDependencies: - bufferutil - debug @@ -24800,22 +26521,22 @@ snapshots: webpack-subresource-integrity@5.1.0(webpack@5.98.0(esbuild@0.25.0)): dependencies: typed-assert: 1.0.9 - webpack: 5.98.0(esbuild@0.25.2) + webpack: 5.98.0(esbuild@0.25.4) webpack-virtual-modules@0.6.2: {} - webpack@5.98.0(esbuild@0.25.2): + webpack@5.98.0(esbuild@0.25.4): dependencies: '@types/eslint-scope': 3.7.7 - '@types/estree': 1.0.6 + '@types/estree': 1.0.7 '@webassemblyjs/ast': 1.14.1 '@webassemblyjs/wasm-edit': 1.14.1 '@webassemblyjs/wasm-parser': 1.14.1 acorn: 8.14.1 - browserslist: 4.24.4 + browserslist: 4.24.5 chrome-trace-event: 1.0.4 enhanced-resolve: 5.18.1 - es-module-lexer: 1.6.0 + es-module-lexer: 1.7.0 eslint-scope: 5.1.1 events: 3.3.0 glob-to-regexp: 0.4.1 @@ -24824,9 +26545,9 @@ snapshots: loader-runner: 4.3.0 mime-types: 2.1.35 neo-async: 2.6.2 - schema-utils: 4.3.0 + schema-utils: 4.3.2 tapable: 2.2.1 - terser-webpack-plugin: 5.3.14(esbuild@0.25.2)(webpack@5.98.0(esbuild@0.25.0)) + terser-webpack-plugin: 5.3.14(esbuild@0.25.4)(webpack@5.98.0(esbuild@0.25.0)) watchpack: 2.4.2 webpack-sources: 3.2.3 transitivePeerDependencies: @@ -24836,7 +26557,7 @@ snapshots: websocket-driver@0.7.4: dependencies: - http-parser-js: 0.5.9 + http-parser-js: 0.5.10 safe-buffer: 5.2.1 websocket-extensions: 0.1.4 @@ -24848,9 +26569,9 @@ snapshots: whatwg-mimetype@4.0.0: {} - whatwg-url@14.1.1: + whatwg-url@14.2.0: dependencies: - tr46: 5.0.0 + tr46: 5.1.1 webidl-conversions: 7.0.0 whatwg-url@5.0.0: @@ -24926,8 +26647,32 @@ snapshots: siginfo: 2.0.0 stackback: 0.0.2 + wide-align@1.1.5: + dependencies: + string-width: 4.2.3 + wildcard@2.0.1: {} + winston-transport@4.9.0: + dependencies: + logform: 2.7.0 + readable-stream: 3.6.2 + triple-beam: 1.4.1 + + winston@3.17.0: + dependencies: + '@colors/colors': 1.6.0 + '@dabh/diagnostics': 2.0.3 + async: 3.2.6 + is-stream: 2.0.1 + logform: 2.7.0 + one-time: 1.0.0 + readable-stream: 3.6.2 + safe-stable-stringify: 2.5.0 + stack-trace: 0.0.10 + triple-beam: 1.4.1 + winston-transport: 4.9.0 + word-wrap@1.2.5: {} wordwrap@1.0.0: {} @@ -24958,9 +26703,16 @@ snapshots: wrappy@1.0.2: {} + write-file-atomic@6.0.0: + dependencies: + imurmurhash: 0.1.4 + signal-exit: 4.1.0 + ws@8.17.1: {} - ws@8.18.1: {} + ws@8.18.2: {} + + xcurl@2.1.2: {} xml-name-validator@4.0.0: {} @@ -24978,8 +26730,6 @@ snapshots: yallist@5.0.0: {} - yaml-ast-parser@0.0.43: {} - yaml@1.10.2: {} yaml@2.6.1: {} @@ -25019,7 +26769,7 @@ snapshots: yocto-queue@0.1.0: {} - yocto-queue@1.2.0: {} + yocto-queue@1.2.1: {} yoctocolors-cjs@2.1.2: {} @@ -25030,17 +26780,31 @@ snapshots: '@poppinss/exception': 1.2.1 error-stack-parser-es: 1.0.5 - youch@4.1.0-beta.6: + youch@4.1.0-beta.7: dependencies: '@poppinss/dumper': 0.6.3 '@speed-highlight/core': 1.2.7 cookie: 1.0.2 youch-core: 0.3.2 + z-schema@5.0.5: + dependencies: + lodash.get: 4.4.2 + lodash.isequal: 4.5.0 + validator: 13.15.15 + optionalDependencies: + commander: 9.5.0 + zhead@2.2.4: {} zimmerframe@1.1.2: {} + zip-stream@4.1.1: + dependencies: + archiver-utils: 3.0.4 + compress-commons: 4.1.2 + readable-stream: 3.6.2 + zip-stream@6.0.1: dependencies: archiver-utils: 5.0.2 From c1d59ec4efe877d03e6f8655007a0dddb6770d4e Mon Sep 17 00:00:00 2001 From: Landon Date: Sun, 13 Apr 2025 21:27:43 -0400 Subject: [PATCH 02/26] feat(config): add exports field and support for CommonJS format in Vite base config --- packages/config-vite-base/package.json | 12 ++++++++++++ packages/config-vite-base/tsup.config.ts | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/config-vite-base/package.json b/packages/config-vite-base/package.json index e95357f01..0258265d6 100644 --- a/packages/config-vite-base/package.json +++ b/packages/config-vite-base/package.json @@ -10,6 +10,18 @@ "scripts": { "build": "tsup" }, + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } + }, "dependencies": { "vite": "^6.2.7", "vitest": "^3.1.1" diff --git a/packages/config-vite-base/tsup.config.ts b/packages/config-vite-base/tsup.config.ts index b52c14e15..d6a693679 100644 --- a/packages/config-vite-base/tsup.config.ts +++ b/packages/config-vite-base/tsup.config.ts @@ -4,5 +4,5 @@ export default defineConfig({ clean: true, dts: true, entry: ['src/index.ts'], - format: ['esm'], + format: ['esm', 'cjs'], }); From ec4dd293a60f37b93aed6fec8cd5e2632ae70d79 Mon Sep 17 00:00:00 2001 From: Landon Date: Sun, 13 Apr 2025 21:32:34 -0400 Subject: [PATCH 03/26] fix(turbo.json): enable caching for build task --- turbo.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbo.json b/turbo.json index 8404749c6..a9858dfe9 100644 --- a/turbo.json +++ b/turbo.json @@ -2,7 +2,7 @@ "$schema": "./node_modules/turbo/schema.json", "tasks": { "build": { - "cache": false, + "cache": true, "dependsOn": ["^build"], "outputs": [ ".next/**", From c5219db37f4c79c11afb17fc8778f5bc9c01e501 Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Mon, 14 Apr 2025 17:10:49 -0400 Subject: [PATCH 04/26] fix(nx-plugin): update build output --- packages/nx-plugin/executors.json | 2 +- packages/nx-plugin/generators.json | 2 +- packages/nx-plugin/package.json | 30 ++++++----- .../nx-plugin/scripts/copy-json-files.mts | 51 +++++++++++++++++++ packages/nx-plugin/src/index.ts | 2 - packages/nx-plugin/tsup.config.ts | 13 ++++- pnpm-lock.yaml | 3 ++ 7 files changed, 85 insertions(+), 18 deletions(-) create mode 100644 packages/nx-plugin/scripts/copy-json-files.mts diff --git a/packages/nx-plugin/executors.json b/packages/nx-plugin/executors.json index 0a4cee281..d711dc0d2 100644 --- a/packages/nx-plugin/executors.json +++ b/packages/nx-plugin/executors.json @@ -1,7 +1,7 @@ { "executors": { "update-api": { - "implementation": "./dist/executors/update-api/index.js", + "implementation": "./dist/updateApi.js", "schema": "./dist/executors/update-api/schema.json", "description": "Updates the OpenAPI spec file and generates new client code if needed." } diff --git a/packages/nx-plugin/generators.json b/packages/nx-plugin/generators.json index bb30bb37c..9cd238e48 100644 --- a/packages/nx-plugin/generators.json +++ b/packages/nx-plugin/generators.json @@ -3,7 +3,7 @@ "version": "0.0.1", "generators": { "openapi-client": { - "factory": "./dist/generators/openapi-client/index.js", + "factory": "./dist/openapiClient.js", "schema": "./dist/generators/openapi-client/schema.json", "description": "Generate an OpenAPI client library from an OpenAPI spec file." } diff --git a/packages/nx-plugin/package.json b/packages/nx-plugin/package.json index 021735d5b..71b42a455 100644 --- a/packages/nx-plugin/package.json +++ b/packages/nx-plugin/package.json @@ -25,8 +25,8 @@ "nx", "swagger" ], - "type": "commonjs", - "main": "./dist/index.js", + "type": "module", + "main": "./dist/index.cjs", "module": "./dist/index.js", "types": "./dist/index.d.ts", "scripts": { @@ -38,16 +38,20 @@ "prepublishOnly": "pnpm build" }, "exports": { - "./package.json": "./package.json", ".": { - "development": "./src/index.ts", - "types": "./dist/index.d.ts", - "import": "./dist/index.js", - "default": "./dist/index.js" - } + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + }, + "./package.json": "./package.json" }, - "executors": "./executors.json", - "generators": "./generators.json", + "executors": "./dist/executors.json", + "generators": "./dist/generators.json", "dependencies": { "@hey-api/json-schema-ref-parser": "1.0.4", "@hey-api/openapi-ts": "workspace:*", @@ -59,13 +63,13 @@ }, "devDependencies": { "@config/vite-base": "workspace:*", + "ts-node": "10.9.2", "typescript": "5.8.3", "vitest": "3.1.1" }, "files": [ + "package.json", "dist", - "LICENSE.md", - "generators.json", - "executors.json" + "LICENSE.md" ] } diff --git a/packages/nx-plugin/scripts/copy-json-files.mts b/packages/nx-plugin/scripts/copy-json-files.mts new file mode 100644 index 000000000..6ae373ac4 --- /dev/null +++ b/packages/nx-plugin/scripts/copy-json-files.mts @@ -0,0 +1,51 @@ +import { + copyFileSync, + existsSync, + mkdirSync, + readdirSync, + statSync, +} from 'node:fs'; +import { dirname, extname, join, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; + +// Get current directory +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +// Function to recursively create directories +function ensureDirectoryExists(dirPath: string) { + if (!existsSync(dirPath)) { + mkdirSync(dirPath, { recursive: true }); + } +} + +// Function to recursively copy JSON files from source to destination +function copyJsonFiles(sourceDir: string, targetDir: string) { + // Read all files and directories in the source directory + const items = readdirSync(sourceDir); + + for (const item of items) { + const sourcePath = join(sourceDir, item); + const targetPath = join(targetDir, item); + + const stats = statSync(sourcePath); + + if (stats.isDirectory()) { + // Recursively copy JSON files from subdirectories + copyJsonFiles(sourcePath, targetPath); + } else if (stats.isFile() && extname(item).toLowerCase() === '.json') { + // Copy JSON files + ensureDirectoryExists(dirname(targetPath)); + copyFileSync(sourcePath, targetPath); + console.log(`Copied: ${sourcePath} -> ${targetPath}`); + } + } +} + +// Copy JSON files from src to dist +const sourceDir = resolve(__dirname, '../src'); +const targetDir = resolve(__dirname, '../dist'); + +console.log('Copying JSON files from src to dist...'); +copyJsonFiles(sourceDir, targetDir); +console.log('JSON files copying completed.'); diff --git a/packages/nx-plugin/src/index.ts b/packages/nx-plugin/src/index.ts index 1a94e34b3..8a6084d32 100644 --- a/packages/nx-plugin/src/index.ts +++ b/packages/nx-plugin/src/index.ts @@ -1,4 +1,2 @@ -export * from './executors/update-api'; -export * from './generators/openapi-client'; export * from './utils'; export * from './vars'; diff --git a/packages/nx-plugin/tsup.config.ts b/packages/nx-plugin/tsup.config.ts index c101964ef..72253f00a 100644 --- a/packages/nx-plugin/tsup.config.ts +++ b/packages/nx-plugin/tsup.config.ts @@ -14,9 +14,20 @@ export default defineConfig((options) => ({ }, clean: true, dts: true, - entry: ['src/index.ts'], + entry: { + index: 'src/index.ts', + openapiClient: 'src/generators/openapi-client/index.ts', + updateApi: 'src/executors/update-api/index.ts', + }, format: ['cjs', 'esm'], minify: !options.watch, + onSuccess: 'node --loader ts-node/esm scripts/copy-json-files.mts', + outDir: 'dist', + outExtension({ format }) { + return { + js: format === 'cjs' ? '.cjs' : '.js', + }; + }, shims: false, sourcemap: true, treeshake: true, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 096acbf2d..67be68730 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -811,6 +811,9 @@ importers: '@config/vite-base': specifier: workspace:* version: link:../config-vite-base + ts-node: + specifier: 10.9.2 + version: 10.9.2(@types/node@22.10.5)(typescript@5.8.3) typescript: specifier: 5.8.3 version: 5.8.3 From 6ec8fca0bc4a2767b83301939f0b4014c3607d99 Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Mon, 14 Apr 2025 17:26:57 -0400 Subject: [PATCH 05/26] refactor(nx-plugin): update schema prompts and descriptions for clarity in update-api and openapi-client --- .../src/executors/update-api/schema.json | 33 ++++++++--------- .../src/generators/openapi-client/schema.json | 37 +++++++++---------- 2 files changed, 33 insertions(+), 37 deletions(-) diff --git a/packages/nx-plugin/src/executors/update-api/schema.json b/packages/nx-plugin/src/executors/update-api/schema.json index 170133555..4d4d97939 100644 --- a/packages/nx-plugin/src/executors/update-api/schema.json +++ b/packages/nx-plugin/src/executors/update-api/schema.json @@ -8,38 +8,35 @@ "name": { "type": "string", "description": "The name of the project", - "x-prompt": "What is the name of the project? (e.g. my-api)", "$default": { "$source": "argv", "index": 0 - } - }, - "spec": { - "type": "string", - "description": "The path to the OpenAPI spec file", - "x-prompt": "What is the path to the OpenAPI spec file? (URI or local file path)" + }, + "x-prompt": "What name would you like to use for the library? (e.g. my-api)" }, - "client": { + "directory": { "type": "string", - "description": "The type of client to generate", - "x-prompt": "What is the type of client to generate? (@hey-api/client-fetch, @hey-api/client-axios)", - "default": "@hey-api/client-fetch" + "description": "Directory where the library will be created", + "default": "libs" }, "scope": { "type": "string", "description": "The scope of the project", "x-prompt": "What is the scope of the project? (e.g. @my-org)" }, - "directory": { + "spec": { "type": "string", - "description": "The directory of the project", - "x-prompt": "What is the directory of the project? (e.g. libs)", - "default": "libs" + "description": "Path to the OpenAPI spec file (URL or local path)", + "x-prompt": "What is the path to the OpenAPI spec file? (URI or local file path)" + }, + "client": { + "type": "string", + "description": "The type of client to generate (@hey-api/client-fetch, @hey-api/client-axios, etc)", + "default": "@hey-api/client-fetch" }, "plugins": { "type": "array", - "description": "The plugins to use", - "x-prompt": "What plugins would you like to use? (e.g. @tanstack/react-query)", + "description": "The plugins to be provided to @hey-api/openapi-ts", "default": [], "items": { "type": "string" @@ -47,7 +44,7 @@ }, "force": { "type": "boolean", - "description": "If true, the Client code will be regenerated even if the spec has not changed", + "description": "If true, the Client code will be regenerated even if the spec has not changed, also pass --skip-nx-cache to avoid caching issues", "default": false } }, diff --git a/packages/nx-plugin/src/generators/openapi-client/schema.json b/packages/nx-plugin/src/generators/openapi-client/schema.json index 598283939..ee54a6dab 100644 --- a/packages/nx-plugin/src/generators/openapi-client/schema.json +++ b/packages/nx-plugin/src/generators/openapi-client/schema.json @@ -8,12 +8,12 @@ "properties": { "name": { "type": "string", - "description": "Library name", + "description": "The name of the project", "$default": { "$source": "argv", "index": 0 }, - "x-prompt": "What name would you like to use for the library?" + "x-prompt": "What name would you like to use for the library? (e.g. my-api)" }, "directory": { "type": "string", @@ -22,45 +22,44 @@ }, "scope": { "type": "string", - "description": "Scope of the library", - "x-prompt": "What is the scope of the library?" + "description": "The scope of the project", + "x-prompt": "What is the scope of the project? (e.g. @my-org)" }, "spec": { "type": "string", "description": "Path to the OpenAPI spec file (URL or local path)", - "x-prompt": "What is the URL or local path to the OpenAPI spec file?" - }, - "tags": { - "type": "array", - "description": "Add tags to the library (comma-separated)", - "default": ["api", "openapi"], - "items": { - "type": "string" - } + "x-prompt": "What is the path to the OpenAPI spec file? (URI or local file path)" }, "client": { "type": "string", - "description": "Type of client to generate", - "default": "@hey-api/client-fetch", - "x-prompt": "Which client type would you like to use?" + "description": "The type of client to generate (@hey-api/client-fetch, @hey-api/client-axios, etc)", + "default": "@hey-api/client-fetch" }, "plugins": { "type": "array", - "description": "Plugins to use", + "description": "The plugins to be provided to @hey-api/openapi-ts", "default": [], "items": { "type": "string" } }, + "tags": { + "type": "array", + "description": "Add tags to the library (comma-separated)", + "default": ["api", "openapi"], + "items": { + "type": "string" + } + }, "test": { "type": "string", - "description": "Test to use", + "description": "The test runner to use", "default": "none", "enum": ["none", "vitest"] }, "private": { "type": "boolean", - "description": "Whether to make the generated package private", + "description": "Whether to make the generated package private, put false if you want to publish the package.", "default": true } }, From e79a8fedb51898753121f0b8682a059b54dc2fb6 Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Mon, 14 Apr 2025 17:35:42 -0400 Subject: [PATCH 06/26] chore(nx-plugin): remove ts-node dependency and update JSON file copying script to js from ts --- packages/nx-plugin/package.json | 1 - .../{copy-json-files.mts => copy-json-files.mjs} | 16 +++++++++++----- packages/nx-plugin/tsup.config.ts | 2 +- pnpm-lock.yaml | 3 --- 4 files changed, 12 insertions(+), 10 deletions(-) rename packages/nx-plugin/scripts/{copy-json-files.mts => copy-json-files.mjs} (80%) diff --git a/packages/nx-plugin/package.json b/packages/nx-plugin/package.json index 71b42a455..e7a6456fc 100644 --- a/packages/nx-plugin/package.json +++ b/packages/nx-plugin/package.json @@ -63,7 +63,6 @@ }, "devDependencies": { "@config/vite-base": "workspace:*", - "ts-node": "10.9.2", "typescript": "5.8.3", "vitest": "3.1.1" }, diff --git a/packages/nx-plugin/scripts/copy-json-files.mts b/packages/nx-plugin/scripts/copy-json-files.mjs similarity index 80% rename from packages/nx-plugin/scripts/copy-json-files.mts rename to packages/nx-plugin/scripts/copy-json-files.mjs index 6ae373ac4..691f7465f 100644 --- a/packages/nx-plugin/scripts/copy-json-files.mts +++ b/packages/nx-plugin/scripts/copy-json-files.mjs @@ -8,19 +8,25 @@ import { import { dirname, extname, join, resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; -// Get current directory const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); -// Function to recursively create directories -function ensureDirectoryExists(dirPath: string) { +/** + * Recursively creates a directory if it does not exist. + * @param {string} dirPath + */ +function ensureDirectoryExists(dirPath) { if (!existsSync(dirPath)) { mkdirSync(dirPath, { recursive: true }); } } -// Function to recursively copy JSON files from source to destination -function copyJsonFiles(sourceDir: string, targetDir: string) { +/** + * Recursively copies JSON files from a source directory to a target directory. + * @param {string} sourceDir + * @param {string} targetDir + */ +function copyJsonFiles(sourceDir, targetDir) { // Read all files and directories in the source directory const items = readdirSync(sourceDir); diff --git a/packages/nx-plugin/tsup.config.ts b/packages/nx-plugin/tsup.config.ts index 72253f00a..317d68b1e 100644 --- a/packages/nx-plugin/tsup.config.ts +++ b/packages/nx-plugin/tsup.config.ts @@ -21,7 +21,7 @@ export default defineConfig((options) => ({ }, format: ['cjs', 'esm'], minify: !options.watch, - onSuccess: 'node --loader ts-node/esm scripts/copy-json-files.mts', + onSuccess: 'node scripts/copy-json-files.mjs', outDir: 'dist', outExtension({ format }) { return { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 67be68730..096acbf2d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -811,9 +811,6 @@ importers: '@config/vite-base': specifier: workspace:* version: link:../config-vite-base - ts-node: - specifier: 10.9.2 - version: 10.9.2(@types/node@22.10.5)(typescript@5.8.3) typescript: specifier: 5.8.3 version: 5.8.3 From 0449a296b13679863446815b5ac32be1983515d7 Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Mon, 14 Apr 2025 17:51:28 -0400 Subject: [PATCH 07/26] feat(vitest): add setup files configuration to Vitest base config --- packages/config-vite-base/src/setup.ts | 5 ++++ .../src/vitest.base.config.ts | 1 + packages/nx-plugin/src/utils.spec.ts | 30 ++++++++----------- 3 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 packages/config-vite-base/src/setup.ts diff --git a/packages/config-vite-base/src/setup.ts b/packages/config-vite-base/src/setup.ts new file mode 100644 index 000000000..3e4862e4c --- /dev/null +++ b/packages/config-vite-base/src/setup.ts @@ -0,0 +1,5 @@ +// FAIL LOUDLY on unhandled promise rejections / errors +process.on('unhandledRejection', (reason) => { + console.log(`******** FAILED TO HANDLE PROMISE REJECTION ********`); + throw reason; +}); diff --git a/packages/config-vite-base/src/vitest.base.config.ts b/packages/config-vite-base/src/vitest.base.config.ts index 3d84f7be7..b82e693cb 100644 --- a/packages/config-vite-base/src/vitest.base.config.ts +++ b/packages/config-vite-base/src/vitest.base.config.ts @@ -25,6 +25,7 @@ export function createVitestConfig( }, }, root, + setupFiles: ['./setup.ts'], testTimeout: platform() === 'win32' ? 10000 : 5000, }, }); diff --git a/packages/nx-plugin/src/utils.spec.ts b/packages/nx-plugin/src/utils.spec.ts index 034bf1eee..605fdeb23 100644 --- a/packages/nx-plugin/src/utils.spec.ts +++ b/packages/nx-plugin/src/utils.spec.ts @@ -129,12 +129,14 @@ describe('utils', () => { describe('generateClientCode', () => { it('should execute command successfully', async () => { - await generateClientCode({ - clientType: '@hey-api/client-fetch', - outputPath: './src/generated', - plugins: [], - specFile: './api/spec.yaml', - }); + await expect( + generateClientCode({ + clientType: '@hey-api/client-fetch', + outputPath: './src/generated', + plugins: [], + specFile: './api/spec.yaml', + }), + ).resolves.not.toThrow(); expect(createClient).toHaveBeenCalledWith({ input: './api/spec.yaml', @@ -148,22 +150,14 @@ describe('utils', () => { throw new Error('Command failed'); }); - try { - await generateClientCode({ + await expect( + generateClientCode({ clientType: '@hey-api/client-fetch', outputPath: './src/generated', plugins: [], specFile: './api/spec.yaml', - }); - // If we get here, fail the test - expect.fail('Expected function to throw'); - } catch (error) { - if (error instanceof Error) { - expect(error.message).toContain('Command failed'); - } else { - expect.fail('Expected error to be an instance of Error'); - } - } + }), + ).rejects.toThrow('Command failed'); }); }); From 8372977afeaaa044de636fa99b1581ccdd9379cf Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Mon, 14 Apr 2025 18:21:22 -0400 Subject: [PATCH 08/26] feat(turbo.json): add inputs configuration for improved build process --- turbo.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/turbo.json b/turbo.json index a9858dfe9..3deedbd4d 100644 --- a/turbo.json +++ b/turbo.json @@ -11,6 +11,14 @@ ".svelte-kit/**", ".vitepress/dist/**", "dist/**" + ], + "inputs": [ + "src", + "package.json", + "tsconfig.json", + "tsconfig.base.json", + "turbo.json", + "tsup.config.ts" ] }, "dev": { From c3908ba6ac9b031bc8e9085364027d623f0cb853 Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Mon, 14 Apr 2025 18:22:32 -0400 Subject: [PATCH 09/26] feat(client): update example to use actual code from the spec to avoid type error --- examples/openapi-ts-sample/src/App.tsx | 2 - .../body-response-text-plain/client.gen.ts | 16 + .../2.0.x/body-response-text-plain/index.ts | 3 + .../2.0.x/body-response-text-plain/sdk.gen.ts | 31 + .../body-response-text-plain/types.gen.ts | 21 + .../index.ts | 2 + .../types.gen.ts | 47 + .../index.ts | 2 + .../types.gen.ts | 47 + .../index.ts | 2 + .../types.gen.ts | 47 + .../index.ts | 2 + .../types.gen.ts | 47 + .../index.ts | 2 + .../types.gen.ts | 47 + .../index.ts | 2 + .../types.gen.ts | 31 + .../index.ts | 2 + .../types.gen.ts | 31 + .../index.ts | 2 + .../types.gen.ts | 31 + .../index.ts | 2 + .../types.gen.ts | 31 + .../index.ts | 2 + .../types.gen.ts | 31 + .../2.0.x/enum-names-values/index.ts | 2 + .../2.0.x/enum-names-values/types.gen.ts | 15 + .../2.0.x/exclude-deprecated/index.ts | 2 + .../2.0.x/exclude-deprecated/types.gen.ts | 21 + .../generated/2.0.x/form-data/client.gen.ts | 16 + .../test/generated/2.0.x/form-data/index.ts | 3 + .../test/generated/2.0.x/form-data/sdk.gen.ts | 31 + .../generated/2.0.x/form-data/types.gen.ts | 28 + .../@hey-api/schemas/default/schemas.gen.ts | 671 ++++++ .../@hey-api/sdk/default/client.gen.ts | 18 + .../plugins/@hey-api/sdk/default/index.ts | 3 + .../plugins/@hey-api/sdk/default/sdk.gen.ts | 277 +++ .../plugins/@hey-api/sdk/default/types.gen.ts | 1164 ++++++++++ .../@hey-api/sdk/throwOnError/client.gen.ts | 19 + .../@hey-api/sdk/throwOnError/index.ts | 3 + .../@hey-api/sdk/throwOnError/sdk.gen.ts | 277 +++ .../@hey-api/sdk/throwOnError/types.gen.ts | 1164 ++++++++++ .../transformers/type-format/client.gen.ts | 16 + .../transformers/type-format/index.ts | 3 + .../transformers/type-format/sdk.gen.ts | 32 + .../type-format/transformers.gen.ts | 13 + .../transformers/type-format/types.gen.ts | 32 + .../transformers/type-format/zod.gen.ts | 15 + .../read-write-only-custom-name/client.gen.ts | 16 + .../read-write-only-custom-name/index.ts | 2 + .../read-write-only-custom-name/types.gen.ts | 37 + .../read-write-only-ignore/client.gen.ts | 16 + .../read-write-only-ignore/index.ts | 2 + .../read-write-only-ignore/types.gen.ts | 33 + .../angular-query-experimental.gen.ts | 708 ++++++ .../asClass/client.gen.ts | 18 + .../asClass/index.ts | 3 + .../asClass/sdk.gen.ts | 356 +++ .../asClass/types.gen.ts | 1164 ++++++++++ .../angular-query-experimental.gen.ts | 709 ++++++ .../axios/client.gen.ts | 18 + .../angular-query-experimental/axios/index.ts | 3 + .../axios/sdk.gen.ts | 277 +++ .../axios/types.gen.ts | 1164 ++++++++++ .../angular-query-experimental.gen.ts | 708 ++++++ .../fetch/client.gen.ts | 18 + .../angular-query-experimental/fetch/index.ts | 3 + .../fetch/sdk.gen.ts | 277 +++ .../fetch/types.gen.ts | 1164 ++++++++++ .../asClass/@tanstack/react-query.gen.ts | 708 ++++++ .../react-query/asClass/client.gen.ts | 18 + .../@tanstack/react-query/asClass/index.ts | 3 + .../@tanstack/react-query/asClass/sdk.gen.ts | 356 +++ .../react-query/asClass/types.gen.ts | 1164 ++++++++++ .../axios/@tanstack/react-query.gen.ts | 709 ++++++ .../@tanstack/react-query/axios/client.gen.ts | 18 + .../@tanstack/react-query/axios/index.ts | 3 + .../@tanstack/react-query/axios/sdk.gen.ts | 277 +++ .../@tanstack/react-query/axios/types.gen.ts | 1164 ++++++++++ .../fetch/@tanstack/react-query.gen.ts | 708 ++++++ .../@tanstack/react-query/fetch/client.gen.ts | 18 + .../@tanstack/react-query/fetch/index.ts | 3 + .../@tanstack/react-query/fetch/sdk.gen.ts | 277 +++ .../@tanstack/react-query/fetch/types.gen.ts | 1164 ++++++++++ .../asClass/@tanstack/solid-query.gen.ts | 708 ++++++ .../solid-query/asClass/client.gen.ts | 18 + .../@tanstack/solid-query/asClass/index.ts | 3 + .../@tanstack/solid-query/asClass/sdk.gen.ts | 356 +++ .../solid-query/asClass/types.gen.ts | 1164 ++++++++++ .../axios/@tanstack/solid-query.gen.ts | 709 ++++++ .../@tanstack/solid-query/axios/client.gen.ts | 18 + .../@tanstack/solid-query/axios/index.ts | 3 + .../@tanstack/solid-query/axios/sdk.gen.ts | 277 +++ .../@tanstack/solid-query/axios/types.gen.ts | 1164 ++++++++++ .../fetch/@tanstack/solid-query.gen.ts | 708 ++++++ .../@tanstack/solid-query/fetch/client.gen.ts | 18 + .../@tanstack/solid-query/fetch/index.ts | 3 + .../@tanstack/solid-query/fetch/sdk.gen.ts | 277 +++ .../@tanstack/solid-query/fetch/types.gen.ts | 1164 ++++++++++ .../asClass/@tanstack/svelte-query.gen.ts | 708 ++++++ .../svelte-query/asClass/client.gen.ts | 18 + .../@tanstack/svelte-query/asClass/index.ts | 3 + .../@tanstack/svelte-query/asClass/sdk.gen.ts | 356 +++ .../svelte-query/asClass/types.gen.ts | 1164 ++++++++++ .../axios/@tanstack/svelte-query.gen.ts | 709 ++++++ .../svelte-query/axios/client.gen.ts | 18 + .../@tanstack/svelte-query/axios/index.ts | 3 + .../@tanstack/svelte-query/axios/sdk.gen.ts | 277 +++ .../@tanstack/svelte-query/axios/types.gen.ts | 1164 ++++++++++ .../fetch/@tanstack/svelte-query.gen.ts | 708 ++++++ .../svelte-query/fetch/client.gen.ts | 18 + .../@tanstack/svelte-query/fetch/index.ts | 3 + .../@tanstack/svelte-query/fetch/sdk.gen.ts | 277 +++ .../@tanstack/svelte-query/fetch/types.gen.ts | 1164 ++++++++++ .../asClass/@tanstack/vue-query.gen.ts | 708 ++++++ .../@tanstack/vue-query/asClass/client.gen.ts | 18 + .../@tanstack/vue-query/asClass/index.ts | 3 + .../@tanstack/vue-query/asClass/sdk.gen.ts | 356 +++ .../@tanstack/vue-query/asClass/types.gen.ts | 1164 ++++++++++ .../axios/@tanstack/vue-query.gen.ts | 709 ++++++ .../@tanstack/vue-query/axios/client.gen.ts | 18 + .../@tanstack/vue-query/axios/index.ts | 3 + .../@tanstack/vue-query/axios/sdk.gen.ts | 277 +++ .../@tanstack/vue-query/axios/types.gen.ts | 1164 ++++++++++ .../fetch/@tanstack/vue-query.gen.ts | 708 ++++++ .../@tanstack/vue-query/fetch/client.gen.ts | 18 + .../@tanstack/vue-query/fetch/index.ts | 3 + .../@tanstack/vue-query/fetch/sdk.gen.ts | 277 +++ .../@tanstack/vue-query/fetch/types.gen.ts | 1164 ++++++++++ .../plugins/fastify/default/fastify.gen.ts | 74 + .../2.0.x/plugins/fastify/default/index.ts | 2 + .../plugins/fastify/default/types.gen.ts | 1164 ++++++++++ .../plugins/my-plugin/default/client.gen.ts | 18 + .../2.0.x/plugins/my-plugin/default/index.ts | 2 + .../plugins/my-plugin/default/types.gen.ts | 2033 +++++++++++++++++ .../2.0.x/plugins/zod/default/zod.gen.ts | 271 +++ .../2.0.x/read-write-only/client.gen.ts | 16 + .../generated/2.0.x/read-write-only/index.ts | 2 + .../2.0.x/read-write-only/types.gen.ts | 37 + .../2.0.x/schema-unknown/client.gen.ts | 16 + .../generated/2.0.x/schema-unknown/index.ts | 3 + .../generated/2.0.x/schema-unknown/sdk.gen.ts | 33 + .../2.0.x/schema-unknown/types.gen.ts | 136 ++ .../2.0.x/security-api-key/client.gen.ts | 16 + .../generated/2.0.x/security-api-key/index.ts | 3 + .../2.0.x/security-api-key/sdk.gen.ts | 33 + .../2.0.x/security-api-key/types.gen.ts | 19 + .../2.0.x/security-basic/client.gen.ts | 16 + .../generated/2.0.x/security-basic/index.ts | 3 + .../generated/2.0.x/security-basic/sdk.gen.ts | 32 + .../2.0.x/security-basic/types.gen.ts | 19 + .../2.0.x/security-false/client.gen.ts | 16 + .../generated/2.0.x/security-false/index.ts | 3 + .../generated/2.0.x/security-false/sdk.gen.ts | 26 + .../2.0.x/security-false/types.gen.ts | 19 + .../2.0.x/security-oauth2/client.gen.ts | 16 + .../generated/2.0.x/security-oauth2/index.ts | 3 + .../2.0.x/security-oauth2/sdk.gen.ts | 32 + .../2.0.x/security-oauth2/types.gen.ts | 19 + .../2.0.x/servers-base-path/client.gen.ts | 16 + .../2.0.x/servers-base-path/index.ts | 2 + .../2.0.x/servers-base-path/types.gen.ts | 21 + .../2.0.x/servers-host/client.gen.ts | 16 + .../generated/2.0.x/servers-host/index.ts | 2 + .../generated/2.0.x/servers-host/types.gen.ts | 21 + .../generated/2.0.x/servers/client.gen.ts | 18 + .../test/generated/2.0.x/servers/index.ts | 2 + .../test/generated/2.0.x/servers/types.gen.ts | 21 + .../additional-properties-false/index.ts | 2 + .../additional-properties-false/types.gen.ts | 17 + .../3.0.x/additional-properties-true/index.ts | 2 + .../additional-properties-true/types.gen.ts | 21 + .../additional-properties-undefined/index.ts | 2 + .../types.gen.ts | 11 + .../array-items-one-of-length-1/index.ts | 2 + .../array-items-one-of-length-1/types.gen.ts | 11 + .../body-response-text-plain/client.gen.ts | 16 + .../3.0.x/body-response-text-plain/index.ts | 3 + .../3.0.x/body-response-text-plain/sdk.gen.ts | 31 + .../body-response-text-plain/types.gen.ts | 21 + .../generated/3.0.x/case-PascalCase/index.ts | 2 + .../3.0.x/case-PascalCase/types.gen.ts | 89 + .../generated/3.0.x/case-camelCase/index.ts | 2 + .../3.0.x/case-camelCase/types.gen.ts | 89 + .../generated/3.0.x/case-snake_case/index.ts | 2 + .../3.0.x/case-snake_case/types.gen.ts | 89 + .../test/generated/3.0.x/case/index.ts | 2 + .../test/generated/3.0.x/case/types.gen.ts | 89 + .../3.0.x/components-request-bodies/index.ts | 2 + .../components-request-bodies/types.gen.ts | 29 + .../generated/3.0.x/content-binary/index.ts | 2 + .../3.0.x/content-binary/types.gen.ts | 31 + .../3.0.x/discriminator-all-of/index.ts | 2 + .../3.0.x/discriminator-all-of/types.gen.ts | 49 + .../3.0.x/discriminator-any-of/index.ts | 2 + .../3.0.x/discriminator-any-of/types.gen.ts | 28 + .../3.0.x/discriminator-mapped-many/index.ts | 2 + .../discriminator-mapped-many/types.gen.ts | 19 + .../3.0.x/discriminator-one-of/index.ts | 2 + .../3.0.x/discriminator-one-of/types.gen.ts | 28 + .../test/generated/3.0.x/enum-escape/index.ts | 2 + .../generated/3.0.x/enum-escape/types.gen.ts | 11 + .../3.0.x/enum-inline-javascript/index.ts | 2 + .../3.0.x/enum-inline-javascript/types.gen.ts | 16 + .../enum-inline-typescript-namespace/index.ts | 2 + .../types.gen.ts | 16 + .../3.0.x/enum-inline-typescript/index.ts | 2 + .../3.0.x/enum-inline-typescript/types.gen.ts | 14 + .../test/generated/3.0.x/enum-inline/index.ts | 2 + .../generated/3.0.x/enum-inline/types.gen.ts | 11 + .../index.ts | 2 + .../types.gen.ts | 48 + .../index.ts | 2 + .../types.gen.ts | 48 + .../index.ts | 2 + .../types.gen.ts | 48 + .../index.ts | 2 + .../types.gen.ts | 48 + .../index.ts | 2 + .../types.gen.ts | 48 + .../index.ts | 2 + .../types.gen.ts | 31 + .../index.ts | 2 + .../types.gen.ts | 31 + .../index.ts | 2 + .../types.gen.ts | 31 + .../index.ts | 2 + .../types.gen.ts | 31 + .../index.ts | 2 + .../types.gen.ts | 31 + .../3.0.x/enum-names-values/index.ts | 2 + .../3.0.x/enum-names-values/types.gen.ts | 15 + .../test/generated/3.0.x/enum-null/index.ts | 2 + .../generated/3.0.x/enum-null/types.gen.ts | 11 + .../test/generated/3.0.x/enum-null/zod.gen.ts | 18 + .../3.0.x/exclude-deprecated/index.ts | 2 + .../3.0.x/exclude-deprecated/types.gen.ts | 21 + .../@tanstack/react-query.gen.ts | 99 + .../internal-name-conflict/client.gen.ts | 16 + .../3.0.x/internal-name-conflict/index.ts | 3 + .../3.0.x/internal-name-conflict/sdk.gen.ts | 40 + .../3.0.x/internal-name-conflict/types.gen.ts | 47 + .../generated/3.0.x/operation-204/index.ts | 2 + .../3.0.x/operation-204/types.gen.ts | 25 + .../client.gen.ts | 16 + .../parameter-explode-false-axios/index.ts | 3 + .../parameter-explode-false-axios/sdk.gen.ts | 32 + .../types.gen.ts | 21 + .../parameter-explode-false/client.gen.ts | 16 + .../3.0.x/parameter-explode-false/index.ts | 3 + .../3.0.x/parameter-explode-false/sdk.gen.ts | 32 + .../parameter-explode-false/types.gen.ts | 21 + .../@hey-api/schemas/default/schemas.gen.ts | 1987 ++++++++++++++++ .../@hey-api/sdk/default/client.gen.ts | 18 + .../plugins/@hey-api/sdk/default/index.ts | 3 + .../plugins/@hey-api/sdk/default/sdk.gen.ts | 409 ++++ .../plugins/@hey-api/sdk/default/types.gen.ts | 2023 ++++++++++++++++ .../@hey-api/sdk/throwOnError/client.gen.ts | 19 + .../@hey-api/sdk/throwOnError/index.ts | 3 + .../@hey-api/sdk/throwOnError/sdk.gen.ts | 409 ++++ .../@hey-api/sdk/throwOnError/types.gen.ts | 2023 ++++++++++++++++ .../transformers/type-format/client.gen.ts | 16 + .../transformers/type-format/index.ts | 3 + .../transformers/type-format/sdk.gen.ts | 32 + .../type-format/transformers.gen.ts | 13 + .../transformers/type-format/types.gen.ts | 32 + .../transformers/type-format/zod.gen.ts | 15 + .../read-write-only-custom-name/client.gen.ts | 16 + .../read-write-only-custom-name/index.ts | 2 + .../read-write-only-custom-name/types.gen.ts | 87 + .../read-write-only-ignore/client.gen.ts | 16 + .../read-write-only-ignore/index.ts | 2 + .../read-write-only-ignore/types.gen.ts | 77 + .../angular-query-experimental.gen.ts | 1128 +++++++++ .../asClass/client.gen.ts | 18 + .../asClass/index.ts | 3 + .../asClass/sdk.gen.ts | 506 ++++ .../asClass/types.gen.ts | 2023 ++++++++++++++++ .../angular-query-experimental.gen.ts | 1129 +++++++++ .../axios/client.gen.ts | 18 + .../angular-query-experimental/axios/index.ts | 3 + .../axios/sdk.gen.ts | 410 ++++ .../axios/types.gen.ts | 2023 ++++++++++++++++ .../angular-query-experimental.gen.ts | 1128 +++++++++ .../fetch/client.gen.ts | 18 + .../angular-query-experimental/fetch/index.ts | 3 + .../fetch/sdk.gen.ts | 409 ++++ .../fetch/types.gen.ts | 2023 ++++++++++++++++ .../asClass/@tanstack/react-query.gen.ts | 1128 +++++++++ .../react-query/asClass/client.gen.ts | 18 + .../@tanstack/react-query/asClass/index.ts | 3 + .../@tanstack/react-query/asClass/sdk.gen.ts | 506 ++++ .../react-query/asClass/types.gen.ts | 2023 ++++++++++++++++ .../axios/@tanstack/react-query.gen.ts | 1129 +++++++++ .../@tanstack/react-query/axios/client.gen.ts | 18 + .../@tanstack/react-query/axios/index.ts | 3 + .../@tanstack/react-query/axios/sdk.gen.ts | 410 ++++ .../@tanstack/react-query/axios/types.gen.ts | 2023 ++++++++++++++++ .../fetch/@tanstack/react-query.gen.ts | 1128 +++++++++ .../@tanstack/react-query/fetch/client.gen.ts | 18 + .../@tanstack/react-query/fetch/index.ts | 3 + .../@tanstack/react-query/fetch/sdk.gen.ts | 409 ++++ .../@tanstack/react-query/fetch/types.gen.ts | 2023 ++++++++++++++++ .../asClass/@tanstack/solid-query.gen.ts | 1128 +++++++++ .../solid-query/asClass/client.gen.ts | 18 + .../@tanstack/solid-query/asClass/index.ts | 3 + .../@tanstack/solid-query/asClass/sdk.gen.ts | 506 ++++ .../solid-query/asClass/types.gen.ts | 2023 ++++++++++++++++ .../axios/@tanstack/solid-query.gen.ts | 1129 +++++++++ .../@tanstack/solid-query/axios/client.gen.ts | 18 + .../@tanstack/solid-query/axios/index.ts | 3 + .../@tanstack/solid-query/axios/sdk.gen.ts | 410 ++++ .../@tanstack/solid-query/axios/types.gen.ts | 2023 ++++++++++++++++ .../fetch/@tanstack/solid-query.gen.ts | 1128 +++++++++ .../@tanstack/solid-query/fetch/client.gen.ts | 18 + .../@tanstack/solid-query/fetch/index.ts | 3 + .../@tanstack/solid-query/fetch/sdk.gen.ts | 409 ++++ .../@tanstack/solid-query/fetch/types.gen.ts | 2023 ++++++++++++++++ .../asClass/@tanstack/svelte-query.gen.ts | 1128 +++++++++ .../svelte-query/asClass/client.gen.ts | 18 + .../@tanstack/svelte-query/asClass/index.ts | 3 + .../@tanstack/svelte-query/asClass/sdk.gen.ts | 506 ++++ .../svelte-query/asClass/types.gen.ts | 2023 ++++++++++++++++ .../axios/@tanstack/svelte-query.gen.ts | 1129 +++++++++ .../svelte-query/axios/client.gen.ts | 18 + .../@tanstack/svelte-query/axios/index.ts | 3 + .../@tanstack/svelte-query/axios/sdk.gen.ts | 410 ++++ .../@tanstack/svelte-query/axios/types.gen.ts | 2023 ++++++++++++++++ .../fetch/@tanstack/svelte-query.gen.ts | 1128 +++++++++ .../svelte-query/fetch/client.gen.ts | 18 + .../@tanstack/svelte-query/fetch/index.ts | 3 + .../@tanstack/svelte-query/fetch/sdk.gen.ts | 409 ++++ .../@tanstack/svelte-query/fetch/types.gen.ts | 2023 ++++++++++++++++ .../asClass/@tanstack/vue-query.gen.ts | 1128 +++++++++ .../@tanstack/vue-query/asClass/client.gen.ts | 18 + .../@tanstack/vue-query/asClass/index.ts | 3 + .../@tanstack/vue-query/asClass/sdk.gen.ts | 506 ++++ .../@tanstack/vue-query/asClass/types.gen.ts | 2023 ++++++++++++++++ .../axios/@tanstack/vue-query.gen.ts | 1129 +++++++++ .../@tanstack/vue-query/axios/client.gen.ts | 18 + .../@tanstack/vue-query/axios/index.ts | 3 + .../@tanstack/vue-query/axios/sdk.gen.ts | 410 ++++ .../@tanstack/vue-query/axios/types.gen.ts | 2023 ++++++++++++++++ .../fetch/@tanstack/vue-query.gen.ts | 1128 +++++++++ .../@tanstack/vue-query/fetch/client.gen.ts | 18 + .../@tanstack/vue-query/fetch/index.ts | 3 + .../@tanstack/vue-query/fetch/sdk.gen.ts | 409 ++++ .../@tanstack/vue-query/fetch/types.gen.ts | 2023 ++++++++++++++++ .../plugins/fastify/default/fastify.gen.ts | 130 ++ .../3.0.x/plugins/fastify/default/index.ts | 2 + .../plugins/fastify/default/types.gen.ts | 2023 ++++++++++++++++ .../plugins/my-plugin/default/client.gen.ts | 18 + .../3.0.x/plugins/my-plugin/default/index.ts | 2 + .../plugins/my-plugin/default/types.gen.ts | 2033 +++++++++++++++++ .../3.0.x/plugins/zod/default/zod.gen.ts | 763 +++++++ .../3.0.x/read-write-only/client.gen.ts | 16 + .../generated/3.0.x/read-write-only/index.ts | 2 + .../3.0.x/read-write-only/types.gen.ts | 87 + .../3.0.x/security-api-key/client.gen.ts | 16 + .../generated/3.0.x/security-api-key/index.ts | 3 + .../3.0.x/security-api-key/sdk.gen.ts | 47 + .../3.0.x/security-api-key/types.gen.ts | 33 + .../3.0.x/security-false/client.gen.ts | 16 + .../generated/3.0.x/security-false/index.ts | 3 + .../generated/3.0.x/security-false/sdk.gen.ts | 26 + .../3.0.x/security-false/types.gen.ts | 19 + .../3.0.x/security-http-bearer/client.gen.ts | 16 + .../3.0.x/security-http-bearer/index.ts | 3 + .../3.0.x/security-http-bearer/sdk.gen.ts | 32 + .../3.0.x/security-http-bearer/types.gen.ts | 19 + .../3.0.x/security-oauth2/client.gen.ts | 16 + .../generated/3.0.x/security-oauth2/index.ts | 3 + .../3.0.x/security-oauth2/sdk.gen.ts | 32 + .../3.0.x/security-oauth2/types.gen.ts | 19 + .../security-open-id-connect/client.gen.ts | 16 + .../3.0.x/security-open-id-connect/index.ts | 3 + .../3.0.x/security-open-id-connect/sdk.gen.ts | 32 + .../security-open-id-connect/types.gen.ts | 19 + .../generated/3.0.x/servers/client.gen.ts | 18 + .../test/generated/3.0.x/servers/index.ts | 2 + .../test/generated/3.0.x/servers/types.gen.ts | 21 + .../3.0.x/transformers-all-of/client.gen.ts | 16 + .../3.0.x/transformers-all-of/index.ts | 2 + .../transformers-all-of/transformers.gen.ts | 35 + .../3.0.x/transformers-all-of/types.gen.ts | 46 + .../transformers-any-of-null/client.gen.ts | 16 + .../3.0.x/transformers-any-of-null/index.ts | 2 + .../transformers.gen.ts | 23 + .../transformers-any-of-null/types.gen.ts | 27 + .../3.0.x/transformers-array/client.gen.ts | 16 + .../3.0.x/transformers-array/index.ts | 2 + .../transformers-array/transformers.gen.ts | 11 + .../3.0.x/transformers-array/types.gen.ts | 25 + .../generated/3.0.x/type-invalid/index.ts | 2 + .../generated/3.0.x/type-invalid/types.gen.ts | 7 + .../generated/3.0.x/validators/zod.gen.ts | 23 + .../additional-properties-false/index.ts | 2 + .../additional-properties-false/types.gen.ts | 17 + .../3.1.x/additional-properties-true/index.ts | 2 + .../additional-properties-true/types.gen.ts | 21 + .../additional-properties-undefined/index.ts | 2 + .../types.gen.ts | 11 + .../array-items-one-of-length-1/index.ts | 2 + .../array-items-one-of-length-1/types.gen.ts | 11 + .../body-response-text-plain/client.gen.ts | 16 + .../3.1.x/body-response-text-plain/index.ts | 3 + .../3.1.x/body-response-text-plain/sdk.gen.ts | 31 + .../body-response-text-plain/types.gen.ts | 21 + .../generated/3.1.x/case-PascalCase/index.ts | 2 + .../3.1.x/case-PascalCase/types.gen.ts | 89 + .../generated/3.1.x/case-camelCase/index.ts | 2 + .../3.1.x/case-camelCase/types.gen.ts | 89 + .../generated/3.1.x/case-snake_case/index.ts | 2 + .../3.1.x/case-snake_case/types.gen.ts | 89 + .../test/generated/3.1.x/case/index.ts | 2 + .../test/generated/3.1.x/case/types.gen.ts | 89 + .../client-axios/base-url-false/client.gen.ts | 16 + .../client-axios/base-url-false/index.ts | 2 + .../client-axios/base-url-false/types.gen.ts | 2033 +++++++++++++++++ .../base-url-number/client.gen.ts | 18 + .../client-axios/base-url-number/index.ts | 2 + .../client-axios/base-url-number/types.gen.ts | 2033 +++++++++++++++++ .../base-url-strict/client.gen.ts | 18 + .../client-axios/base-url-strict/index.ts | 2 + .../client-axios/base-url-strict/types.gen.ts | 2033 +++++++++++++++++ .../base-url-string/client.gen.ts | 18 + .../client-axios/base-url-string/index.ts | 2 + .../client-axios/base-url-string/types.gen.ts | 2033 +++++++++++++++++ .../client-axios/bundle/client.gen.ts | 18 + .../client-axios/bundle/client/index.cjs | 2 + .../client-axios/bundle/client/index.d.cts | 207 ++ .../client-axios/bundle/client/index.d.ts | 207 ++ .../@hey-api/client-axios/bundle/index.ts | 3 + .../@hey-api/client-axios/bundle/sdk.gen.ts | 410 ++++ .../@hey-api/client-axios/bundle/types.gen.ts | 2033 +++++++++++++++++ .../client-axios/default/client.gen.ts | 18 + .../@hey-api/client-axios/default/index.ts | 3 + .../@hey-api/client-axios/default/sdk.gen.ts | 410 ++++ .../client-axios/default/types.gen.ts | 2033 +++++++++++++++++ .../sdk-client-optional/client.gen.ts | 18 + .../client-axios/sdk-client-optional/index.ts | 3 + .../sdk-client-optional/sdk.gen.ts | 410 ++++ .../sdk-client-optional/types.gen.ts | 2033 +++++++++++++++++ .../sdk-client-required/client.gen.ts | 18 + .../client-axios/sdk-client-required/index.ts | 3 + .../sdk-client-required/sdk.gen.ts | 409 ++++ .../sdk-client-required/types.gen.ts | 2033 +++++++++++++++++ .../client-fetch/base-url-false/client.gen.ts | 16 + .../client-fetch/base-url-false/index.ts | 2 + .../client-fetch/base-url-false/types.gen.ts | 2033 +++++++++++++++++ .../base-url-number/client.gen.ts | 18 + .../client-fetch/base-url-number/index.ts | 2 + .../client-fetch/base-url-number/types.gen.ts | 2033 +++++++++++++++++ .../base-url-strict/client.gen.ts | 18 + .../client-fetch/base-url-strict/index.ts | 2 + .../client-fetch/base-url-strict/types.gen.ts | 2033 +++++++++++++++++ .../base-url-string/client.gen.ts | 18 + .../client-fetch/base-url-string/index.ts | 2 + .../client-fetch/base-url-string/types.gen.ts | 2033 +++++++++++++++++ .../client-fetch/bundle/client.gen.ts | 18 + .../client-fetch/bundle/client/index.cjs | 2 + .../client-fetch/bundle/client/index.d.cts | 238 ++ .../client-fetch/bundle/client/index.d.ts | 238 ++ .../@hey-api/client-fetch/bundle/index.ts | 3 + .../@hey-api/client-fetch/bundle/sdk.gen.ts | 409 ++++ .../@hey-api/client-fetch/bundle/types.gen.ts | 2033 +++++++++++++++++ .../client-fetch/default/client.gen.ts | 18 + .../@hey-api/client-fetch/default/index.ts | 3 + .../@hey-api/client-fetch/default/sdk.gen.ts | 409 ++++ .../client-fetch/default/types.gen.ts | 2033 +++++++++++++++++ .../sdk-client-optional/client.gen.ts | 18 + .../client-fetch/sdk-client-optional/index.ts | 3 + .../sdk-client-optional/sdk.gen.ts | 409 ++++ .../sdk-client-optional/types.gen.ts | 2033 +++++++++++++++++ .../sdk-client-required/client.gen.ts | 18 + .../client-fetch/sdk-client-required/index.ts | 3 + .../sdk-client-required/sdk.gen.ts | 408 ++++ .../sdk-client-required/types.gen.ts | 2033 +++++++++++++++++ .../client-next/base-url-false/client.gen.ts | 16 + .../client-next/base-url-false/index.ts | 2 + .../client-next/base-url-false/types.gen.ts | 2033 +++++++++++++++++ .../client-next/base-url-number/client.gen.ts | 18 + .../client-next/base-url-number/index.ts | 2 + .../client-next/base-url-number/types.gen.ts | 2033 +++++++++++++++++ .../client-next/base-url-strict/client.gen.ts | 18 + .../client-next/base-url-strict/index.ts | 2 + .../client-next/base-url-strict/types.gen.ts | 2033 +++++++++++++++++ .../client-next/base-url-string/client.gen.ts | 18 + .../client-next/base-url-string/index.ts | 2 + .../client-next/base-url-string/types.gen.ts | 2033 +++++++++++++++++ .../@hey-api/client-next/bundle/client.gen.ts | 18 + .../client-next/bundle/client/index.cjs | 2 + .../client-next/bundle/client/index.d.cts | 229 ++ .../client-next/bundle/client/index.d.ts | 229 ++ .../@hey-api/client-next/bundle/index.ts | 3 + .../@hey-api/client-next/bundle/sdk.gen.ts | 409 ++++ .../@hey-api/client-next/bundle/types.gen.ts | 2033 +++++++++++++++++ .../client-next/default/client.gen.ts | 18 + .../@hey-api/client-next/default/index.ts | 3 + .../@hey-api/client-next/default/sdk.gen.ts | 409 ++++ .../@hey-api/client-next/default/types.gen.ts | 2033 +++++++++++++++++ .../sdk-client-optional/client.gen.ts | 18 + .../client-next/sdk-client-optional/index.ts | 3 + .../sdk-client-optional/sdk.gen.ts | 409 ++++ .../sdk-client-optional/types.gen.ts | 2033 +++++++++++++++++ .../sdk-client-required/client.gen.ts | 18 + .../client-next/sdk-client-required/index.ts | 3 + .../sdk-client-required/sdk.gen.ts | 408 ++++ .../sdk-client-required/types.gen.ts | 2033 +++++++++++++++++ .../client-nuxt/base-url-false/client.gen.ts | 16 + .../client-nuxt/base-url-false/index.ts | 2 + .../client-nuxt/base-url-false/types.gen.ts | 2033 +++++++++++++++++ .../client-nuxt/base-url-number/client.gen.ts | 18 + .../client-nuxt/base-url-number/index.ts | 2 + .../client-nuxt/base-url-number/types.gen.ts | 2033 +++++++++++++++++ .../client-nuxt/base-url-strict/client.gen.ts | 18 + .../client-nuxt/base-url-strict/index.ts | 2 + .../client-nuxt/base-url-strict/types.gen.ts | 2033 +++++++++++++++++ .../client-nuxt/base-url-string/client.gen.ts | 18 + .../client-nuxt/base-url-string/index.ts | 2 + .../client-nuxt/base-url-string/types.gen.ts | 2033 +++++++++++++++++ .../@hey-api/client-nuxt/bundle/client.gen.ts | 18 + .../client-nuxt/bundle/client/index.d.ts | 193 ++ .../client-nuxt/bundle/client/index.js | 2 + .../@hey-api/client-nuxt/bundle/index.ts | 3 + .../@hey-api/client-nuxt/bundle/sdk.gen.ts | 409 ++++ .../@hey-api/client-nuxt/bundle/types.gen.ts | 2033 +++++++++++++++++ .../client-nuxt/default/client.gen.ts | 18 + .../@hey-api/client-nuxt/default/index.ts | 3 + .../@hey-api/client-nuxt/default/sdk.gen.ts | 409 ++++ .../@hey-api/client-nuxt/default/types.gen.ts | 2033 +++++++++++++++++ .../sdk-client-optional/client.gen.ts | 18 + .../client-nuxt/sdk-client-optional/index.ts | 3 + .../sdk-client-optional/sdk.gen.ts | 409 ++++ .../sdk-client-optional/types.gen.ts | 2033 +++++++++++++++++ .../sdk-client-required/client.gen.ts | 18 + .../client-nuxt/sdk-client-required/index.ts | 3 + .../sdk-client-required/sdk.gen.ts | 408 ++++ .../sdk-client-required/types.gen.ts | 2033 +++++++++++++++++ .../base-url-false/client.gen.ts | 16 + .../client-custom/base-url-false/index.ts | 2 + .../client-custom/base-url-false/types.gen.ts | 2033 +++++++++++++++++ .../base-url-number/client.gen.ts | 18 + .../client-custom/base-url-number/index.ts | 2 + .../base-url-number/types.gen.ts | 2033 +++++++++++++++++ .../base-url-strict/client.gen.ts | 18 + .../client-custom/base-url-strict/index.ts | 2 + .../base-url-strict/types.gen.ts | 2033 +++++++++++++++++ .../base-url-string/client.gen.ts | 18 + .../client-custom/base-url-string/index.ts | 2 + .../base-url-string/types.gen.ts | 2033 +++++++++++++++++ .../client-custom/bundle/client.gen.ts | 18 + .../client-custom/bundle/client/index.cjs | 2 + .../client-custom/bundle/client/index.d.cts | 231 ++ .../client-custom/bundle/client/index.d.ts | 231 ++ .../clients/client-custom/bundle/index.ts | 3 + .../clients/client-custom/bundle/sdk.gen.ts | 409 ++++ .../clients/client-custom/bundle/types.gen.ts | 2033 +++++++++++++++++ .../client-custom/default/client.gen.ts | 18 + .../clients/client-custom/default/index.ts | 3 + .../clients/client-custom/default/sdk.gen.ts | 409 ++++ .../client-custom/default/types.gen.ts | 2033 +++++++++++++++++ .../sdk-client-optional/client.gen.ts | 18 + .../sdk-client-optional/index.ts | 3 + .../sdk-client-optional/sdk.gen.ts | 409 ++++ .../sdk-client-optional/types.gen.ts | 2033 +++++++++++++++++ .../sdk-client-required/client.gen.ts | 18 + .../sdk-client-required/index.ts | 3 + .../sdk-client-required/sdk.gen.ts | 408 ++++ .../sdk-client-required/types.gen.ts | 2033 +++++++++++++++++ .../my-client/base-url-false/client.gen.ts | 16 + .../clients/my-client/base-url-false/index.ts | 2 + .../my-client/base-url-false/types.gen.ts | 2033 +++++++++++++++++ .../my-client/base-url-number/client.gen.ts | 18 + .../my-client/base-url-number/index.ts | 2 + .../my-client/base-url-number/types.gen.ts | 2033 +++++++++++++++++ .../my-client/base-url-strict/client.gen.ts | 18 + .../my-client/base-url-strict/index.ts | 2 + .../my-client/base-url-strict/types.gen.ts | 2033 +++++++++++++++++ .../my-client/base-url-string/client.gen.ts | 18 + .../my-client/base-url-string/index.ts | 2 + .../my-client/base-url-string/types.gen.ts | 2033 +++++++++++++++++ .../clients/my-client/bundle/client.gen.ts | 18 + .../clients/my-client/bundle/client/client.ts | 167 ++ .../clients/my-client/bundle/client/index.ts | 19 + .../clients/my-client/bundle/client/plugin.ts | 28 + .../clients/my-client/bundle/client/types.ts | 159 ++ .../clients/my-client/bundle/client/utils.ts | 406 ++++ .../3.1.x/clients/my-client/bundle/index.ts | 3 + .../3.1.x/clients/my-client/bundle/sdk.gen.ts | 409 ++++ .../clients/my-client/bundle/types.gen.ts | 2033 +++++++++++++++++ .../clients/my-client/default/client.gen.ts | 18 + .../3.1.x/clients/my-client/default/index.ts | 3 + .../clients/my-client/default/sdk.gen.ts | 409 ++++ .../clients/my-client/default/types.gen.ts | 2033 +++++++++++++++++ .../sdk-client-optional/client.gen.ts | 18 + .../my-client/sdk-client-optional/index.ts | 3 + .../my-client/sdk-client-optional/sdk.gen.ts | 409 ++++ .../sdk-client-optional/types.gen.ts | 2033 +++++++++++++++++ .../sdk-client-required/client.gen.ts | 18 + .../my-client/sdk-client-required/index.ts | 3 + .../my-client/sdk-client-required/sdk.gen.ts | 408 ++++ .../sdk-client-required/types.gen.ts | 2033 +++++++++++++++++ .../3.1.x/components-request-bodies/index.ts | 2 + .../components-request-bodies/types.gen.ts | 29 + .../test/generated/3.1.x/const/index.ts | 2 + .../test/generated/3.1.x/const/types.gen.ts | 21 + .../generated/3.1.x/content-binary/index.ts | 2 + .../3.1.x/content-binary/types.gen.ts | 31 + .../3.1.x/discriminator-all-of/index.ts | 2 + .../3.1.x/discriminator-all-of/types.gen.ts | 49 + .../3.1.x/discriminator-any-of/index.ts | 2 + .../3.1.x/discriminator-any-of/types.gen.ts | 28 + .../3.1.x/discriminator-mapped-many/index.ts | 2 + .../discriminator-mapped-many/types.gen.ts | 19 + .../3.1.x/discriminator-one-of/index.ts | 2 + .../3.1.x/discriminator-one-of/types.gen.ts | 28 + .../generated/3.1.x/duplicate-null/index.ts | 2 + .../3.1.x/duplicate-null/types.gen.ts | 10 + .../test/generated/3.1.x/enum-escape/index.ts | 2 + .../generated/3.1.x/enum-escape/types.gen.ts | 11 + .../3.1.x/enum-inline-javascript/index.ts | 2 + .../3.1.x/enum-inline-javascript/types.gen.ts | 16 + .../enum-inline-typescript-namespace/index.ts | 2 + .../types.gen.ts | 16 + .../3.1.x/enum-inline-typescript/index.ts | 2 + .../3.1.x/enum-inline-typescript/types.gen.ts | 14 + .../test/generated/3.1.x/enum-inline/index.ts | 2 + .../generated/3.1.x/enum-inline/types.gen.ts | 11 + .../index.ts | 2 + .../types.gen.ts | 48 + .../index.ts | 2 + .../types.gen.ts | 48 + .../index.ts | 2 + .../types.gen.ts | 48 + .../index.ts | 2 + .../types.gen.ts | 48 + .../index.ts | 2 + .../types.gen.ts | 48 + .../index.ts | 2 + .../types.gen.ts | 31 + .../index.ts | 2 + .../types.gen.ts | 31 + .../index.ts | 2 + .../types.gen.ts | 31 + .../index.ts | 2 + .../types.gen.ts | 31 + .../index.ts | 2 + .../types.gen.ts | 31 + .../3.1.x/enum-names-values/index.ts | 2 + .../3.1.x/enum-names-values/types.gen.ts | 15 + .../test/generated/3.1.x/enum-null/index.ts | 2 + .../generated/3.1.x/enum-null/types.gen.ts | 11 + .../test/generated/3.1.x/enum-null/zod.gen.ts | 18 + .../3.1.x/exclude-deprecated/index.ts | 2 + .../3.1.x/exclude-deprecated/types.gen.ts | 21 + .../@tanstack/react-query.gen.ts | 99 + .../internal-name-conflict/client.gen.ts | 16 + .../3.1.x/internal-name-conflict/index.ts | 3 + .../3.1.x/internal-name-conflict/sdk.gen.ts | 40 + .../3.1.x/internal-name-conflict/types.gen.ts | 47 + .../3.1.x/object-properties-all-of/index.ts | 2 + .../object-properties-all-of/types.gen.ts | 15 + .../3.1.x/object-properties-any-of/index.ts | 2 + .../object-properties-any-of/types.gen.ts | 15 + .../3.1.x/object-properties-one-of/index.ts | 2 + .../object-properties-one-of/types.gen.ts | 15 + .../generated/3.1.x/operation-204/index.ts | 2 + .../3.1.x/operation-204/types.gen.ts | 25 + .../@tanstack/react-query.gen.ts | 123 + .../3.1.x/pagination-ref-any-of/client.gen.ts | 16 + .../3.1.x/pagination-ref-any-of/index.ts | 3 + .../3.1.x/pagination-ref-any-of/sdk.gen.ts | 30 + .../3.1.x/pagination-ref-any-of/types.gen.ts | 23 + .../client.gen.ts | 16 + .../parameter-explode-false-axios/index.ts | 3 + .../parameter-explode-false-axios/sdk.gen.ts | 32 + .../types.gen.ts | 21 + .../parameter-explode-false/client.gen.ts | 16 + .../3.1.x/parameter-explode-false/index.ts | 3 + .../3.1.x/parameter-explode-false/sdk.gen.ts | 32 + .../parameter-explode-false/types.gen.ts | 21 + .../generated/3.1.x/parameter-tuple/index.ts | 2 + .../3.1.x/parameter-tuple/types.gen.ts | 26 + .../@hey-api/schemas/default/schemas.gen.ts | 1981 ++++++++++++++++ .../@hey-api/sdk/default/client.gen.ts | 18 + .../plugins/@hey-api/sdk/default/index.ts | 3 + .../plugins/@hey-api/sdk/default/sdk.gen.ts | 409 ++++ .../plugins/@hey-api/sdk/default/types.gen.ts | 2033 +++++++++++++++++ .../@hey-api/sdk/throwOnError/client.gen.ts | 19 + .../@hey-api/sdk/throwOnError/index.ts | 3 + .../@hey-api/sdk/throwOnError/sdk.gen.ts | 409 ++++ .../@hey-api/sdk/throwOnError/types.gen.ts | 2033 +++++++++++++++++ .../transformers/type-format/client.gen.ts | 16 + .../transformers/type-format/index.ts | 3 + .../transformers/type-format/sdk.gen.ts | 32 + .../type-format/transformers.gen.ts | 13 + .../transformers/type-format/types.gen.ts | 32 + .../transformers/type-format/zod.gen.ts | 15 + .../read-write-only-custom-name/client.gen.ts | 16 + .../read-write-only-custom-name/index.ts | 2 + .../read-write-only-custom-name/types.gen.ts | 95 + .../read-write-only-ignore/client.gen.ts | 16 + .../read-write-only-ignore/index.ts | 2 + .../read-write-only-ignore/types.gen.ts | 85 + .../angular-query-experimental.gen.ts | 1128 +++++++++ .../asClass/client.gen.ts | 18 + .../asClass/index.ts | 3 + .../asClass/sdk.gen.ts | 506 ++++ .../asClass/types.gen.ts | 2033 +++++++++++++++++ .../angular-query-experimental.gen.ts | 1129 +++++++++ .../axios/client.gen.ts | 18 + .../angular-query-experimental/axios/index.ts | 3 + .../axios/sdk.gen.ts | 410 ++++ .../axios/types.gen.ts | 2033 +++++++++++++++++ .../angular-query-experimental.gen.ts | 1128 +++++++++ .../fetch/client.gen.ts | 18 + .../angular-query-experimental/fetch/index.ts | 3 + .../fetch/sdk.gen.ts | 409 ++++ .../fetch/types.gen.ts | 2033 +++++++++++++++++ .../asClass/@tanstack/react-query.gen.ts | 1128 +++++++++ .../react-query/asClass/client.gen.ts | 18 + .../@tanstack/react-query/asClass/index.ts | 3 + .../@tanstack/react-query/asClass/sdk.gen.ts | 506 ++++ .../react-query/asClass/types.gen.ts | 2033 +++++++++++++++++ .../axios/@tanstack/react-query.gen.ts | 1129 +++++++++ .../@tanstack/react-query/axios/client.gen.ts | 18 + .../@tanstack/react-query/axios/index.ts | 3 + .../@tanstack/react-query/axios/sdk.gen.ts | 410 ++++ .../@tanstack/react-query/axios/types.gen.ts | 2033 +++++++++++++++++ .../fetch/@tanstack/react-query.gen.ts | 1128 +++++++++ .../@tanstack/react-query/fetch/client.gen.ts | 18 + .../@tanstack/react-query/fetch/index.ts | 3 + .../@tanstack/react-query/fetch/sdk.gen.ts | 409 ++++ .../@tanstack/react-query/fetch/types.gen.ts | 2033 +++++++++++++++++ .../asClass/@tanstack/solid-query.gen.ts | 1128 +++++++++ .../solid-query/asClass/client.gen.ts | 18 + .../@tanstack/solid-query/asClass/index.ts | 3 + .../@tanstack/solid-query/asClass/sdk.gen.ts | 506 ++++ .../solid-query/asClass/types.gen.ts | 2033 +++++++++++++++++ .../axios/@tanstack/solid-query.gen.ts | 1129 +++++++++ .../@tanstack/solid-query/axios/client.gen.ts | 18 + .../@tanstack/solid-query/axios/index.ts | 3 + .../@tanstack/solid-query/axios/sdk.gen.ts | 410 ++++ .../@tanstack/solid-query/axios/types.gen.ts | 2033 +++++++++++++++++ .../fetch/@tanstack/solid-query.gen.ts | 1128 +++++++++ .../@tanstack/solid-query/fetch/client.gen.ts | 18 + .../@tanstack/solid-query/fetch/index.ts | 3 + .../@tanstack/solid-query/fetch/sdk.gen.ts | 409 ++++ .../@tanstack/solid-query/fetch/types.gen.ts | 2033 +++++++++++++++++ .../asClass/@tanstack/svelte-query.gen.ts | 1128 +++++++++ .../svelte-query/asClass/client.gen.ts | 18 + .../@tanstack/svelte-query/asClass/index.ts | 3 + .../@tanstack/svelte-query/asClass/sdk.gen.ts | 506 ++++ .../svelte-query/asClass/types.gen.ts | 2033 +++++++++++++++++ .../axios/@tanstack/svelte-query.gen.ts | 1129 +++++++++ .../svelte-query/axios/client.gen.ts | 18 + .../@tanstack/svelte-query/axios/index.ts | 3 + .../@tanstack/svelte-query/axios/sdk.gen.ts | 410 ++++ .../@tanstack/svelte-query/axios/types.gen.ts | 2033 +++++++++++++++++ .../fetch/@tanstack/svelte-query.gen.ts | 1128 +++++++++ .../svelte-query/fetch/client.gen.ts | 18 + .../@tanstack/svelte-query/fetch/index.ts | 3 + .../@tanstack/svelte-query/fetch/sdk.gen.ts | 409 ++++ .../@tanstack/svelte-query/fetch/types.gen.ts | 2033 +++++++++++++++++ .../asClass/@tanstack/vue-query.gen.ts | 1128 +++++++++ .../@tanstack/vue-query/asClass/client.gen.ts | 18 + .../@tanstack/vue-query/asClass/index.ts | 3 + .../@tanstack/vue-query/asClass/sdk.gen.ts | 506 ++++ .../@tanstack/vue-query/asClass/types.gen.ts | 2033 +++++++++++++++++ .../axios/@tanstack/vue-query.gen.ts | 1129 +++++++++ .../@tanstack/vue-query/axios/client.gen.ts | 18 + .../@tanstack/vue-query/axios/index.ts | 3 + .../@tanstack/vue-query/axios/sdk.gen.ts | 410 ++++ .../@tanstack/vue-query/axios/types.gen.ts | 2033 +++++++++++++++++ .../fetch/@tanstack/vue-query.gen.ts | 1128 +++++++++ .../@tanstack/vue-query/fetch/client.gen.ts | 18 + .../@tanstack/vue-query/fetch/index.ts | 3 + .../@tanstack/vue-query/fetch/sdk.gen.ts | 409 ++++ .../@tanstack/vue-query/fetch/types.gen.ts | 2033 +++++++++++++++++ .../plugins/fastify/default/fastify.gen.ts | 130 ++ .../3.1.x/plugins/fastify/default/index.ts | 2 + .../plugins/fastify/default/types.gen.ts | 2033 +++++++++++++++++ .../plugins/my-plugin/default/client.gen.ts | 18 + .../3.1.x/plugins/my-plugin/default/index.ts | 2 + .../plugins/my-plugin/default/types.gen.ts | 2033 +++++++++++++++++ .../3.1.x/plugins/zod/default/zod.gen.ts | 754 ++++++ .../3.1.x/read-write-only/client.gen.ts | 16 + .../generated/3.1.x/read-write-only/index.ts | 2 + .../3.1.x/read-write-only/types.gen.ts | 95 + .../test/generated/3.1.x/ref-type/index.ts | 2 + .../generated/3.1.x/ref-type/types.gen.ts | 31 + .../3.1.x/required-all-of-ref/index.ts | 2 + .../3.1.x/required-all-of-ref/types.gen.ts | 16 + .../3.1.x/required-any-of-ref/index.ts | 2 + .../3.1.x/required-any-of-ref/types.gen.ts | 14 + .../3.1.x/required-one-of-ref/index.ts | 2 + .../3.1.x/required-one-of-ref/types.gen.ts | 14 + .../generated/3.1.x/schema-const/index.ts | 2 + .../generated/3.1.x/schema-const/types.gen.ts | 23 + .../generated/3.1.x/schema-const/zod.gen.ts | 19 + .../3.1.x/security-api-key/client.gen.ts | 16 + .../generated/3.1.x/security-api-key/index.ts | 3 + .../3.1.x/security-api-key/sdk.gen.ts | 47 + .../3.1.x/security-api-key/types.gen.ts | 33 + .../3.1.x/security-false/client.gen.ts | 16 + .../generated/3.1.x/security-false/index.ts | 3 + .../generated/3.1.x/security-false/sdk.gen.ts | 26 + .../3.1.x/security-false/types.gen.ts | 19 + .../3.1.x/security-http-bearer/client.gen.ts | 16 + .../3.1.x/security-http-bearer/index.ts | 3 + .../3.1.x/security-http-bearer/sdk.gen.ts | 32 + .../3.1.x/security-http-bearer/types.gen.ts | 19 + .../3.1.x/security-oauth2/client.gen.ts | 16 + .../generated/3.1.x/security-oauth2/index.ts | 3 + .../3.1.x/security-oauth2/sdk.gen.ts | 32 + .../3.1.x/security-oauth2/types.gen.ts | 19 + .../security-open-id-connect/client.gen.ts | 16 + .../3.1.x/security-open-id-connect/index.ts | 3 + .../3.1.x/security-open-id-connect/sdk.gen.ts | 32 + .../security-open-id-connect/types.gen.ts | 19 + .../generated/3.1.x/servers/client.gen.ts | 18 + .../test/generated/3.1.x/servers/index.ts | 2 + .../test/generated/3.1.x/servers/types.gen.ts | 21 + .../3.1.x/transformers-all-of/client.gen.ts | 16 + .../3.1.x/transformers-all-of/index.ts | 2 + .../transformers-all-of/transformers.gen.ts | 35 + .../3.1.x/transformers-all-of/types.gen.ts | 46 + .../transformers-any-of-null/client.gen.ts | 16 + .../3.1.x/transformers-any-of-null/index.ts | 2 + .../transformers.gen.ts | 40 + .../transformers-any-of-null/types.gen.ts | 53 + .../3.1.x/transformers-array/client.gen.ts | 16 + .../3.1.x/transformers-array/index.ts | 2 + .../transformers-array/transformers.gen.ts | 11 + .../3.1.x/transformers-array/types.gen.ts | 25 + .../generated/3.1.x/type-invalid/index.ts | 2 + .../generated/3.1.x/type-invalid/types.gen.ts | 7 + .../generated/3.1.x/validators/zod.gen.ts | 23 + .../3.1.x/zod-bigint-min-max/zod.gen.ts | 7 + .../3.1.x/zod-circular-ref-2/zod.gen.ts | 16 + .../3.1.x/zod-circular-ref/zod.gen.ts | 19 + .../3.1.x/zod-union-merge/zod.gen.ts | 16 + .../test/generated/perf/client.gen.ts | 18 + .../test/generated/perf/index.ts | 3 + .../test/generated/perf/sdk.gen.ts | 409 ++++ .../test/generated/perf/types.gen.ts | 2033 +++++++++++++++++ .../test/generated/v2/core/ApiError.ts | 21 + .../generated/v2/core/ApiRequestOptions.ts | 21 + .../test/generated/v2/core/ApiResult.ts | 7 + .../generated/v2/core/CancelablePromise.ts | 126 + .../test/generated/v2/core/OpenAPI.ts | 56 + .../test/generated/v2/core/request.ts | 350 +++ .../test/generated/v2/index.ts | 6 + .../test/generated/v2/schemas.gen.ts | 669 ++++++ .../test/generated/v2/sdk.gen.ts | 658 ++++++ .../test/generated/v2/types.gen.ts | 762 ++++++ .../generated/v3-schemas-form/schemas.gen.ts | 1834 +++++++++++++++ .../generated/v3-schemas-json/schemas.gen.ts | 1994 ++++++++++++++++ .../generated/v3-schemas-name/schemas.gen.ts | 1994 ++++++++++++++++ .../generated/v3-types-PascalCase/index.ts | 2 + .../v3-types-PascalCase/types.gen.ts | 1970 ++++++++++++++++ .../test/generated/v3/core/ApiError.ts | 21 + .../generated/v3/core/ApiRequestOptions.ts | 21 + .../test/generated/v3/core/ApiResult.ts | 7 + .../generated/v3/core/CancelablePromise.ts | 126 + .../test/generated/v3/core/OpenAPI.ts | 56 + .../test/generated/v3/core/request.ts | 350 +++ .../test/generated/v3/index.ts | 6 + .../test/generated/v3/sdk.gen.ts | 913 ++++++++ .../test/generated/v3/types.gen.ts | 1537 +++++++++++++ .../generated/v3_angular/core/ApiError.ts | 21 + .../v3_angular/core/ApiRequestOptions.ts | 21 + .../generated/v3_angular/core/ApiResult.ts | 7 + .../test/generated/v3_angular/core/OpenAPI.ts | 55 + .../test/generated/v3_angular/core/request.ts | 337 +++ .../test/generated/v3_angular/index.ts | 5 + .../test/generated/v3_angular/sdk.gen.ts | 1030 +++++++++ .../test/generated/v3_angular/types.gen.ts | 1414 ++++++++++++ .../v3_angular_transform/core/ApiError.ts | 21 + .../core/ApiRequestOptions.ts | 21 + .../v3_angular_transform/core/ApiResult.ts | 7 + .../v3_angular_transform/core/OpenAPI.ts | 55 + .../v3_angular_transform/core/request.ts | 337 +++ .../generated/v3_angular_transform/index.ts | 5 + .../generated/v3_angular_transform/sdk.gen.ts | 87 + .../v3_angular_transform/types.gen.ts | 106 + .../core/ApiError.ts | 21 + .../core/ApiRequestOptions.ts | 21 + .../core/ApiResult.ts | 7 + .../v3_angular_tree_shakeable/core/OpenAPI.ts | 55 + .../v3_angular_tree_shakeable/core/request.ts | 337 +++ .../v3_angular_tree_shakeable/index.ts | 5 + .../v3_angular_tree_shakeable/sdk.gen.ts | 801 +++++++ .../v3_angular_tree_shakeable/types.gen.ts | 1414 ++++++++++++ .../core/ApiError.ts | 21 + .../core/ApiRequestOptions.ts | 21 + .../core/ApiResult.ts | 7 + .../core/OpenAPI.ts | 55 + .../core/request.ts | 337 +++ .../index.ts | 5 + .../sdk.gen.ts | 79 + .../types.gen.ts | 106 + .../test/generated/v3_axios/core/ApiError.ts | 21 + .../v3_axios/core/ApiRequestOptions.ts | 21 + .../test/generated/v3_axios/core/ApiResult.ts | 7 + .../v3_axios/core/CancelablePromise.ts | 126 + .../test/generated/v3_axios/core/OpenAPI.ts | 57 + .../test/generated/v3_axios/core/request.ts | 347 +++ .../test/generated/v3_axios/index.ts | 6 + .../test/generated/v3_axios/sdk.gen.ts | 913 ++++++++ .../test/generated/v3_axios/types.gen.ts | 1537 +++++++++++++ .../v3_axios_transform/core/ApiError.ts | 21 + .../core/ApiRequestOptions.ts | 21 + .../v3_axios_transform/core/ApiResult.ts | 7 + .../core/CancelablePromise.ts | 126 + .../v3_axios_transform/core/OpenAPI.ts | 57 + .../v3_axios_transform/core/request.ts | 347 +++ .../generated/v3_axios_transform/index.ts | 6 + .../generated/v3_axios_transform/sdk.gen.ts | 80 + .../generated/v3_axios_transform/types.gen.ts | 106 + .../test/generated/v3_client/ApiClient.ts | 101 + .../test/generated/v3_client/core/ApiError.ts | 21 + .../v3_client/core/ApiRequestOptions.ts | 21 + .../generated/v3_client/core/ApiResult.ts | 7 + .../v3_client/core/BaseHttpRequest.ts | 10 + .../v3_client/core/CancelablePromise.ts | 126 + .../v3_client/core/FetchHttpRequest.ts | 22 + .../test/generated/v3_client/core/OpenAPI.ts | 56 + .../test/generated/v3_client/core/request.ts | 350 +++ .../test/generated/v3_client/index.ts | 8 + .../test/generated/v3_client/sdk.gen.ts | 958 ++++++++ .../test/generated/v3_client/types.gen.ts | 1414 ++++++++++++ .../v3_client_transform/ApiClient.ts | 35 + .../v3_client_transform/core/ApiError.ts | 21 + .../core/ApiRequestOptions.ts | 21 + .../v3_client_transform/core/ApiResult.ts | 7 + .../core/BaseHttpRequest.ts | 10 + .../core/CancelablePromise.ts | 126 + .../core/FetchHttpRequest.ts | 22 + .../v3_client_transform/core/OpenAPI.ts | 56 + .../v3_client_transform/core/request.ts | 350 +++ .../generated/v3_client_transform/index.ts | 8 + .../generated/v3_client_transform/sdk.gen.ts | 81 + .../v3_client_transform/types.gen.ts | 106 + .../test/generated/v3_date/index.ts | 2 + .../test/generated/v3_date/types.gen.ts | 967 ++++++++ .../v3_enums_typescript/core/ApiError.ts | 21 + .../core/ApiRequestOptions.ts | 21 + .../v3_enums_typescript/core/ApiResult.ts | 7 + .../core/CancelablePromise.ts | 126 + .../v3_enums_typescript/core/OpenAPI.ts | 56 + .../v3_enums_typescript/core/request.ts | 350 +++ .../generated/v3_enums_typescript/index.ts | 6 + .../generated/v3_enums_typescript/sdk.gen.ts | 913 ++++++++ .../v3_enums_typescript/types.gen.ts | 1493 ++++++++++++ .../core/ApiError.ts | 21 + .../core/ApiRequestOptions.ts | 21 + .../core/ApiResult.ts | 7 + .../core/CancelablePromise.ts | 126 + .../core/OpenAPI.ts | 56 + .../core/request.ts | 350 +++ .../v3_enums_typescript_namespace/index.ts | 6 + .../v3_enums_typescript_namespace/sdk.gen.ts | 913 ++++++++ .../types.gen.ts | 1524 ++++++++++++ .../core/ApiError.ts | 21 + .../core/ApiRequestOptions.ts | 21 + .../core/ApiResult.ts | 7 + .../core/CancelablePromise.ts | 126 + .../v3_legacy_positional_args/core/OpenAPI.ts | 56 + .../v3_legacy_positional_args/core/request.ts | 350 +++ .../v3_legacy_positional_args/index.ts | 6 + .../v3_legacy_positional_args/sdk.gen.ts | 85 + .../v3_legacy_positional_args/types.gen.ts | 102 + .../test/generated/v3_no_index/client.gen.ts | 18 + .../test/generated/v3_no_index/types.gen.ts | 1970 ++++++++++++++++ .../test/generated/v3_node/core/ApiError.ts | 21 + .../v3_node/core/ApiRequestOptions.ts | 21 + .../test/generated/v3_node/core/ApiResult.ts | 7 + .../v3_node/core/CancelablePromise.ts | 126 + .../test/generated/v3_node/core/OpenAPI.ts | 57 + .../test/generated/v3_node/core/request.ts | 350 +++ .../test/generated/v3_node/index.ts | 6 + .../test/generated/v3_node/sdk.gen.ts | 913 ++++++++ .../test/generated/v3_node/types.gen.ts | 1537 +++++++++++++ .../v3_node_transform/core/ApiError.ts | 21 + .../core/ApiRequestOptions.ts | 21 + .../v3_node_transform/core/ApiResult.ts | 7 + .../core/CancelablePromise.ts | 126 + .../v3_node_transform/core/OpenAPI.ts | 57 + .../v3_node_transform/core/request.ts | 350 +++ .../test/generated/v3_node_transform/index.ts | 6 + .../generated/v3_node_transform/sdk.gen.ts | 80 + .../generated/v3_node_transform/types.gen.ts | 106 + .../generated/v3_options/core/ApiError.ts | 21 + .../v3_options/core/ApiRequestOptions.ts | 21 + .../generated/v3_options/core/ApiResult.ts | 7 + .../v3_options/core/CancelablePromise.ts | 126 + .../test/generated/v3_options/core/OpenAPI.ts | 56 + .../test/generated/v3_options/core/request.ts | 350 +++ .../test/generated/v3_options/index.ts | 6 + .../test/generated/v3_options/sdk.gen.ts | 84 + .../test/generated/v3_options/types.gen.ts | 102 + .../generated/v3_services_filter/index.ts | 3 + .../generated/v3_services_filter/sdk.gen.ts | 75 + .../generated/v3_services_filter/types.gen.ts | 1090 +++++++++ .../test/generated/v3_services_name/index.ts | 3 + .../generated/v3_services_name/sdk.gen.ts | 222 ++ .../generated/v3_services_name/types.gen.ts | 1195 ++++++++++ .../generated/v3_transform/core/ApiError.ts | 21 + .../v3_transform/core/ApiRequestOptions.ts | 21 + .../generated/v3_transform/core/ApiResult.ts | 7 + .../v3_transform/core/CancelablePromise.ts | 126 + .../generated/v3_transform/core/OpenAPI.ts | 56 + .../generated/v3_transform/core/request.ts | 350 +++ .../test/generated/v3_transform/index.ts | 6 + .../test/generated/v3_transform/sdk.gen.ts | 80 + .../test/generated/v3_transform/types.gen.ts | 106 + .../test/generated/v3_tree_shakeable/index.ts | 3 + .../generated/v3_tree_shakeable/sdk.gen.ts | 799 +++++++ .../generated/v3_tree_shakeable/types.gen.ts | 1537 +++++++++++++ .../test/generated/v3_types/index.ts | 2 + .../test/generated/v3_types/types.gen.ts | 1970 ++++++++++++++++ .../test/generated/v3_types_no_tree/index.ts | 2 + .../generated/v3_types_no_tree/types.gen.ts | 1970 ++++++++++++++++ .../test/generated/v3_xhr/core/ApiError.ts | 21 + .../v3_xhr/core/ApiRequestOptions.ts | 21 + .../test/generated/v3_xhr/core/ApiResult.ts | 7 + .../v3_xhr/core/CancelablePromise.ts | 126 + .../test/generated/v3_xhr/core/OpenAPI.ts | 56 + .../test/generated/v3_xhr/core/request.ts | 350 +++ .../test/generated/v3_xhr/index.ts | 6 + .../test/generated/v3_xhr/sdk.gen.ts | 913 ++++++++ .../test/generated/v3_xhr/types.gen.ts | 1537 +++++++++++++ .../v3_xhr_transform/core/ApiError.ts | 21 + .../core/ApiRequestOptions.ts | 21 + .../v3_xhr_transform/core/ApiResult.ts | 7 + .../core/CancelablePromise.ts | 126 + .../v3_xhr_transform/core/OpenAPI.ts | 56 + .../v3_xhr_transform/core/request.ts | 350 +++ .../test/generated/v3_xhr_transform/index.ts | 6 + .../generated/v3_xhr_transform/sdk.gen.ts | 80 + .../generated/v3_xhr_transform/types.gen.ts | 106 + 1043 files changed, 349366 insertions(+), 2 deletions(-) create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-PascalCase/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-PascalCase/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-camelCase/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-camelCase/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-preserve/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-preserve/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-snake_case/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-snake_case/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-PascalCase/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-PascalCase/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-camelCase/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-camelCase/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-preserve/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-preserve/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-snake_case/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-snake_case/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/exclude-deprecated/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/exclude-deprecated/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/form-data/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/form-data/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/form-data/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/form-data/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/zod.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/fastify.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/zod/default/zod.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-basic/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-basic/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-basic/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-basic/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-false/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-false/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-false/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-false/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/servers-host/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/servers-host/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/servers-host/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/servers/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/servers/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/servers/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-false/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-false/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-true/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-true/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-undefined/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-undefined/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/array-items-one-of-length-1/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/array-items-one-of-length-1/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/case-PascalCase/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/case-PascalCase/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/case-camelCase/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/case-camelCase/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/case-snake_case/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/case-snake_case/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/case/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/case/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/components-request-bodies/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/components-request-bodies/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/content-binary/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/content-binary/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/discriminator-all-of/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/discriminator-all-of/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/discriminator-any-of/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/discriminator-any-of/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/discriminator-mapped-many/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/discriminator-mapped-many/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/discriminator-one-of/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/discriminator-one-of/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-escape/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-escape/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-javascript/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-javascript/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript-namespace/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript-namespace/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-inline/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-inline/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-PascalCase/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-PascalCase/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-camelCase/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-camelCase/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-preserve/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-preserve/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-snake_case/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-snake_case/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-PascalCase/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-PascalCase/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-camelCase/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-camelCase/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-preserve/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-preserve/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-snake_case/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-snake_case/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-null/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-null/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-null/zod.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/exclude-deprecated/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/exclude-deprecated/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/@tanstack/react-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/operation-204/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/operation-204/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/zod.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/fastify.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/zod/default/zod.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-false/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-false/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-false/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-false/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/servers/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/servers/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/servers/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/transformers.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/transformers.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/transformers.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/type-invalid/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/type-invalid/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/validators/zod.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-false/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-false/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-true/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-true/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-undefined/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-undefined/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/array-items-one-of-length-1/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/array-items-one-of-length-1/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/case-PascalCase/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/case-PascalCase/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/case-camelCase/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/case-camelCase/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/case-snake_case/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/case-snake_case/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/case/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/case/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.cjs create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.d.cts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.d.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.cjs create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.d.cts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.d.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.cjs create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.d.cts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.d.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client/index.d.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client/index.js create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.cjs create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.d.cts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.d.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/client.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/plugin.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/types.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/utils.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/components-request-bodies/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/components-request-bodies/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/const/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/const/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/content-binary/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/content-binary/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/discriminator-all-of/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/discriminator-all-of/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/discriminator-any-of/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/discriminator-any-of/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/discriminator-mapped-many/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/discriminator-mapped-many/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/discriminator-one-of/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/discriminator-one-of/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/duplicate-null/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/duplicate-null/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-escape/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-escape/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-javascript/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-javascript/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript-namespace/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript-namespace/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-inline/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-inline/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-PascalCase/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-PascalCase/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-camelCase/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-camelCase/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-preserve/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-preserve/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-snake_case/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-snake_case/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-PascalCase/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-PascalCase/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-camelCase/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-camelCase/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-preserve/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-preserve/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-snake_case/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-snake_case/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-null/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-null/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-null/zod.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/exclude-deprecated/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/exclude-deprecated/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/@tanstack/react-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/object-properties-all-of/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/object-properties-all-of/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/object-properties-any-of/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/object-properties-any-of/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/object-properties-one-of/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/object-properties-one-of/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/operation-204/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/operation-204/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/@tanstack/react-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/parameter-tuple/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/parameter-tuple/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/schemas/default/schemas.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/zod.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/fastify.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/zod/default/zod.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/ref-type/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/ref-type/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/required-all-of-ref/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/required-all-of-ref/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/required-any-of-ref/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/required-any-of-ref/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/required-one-of-ref/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/required-one-of-ref/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/schema-const/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/schema-const/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/schema-const/zod.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-false/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-false/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-false/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-false/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/servers/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/servers/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/servers/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/transformers.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/transformers.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/transformers.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/type-invalid/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/type-invalid/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/validators/zod.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/zod-bigint-min-max/zod.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/zod-circular-ref-2/zod.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/zod-circular-ref/zod.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/zod-union-merge/zod.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/perf/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/perf/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/perf/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/perf/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v2/core/ApiError.ts create mode 100644 packages/openapi-ts-tests/test/generated/v2/core/ApiRequestOptions.ts create mode 100644 packages/openapi-ts-tests/test/generated/v2/core/ApiResult.ts create mode 100644 packages/openapi-ts-tests/test/generated/v2/core/CancelablePromise.ts create mode 100644 packages/openapi-ts-tests/test/generated/v2/core/OpenAPI.ts create mode 100644 packages/openapi-ts-tests/test/generated/v2/core/request.ts create mode 100644 packages/openapi-ts-tests/test/generated/v2/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v2/schemas.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v2/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v2/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3-schemas-form/schemas.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3-schemas-json/schemas.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3-schemas-name/schemas.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3-types-PascalCase/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3-types-PascalCase/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3/core/ApiError.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3/core/ApiRequestOptions.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3/core/ApiResult.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3/core/CancelablePromise.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3/core/OpenAPI.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3/core/request.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular/core/ApiError.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular/core/ApiRequestOptions.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular/core/ApiResult.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular/core/OpenAPI.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular/core/request.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiError.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiRequestOptions.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiResult.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_transform/core/OpenAPI.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_transform/core/request.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_transform/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_transform/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_transform/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiError.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiRequestOptions.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiResult.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/OpenAPI.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/request.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiError.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiRequestOptions.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiResult.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/OpenAPI.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/request.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_axios/core/ApiError.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_axios/core/ApiRequestOptions.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_axios/core/ApiResult.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_axios/core/CancelablePromise.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_axios/core/OpenAPI.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_axios/core/request.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_axios/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_axios/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_axios/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiError.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiRequestOptions.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiResult.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_axios_transform/core/CancelablePromise.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_axios_transform/core/OpenAPI.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_axios_transform/core/request.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_axios_transform/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_axios_transform/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_axios_transform/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client/ApiClient.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client/core/ApiError.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client/core/ApiRequestOptions.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client/core/ApiResult.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client/core/BaseHttpRequest.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client/core/CancelablePromise.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client/core/FetchHttpRequest.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client/core/OpenAPI.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client/core/request.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/ApiClient.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiError.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiRequestOptions.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiResult.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/core/BaseHttpRequest.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/core/CancelablePromise.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/core/FetchHttpRequest.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/core/OpenAPI.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/core/request.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_date/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_date/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiError.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiRequestOptions.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiResult.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/CancelablePromise.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/OpenAPI.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/request.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiError.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiRequestOptions.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiResult.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/CancelablePromise.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/OpenAPI.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/request.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiError.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiRequestOptions.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiResult.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/CancelablePromise.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/OpenAPI.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/request.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_no_index/client.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_no_index/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_node/core/ApiError.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_node/core/ApiRequestOptions.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_node/core/ApiResult.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_node/core/CancelablePromise.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_node/core/OpenAPI.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_node/core/request.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_node/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_node/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_node/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiError.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiRequestOptions.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiResult.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_node_transform/core/CancelablePromise.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_node_transform/core/OpenAPI.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_node_transform/core/request.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_node_transform/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_node_transform/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_node_transform/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_options/core/ApiError.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_options/core/ApiRequestOptions.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_options/core/ApiResult.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_options/core/CancelablePromise.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_options/core/OpenAPI.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_options/core/request.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_options/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_options/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_options/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_services_filter/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_services_filter/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_services_filter/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_services_name/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_services_name/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_services_name/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_transform/core/ApiError.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_transform/core/ApiRequestOptions.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_transform/core/ApiResult.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_transform/core/CancelablePromise.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_transform/core/OpenAPI.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_transform/core/request.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_transform/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_transform/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_transform/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_tree_shakeable/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_tree_shakeable/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_tree_shakeable/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_types/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_types/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_types_no_tree/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_types_no_tree/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiError.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiRequestOptions.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiResult.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr/core/CancelablePromise.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr/core/OpenAPI.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr/core/request.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr/types.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiError.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiRequestOptions.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiResult.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/CancelablePromise.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/OpenAPI.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/request.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr_transform/index.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr_transform/sdk.gen.ts create mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr_transform/types.gen.ts diff --git a/examples/openapi-ts-sample/src/App.tsx b/examples/openapi-ts-sample/src/App.tsx index 30976530a..9c8b41643 100644 --- a/examples/openapi-ts-sample/src/App.tsx +++ b/examples/openapi-ts-sample/src/App.tsx @@ -15,8 +15,6 @@ function App() { const onClick = async () => { const response = await getPetById({ path: { - // @ts-expect-error - foo: 3, petId: 3, }, }); diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/sdk.gen.ts new file mode 100644 index 000000000..d305a220c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/sdk.gen.ts @@ -0,0 +1,31 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { PostFooData, PostFooResponse } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const postFoo = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + bodySerializer: null, + url: '/foo', + ...options, + headers: { + 'Content-Type': 'text/plain', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/types.gen.ts new file mode 100644 index 000000000..40b2576de --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/types.gen.ts @@ -0,0 +1,21 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type PostFooData = { + body: string; + path?: never; + query?: never; + url: '/foo'; +}; + +export type PostFooResponses = { + /** + * OK + */ + 200: string; +}; + +export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; + +export type ClientOptions = { + baseUrl: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-PascalCase/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-PascalCase/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-PascalCase/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-PascalCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-PascalCase/types.gen.ts new file mode 100644 index 000000000..0e81c5237 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-PascalCase/types.gen.ts @@ -0,0 +1,47 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _110 = '1-10' | '11-20'; + +export const _110 = { + 110: '1-10', + 1120: '11-20' +} as const; + +export type MyFoo = 'myFoo' | 'myBar'; + +export const MyFoo = { + MyFoo: 'myFoo', + MyBar: 'myBar' +} as const; + +export type MyFoo2 = 'MyFoo' | 'MyBar'; + +export const MyFoo2 = { + MyFoo: 'MyFoo', + MyBar: 'MyBar' +} as const; + +export type Foo = 'foo' | 'bar' | '' | true | false; + +export const Foo = { + Foo: 'foo', + Bar: 'bar', + '': '', + True: true, + False: false +} as const; + +export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; + +export const Numbers = { + 100: 100, + 200: 200, + 300: 300, + '-100': -100, + '-200': -200, + '-300': -300 +} as const; + +export type ClientOptions = { + baseUrl: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts new file mode 100644 index 000000000..43dcbcf0f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts @@ -0,0 +1,47 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _110 = '1-10' | '11-20'; + +export const _110 = { + '1_10': '1-10', + '11_20': '11-20' +} as const; + +export type MyFoo = 'myFoo' | 'myBar'; + +export const MyFoo = { + MY_FOO: 'myFoo', + MY_BAR: 'myBar' +} as const; + +export type MyFoo2 = 'MyFoo' | 'MyBar'; + +export const MyFoo2 = { + MY_FOO: 'MyFoo', + MY_BAR: 'MyBar' +} as const; + +export type Foo = 'foo' | 'bar' | '' | true | false; + +export const Foo = { + FOO: 'foo', + BAR: 'bar', + '': '', + TRUE: true, + FALSE: false +} as const; + +export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; + +export const Numbers = { + 100: 100, + 200: 200, + 300: 300, + '-100': -100, + '-200': -200, + '-300': -300 +} as const; + +export type ClientOptions = { + baseUrl: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-camelCase/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-camelCase/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-camelCase/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-camelCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-camelCase/types.gen.ts new file mode 100644 index 000000000..6ddbb66e2 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-camelCase/types.gen.ts @@ -0,0 +1,47 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _110 = '1-10' | '11-20'; + +export const _110 = { + 110: '1-10', + 1120: '11-20' +} as const; + +export type MyFoo = 'myFoo' | 'myBar'; + +export const MyFoo = { + myFoo: 'myFoo', + myBar: 'myBar' +} as const; + +export type MyFoo2 = 'MyFoo' | 'MyBar'; + +export const MyFoo2 = { + myFoo: 'MyFoo', + myBar: 'MyBar' +} as const; + +export type Foo = 'foo' | 'bar' | '' | true | false; + +export const Foo = { + foo: 'foo', + bar: 'bar', + '': '', + true: true, + false: false +} as const; + +export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; + +export const Numbers = { + 100: 100, + 200: 200, + 300: 300, + '-100': -100, + '-200': -200, + '-300': -300 +} as const; + +export type ClientOptions = { + baseUrl: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-preserve/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-preserve/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-preserve/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-preserve/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-preserve/types.gen.ts new file mode 100644 index 000000000..26c60818f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-preserve/types.gen.ts @@ -0,0 +1,47 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _110 = '1-10' | '11-20'; + +export const _110 = { + '1-10': '1-10', + '11-20': '11-20' +} as const; + +export type MyFoo = 'myFoo' | 'myBar'; + +export const MyFoo = { + myFoo: 'myFoo', + myBar: 'myBar' +} as const; + +export type MyFoo2 = 'MyFoo' | 'MyBar'; + +export const MyFoo2 = { + MyFoo: 'MyFoo', + MyBar: 'MyBar' +} as const; + +export type Foo = 'foo' | 'bar' | '' | true | false; + +export const Foo = { + foo: 'foo', + bar: 'bar', + '': '', + true: true, + false: false +} as const; + +export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; + +export const Numbers = { + 100: 100, + 200: 200, + 300: 300, + '-100': -100, + '-200': -200, + '-300': -300 +} as const; + +export type ClientOptions = { + baseUrl: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-snake_case/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-snake_case/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-snake_case/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-snake_case/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-snake_case/types.gen.ts new file mode 100644 index 000000000..57379cddf --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-snake_case/types.gen.ts @@ -0,0 +1,47 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _110 = '1-10' | '11-20'; + +export const _110 = { + '1_10': '1-10', + '11_20': '11-20' +} as const; + +export type MyFoo = 'myFoo' | 'myBar'; + +export const MyFoo = { + my_foo: 'myFoo', + my_bar: 'myBar' +} as const; + +export type MyFoo2 = 'MyFoo' | 'MyBar'; + +export const MyFoo2 = { + my_foo: 'MyFoo', + my_bar: 'MyBar' +} as const; + +export type Foo = 'foo' | 'bar' | '' | true | false; + +export const Foo = { + foo: 'foo', + bar: 'bar', + '': '', + true: true, + false: false +} as const; + +export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; + +export const Numbers = { + 100: 100, + 200: 200, + 300: 300, + '-100': -100, + '-200': -200, + '-300': -300 +} as const; + +export type ClientOptions = { + baseUrl: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-PascalCase/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-PascalCase/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-PascalCase/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-PascalCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-PascalCase/types.gen.ts new file mode 100644 index 000000000..0383a8002 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-PascalCase/types.gen.ts @@ -0,0 +1,31 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export enum _110 { + _110 = '1-10', + _1120 = '11-20' +} + +export enum MyFoo { + MyFoo = 'myFoo', + MyBar = 'myBar' +} + +export enum MyFoo2 { + MyFoo = 'MyFoo', + MyBar = 'MyBar' +} + +export type Foo = 'foo' | 'bar' | '' | true | false; + +export enum Numbers { + _100 = 100, + _200 = 200, + _300 = 300, + '_-100' = -100, + '_-200' = -200, + '_-300' = -300 +} + +export type ClientOptions = { + baseUrl: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts new file mode 100644 index 000000000..57e4c00b3 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts @@ -0,0 +1,31 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export enum _110 { + '1_10' = '1-10', + '11_20' = '11-20' +} + +export enum MyFoo { + MY_FOO = 'myFoo', + MY_BAR = 'myBar' +} + +export enum MyFoo2 { + MY_FOO = 'MyFoo', + MY_BAR = 'MyBar' +} + +export type Foo = 'foo' | 'bar' | '' | true | false; + +export enum Numbers { + _100 = 100, + _200 = 200, + _300 = 300, + '_-100' = -100, + '_-200' = -200, + '_-300' = -300 +} + +export type ClientOptions = { + baseUrl: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-camelCase/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-camelCase/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-camelCase/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-camelCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-camelCase/types.gen.ts new file mode 100644 index 000000000..331983c35 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-camelCase/types.gen.ts @@ -0,0 +1,31 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export enum _110 { + _110 = '1-10', + _1120 = '11-20' +} + +export enum MyFoo { + myFoo = 'myFoo', + myBar = 'myBar' +} + +export enum MyFoo2 { + myFoo = 'MyFoo', + myBar = 'MyBar' +} + +export type Foo = 'foo' | 'bar' | '' | true | false; + +export enum Numbers { + _100 = 100, + _200 = 200, + _300 = 300, + '_-100' = -100, + '_-200' = -200, + '_-300' = -300 +} + +export type ClientOptions = { + baseUrl: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-preserve/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-preserve/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-preserve/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-preserve/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-preserve/types.gen.ts new file mode 100644 index 000000000..73b16f183 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-preserve/types.gen.ts @@ -0,0 +1,31 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export enum _110 { + '1-10' = '1-10', + '11-20' = '11-20' +} + +export enum MyFoo { + myFoo = 'myFoo', + myBar = 'myBar' +} + +export enum MyFoo2 { + MyFoo = 'MyFoo', + MyBar = 'MyBar' +} + +export type Foo = 'foo' | 'bar' | '' | true | false; + +export enum Numbers { + _100 = 100, + _200 = 200, + _300 = 300, + '_-100' = -100, + '_-200' = -200, + '_-300' = -300 +} + +export type ClientOptions = { + baseUrl: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-snake_case/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-snake_case/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-snake_case/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-snake_case/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-snake_case/types.gen.ts new file mode 100644 index 000000000..5a684d859 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-snake_case/types.gen.ts @@ -0,0 +1,31 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export enum _110 { + '1_10' = '1-10', + '11_20' = '11-20' +} + +export enum MyFoo { + my_foo = 'myFoo', + my_bar = 'myBar' +} + +export enum MyFoo2 { + my_foo = 'MyFoo', + my_bar = 'MyBar' +} + +export type Foo = 'foo' | 'bar' | '' | true | false; + +export enum Numbers { + _100 = 100, + _200 = 200, + _300 = 300, + '_-100' = -100, + '_-200' = -200, + '_-300' = -300 +} + +export type ClientOptions = { + baseUrl: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values/types.gen.ts new file mode 100644 index 000000000..64b608956 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values/types.gen.ts @@ -0,0 +1,15 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _110 = '1-10' | '11-20'; + +export type MyFoo = 'myFoo' | 'myBar'; + +export type MyFoo2 = 'MyFoo' | 'MyBar'; + +export type Foo = 'foo' | 'bar' | '' | true | false; + +export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; + +export type ClientOptions = { + baseUrl: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/exclude-deprecated/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/exclude-deprecated/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/exclude-deprecated/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/exclude-deprecated/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/exclude-deprecated/types.gen.ts new file mode 100644 index 000000000..6ab2de374 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/exclude-deprecated/types.gen.ts @@ -0,0 +1,21 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = string; + +export type PostFooData = { + body: Foo; + path?: never; + query?: never; + url: '/foo'; +}; + +export type PostFooResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type ClientOptions = { + baseUrl: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/form-data/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/form-data/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/form-data/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/form-data/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/form-data/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/form-data/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/form-data/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/form-data/sdk.gen.ts new file mode 100644 index 000000000..e888d7115 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/form-data/sdk.gen.ts @@ -0,0 +1,31 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer } from '@hey-api/client-fetch'; +import type { PostV1FooData, PostV1FooResponse } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const postV1Foo = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/v1/foo', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/form-data/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/form-data/types.gen.ts new file mode 100644 index 000000000..35f2e9d76 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/form-data/types.gen.ts @@ -0,0 +1,28 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + status?: number; +}; + +export type PostV1FooData = { + body: { + file: Blob | File; + info: string; + }; + path?: never; + query?: never; + url: '/v1/foo'; +}; + +export type PostV1FooResponses = { + /** + * OK + */ + 200: Foo; +}; + +export type PostV1FooResponse = PostV1FooResponses[keyof PostV1FooResponses]; + +export type ClientOptions = { + baseUrl: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts new file mode 100644 index 000000000..dd829f310 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts @@ -0,0 +1,671 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export const CommentWithBreaksSchema = { + description: `Testing multiline comments in string: First line +Second line + +Fourth line`, + type: 'integer' +} as const; + +export const CommentWithBackticksSchema = { + description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work', + type: 'integer' +} as const; + +export const CommentWithBackticksAndQuotesSchema = { + description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`, + type: 'integer' +} as const; + +export const CommentWithSlashesSchema = { + description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work', + type: 'integer' +} as const; + +export const CommentWithExpressionPlaceholdersSchema = { + description: 'Testing expression placeholders in string: ${expression} should work', + type: 'integer' +} as const; + +export const CommentWithQuotesSchema = { + description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`, + type: 'integer' +} as const; + +export const CommentWithReservedCharactersSchema = { + description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work', + type: 'integer' +} as const; + +export const SimpleIntegerSchema = { + description: 'This is a simple number', + type: 'integer' +} as const; + +export const SimpleBooleanSchema = { + description: 'This is a simple boolean', + type: 'boolean' +} as const; + +export const SimpleStringSchema = { + description: 'This is a simple string', + type: 'string' +} as const; + +export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = { + description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)', + type: 'string' +} as const; + +export const SimpleFileSchema = { + description: 'This is a simple file', + format: 'binary', + type: 'string' +} as const; + +export const SimpleReferenceSchema = { + description: 'This is a simple reference', + '$ref': '#/definitions/ModelWithString' +} as const; + +export const SimpleStringWithPatternSchema = { + description: 'This is a simple string', + type: 'string', + maxLength: 64, + pattern: '^[a-zA-Z0-9_]*$' +} as const; + +export const EnumWithStringsSchema = { + description: 'This is a simple enum with strings', + enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串'] +} as const; + +export const EnumWithNumbersSchema = { + description: 'This is a simple enum with numbers', + enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3] +} as const; + +export const EnumFromDescriptionSchema = { + description: 'Success=1,Warning=2,Error=3', + type: 'number' +} as const; + +export const EnumWithExtensionsSchema = { + description: 'This is a simple enum with numbers', + enum: [200, 400, 500], + 'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'], + 'x-enum-descriptions': ['Used when the status of something is successful', 'Used when the status of something has a warning', 'Used when the status of something has an error'] +} as const; + +export const ArrayWithNumbersSchema = { + description: 'This is a simple array with numbers', + type: 'array', + items: { + type: 'integer' + } +} as const; + +export const ArrayWithBooleansSchema = { + description: 'This is a simple array with booleans', + type: 'array', + items: { + type: 'boolean' + } +} as const; + +export const ArrayWithStringsSchema = { + description: 'This is a simple array with strings', + type: 'array', + items: { + type: 'string' + } +} as const; + +export const ArrayWithReferencesSchema = { + description: 'This is a simple array with references', + type: 'array', + items: { + '$ref': '#/definitions/ModelWithString' + } +} as const; + +export const ArrayWithArraySchema = { + description: 'This is a simple array containing an array', + type: 'array', + items: { + type: 'array', + items: { + '$ref': '#/definitions/ModelWithString' + } + } +} as const; + +export const ArrayWithPropertiesSchema = { + description: 'This is a simple array with properties', + type: 'array', + items: { + type: 'object', + properties: { + foo: { + type: 'string' + }, + bar: { + type: 'string' + } + } + } +} as const; + +export const DictionaryWithStringSchema = { + description: 'This is a string dictionary', + type: 'object', + additionalProperties: { + type: 'string' + } +} as const; + +export const DictionaryWithReferenceSchema = { + description: 'This is a string reference', + type: 'object', + additionalProperties: { + '$ref': '#/definitions/ModelWithString' + } +} as const; + +export const DictionaryWithArraySchema = { + description: 'This is a complex dictionary', + type: 'object', + additionalProperties: { + type: 'array', + items: { + '$ref': '#/definitions/ModelWithString' + } + } +} as const; + +export const DictionaryWithDictionarySchema = { + description: 'This is a string dictionary', + type: 'object', + additionalProperties: { + type: 'object', + additionalProperties: { + type: 'string' + } + } +} as const; + +export const DictionaryWithPropertiesSchema = { + description: 'This is a complex dictionary', + type: 'object', + additionalProperties: { + type: 'object', + properties: { + foo: { + type: 'string' + }, + bar: { + type: 'string' + } + } + } +} as const; + +export const DateSchema = { + description: 'This is a type-only model that defines Date as a string', + type: 'string' +} as const; + +export const ModelWithIntegerSchema = { + description: 'This is a model with one number property', + type: 'object', + properties: { + prop: { + description: 'This is a simple number property', + type: 'integer' + } + } +} as const; + +export const ModelWithBooleanSchema = { + description: 'This is a model with one boolean property', + type: 'object', + properties: { + prop: { + description: 'This is a simple boolean property', + type: 'boolean' + } + } +} as const; + +export const ModelWithStringSchema = { + description: 'This is a model with one string property', + type: 'object', + properties: { + prop: { + description: 'This is a simple string property', + type: 'string' + } + } +} as const; + +export const ModelWithStringErrorSchema = { + description: 'This is a model with one string property', + type: 'object', + properties: { + prop: { + description: 'This is a simple string property', + type: 'string' + } + } +} as const; + +export const ModelWithNullableStringSchema = { + description: 'This is a model with one string property', + type: 'object', + required: ['nullableRequiredProp'], + properties: { + nullableProp: { + description: 'This is a simple string property', + type: 'string', + 'x-nullable': true + }, + nullableRequiredProp: { + description: 'This is a simple string property', + type: 'string', + 'x-nullable': true + } + } +} as const; + +export const ModelWithEnumSchema = { + description: 'This is a model with one enum', + type: 'object', + properties: { + test: { + description: 'This is a simple enum with strings', + enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + }, + statusCode: { + description: 'These are the HTTP error code enums', + enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar'] + }, + bool: { + description: 'Simple boolean enum', + type: 'boolean', + enum: [true] + } + } +} as const; + +export const ModelWithEnumFromDescriptionSchema = { + description: 'This is a model with one enum', + type: 'object', + properties: { + test: { + type: 'integer', + description: 'Success=1,Warning=2,Error=3' + } + } +} as const; + +export const ModelWithNestedEnumsSchema = { + description: 'This is a model with nested enums', + type: 'object', + properties: { + dictionaryWithEnum: { + type: 'object', + additionalProperties: { + enum: ['Success', 'Warning', 'Error'] + } + }, + dictionaryWithEnumFromDescription: { + type: 'object', + additionalProperties: { + type: 'integer', + description: 'Success=1,Warning=2,Error=3' + } + }, + arrayWithEnum: { + type: 'array', + items: { + enum: ['Success', 'Warning', 'Error'] + } + }, + arrayWithDescription: { + type: 'array', + items: { + type: 'integer', + description: 'Success=1,Warning=2,Error=3' + } + } + } +} as const; + +export const ModelWithReferenceSchema = { + description: 'This is a model with one property containing a reference', + type: 'object', + properties: { + prop: { + '$ref': '#/definitions/ModelWithProperties' + } + } +} as const; + +export const ModelWithArraySchema = { + description: 'This is a model with one property containing an array', + type: 'object', + properties: { + prop: { + type: 'array', + items: { + '$ref': '#/definitions/ModelWithString' + } + }, + propWithFile: { + type: 'array', + items: { + format: 'binary', + type: 'string' + } + }, + propWithNumber: { + type: 'array', + items: { + type: 'number' + } + } + } +} as const; + +export const ModelWithDictionarySchema = { + description: 'This is a model with one property containing a dictionary', + type: 'object', + properties: { + prop: { + type: 'object', + additionalProperties: { + type: 'string' + } + } + } +} as const; + +export const ModelWithCircularReferenceSchema = { + description: 'This is a model with one property containing a circular reference', + type: 'object', + properties: { + prop: { + '$ref': '#/definitions/ModelWithCircularReference' + } + } +} as const; + +export const ModelWithPropertiesSchema = { + description: 'This is a model with one nested property', + type: 'object', + required: ['required', 'requiredAndReadOnly'], + properties: { + required: { + type: 'string' + }, + requiredAndReadOnly: { + type: 'string', + readOnly: true + }, + string: { + type: 'string' + }, + number: { + type: 'number' + }, + boolean: { + type: 'boolean' + }, + reference: { + '$ref': '#/definitions/ModelWithString' + }, + 'property with space': { + type: 'string' + }, + default: { + type: 'string' + }, + try: { + type: 'string' + }, + '@namespace.string': { + type: 'string', + readOnly: true + }, + '@namespace.integer': { + type: 'integer', + readOnly: true + } + } +} as const; + +export const ModelWithNestedPropertiesSchema = { + description: 'This is a model with one nested property', + type: 'object', + required: ['first'], + properties: { + first: { + type: 'object', + required: ['second'], + readOnly: true, + properties: { + second: { + type: 'object', + required: ['third'], + readOnly: true, + properties: { + third: { + type: 'string', + readOnly: true + } + } + } + } + } + } +} as const; + +export const ModelWithDuplicatePropertiesSchema = { + description: 'This is a model with duplicated properties', + type: 'object', + properties: { + prop: { + '$ref': '#/definitions/ModelWithString' + } + } +} as const; + +export const ModelWithOrderedPropertiesSchema = { + description: 'This is a model with ordered properties', + type: 'object', + properties: { + zebra: { + type: 'string' + }, + apple: { + type: 'string' + }, + hawaii: { + type: 'string' + } + } +} as const; + +export const ModelWithDuplicateImportsSchema = { + description: 'This is a model with duplicated imports', + type: 'object', + properties: { + propA: { + '$ref': '#/definitions/ModelWithString' + }, + propB: { + '$ref': '#/definitions/ModelWithString' + }, + propC: { + '$ref': '#/definitions/ModelWithString' + } + } +} as const; + +export const ModelThatExtendsSchema = { + description: 'This is a model that extends another model', + type: 'object', + allOf: [ + { + '$ref': '#/definitions/ModelWithString' + }, + { + type: 'object', + properties: { + propExtendsA: { + type: 'string' + }, + propExtendsB: { + '$ref': '#/definitions/ModelWithString' + } + } + } + ] +} as const; + +export const ModelThatExtendsExtendsSchema = { + description: 'This is a model that extends another model', + type: 'object', + allOf: [ + { + '$ref': '#/definitions/ModelWithString' + }, + { + '$ref': '#/definitions/ModelThatExtends' + }, + { + type: 'object', + properties: { + propExtendsC: { + type: 'string' + }, + propExtendsD: { + '$ref': '#/definitions/ModelWithString' + } + } + } + ] +} as const; + +export const defaultSchema = { + type: 'object', + properties: { + name: { + type: 'string' + } + } +} as const; + +export const ModelWithPatternSchema = { + description: 'This is a model that contains a some patterns', + type: 'object', + required: ['key', 'name'], + properties: { + key: { + maxLength: 64, + pattern: '^[a-zA-Z0-9_]*$', + type: 'string' + }, + name: { + maxLength: 255, + type: 'string' + }, + enabled: { + type: 'boolean', + readOnly: true + }, + modified: { + type: 'string', + format: 'date-time', + readOnly: true + }, + id: { + type: 'string', + pattern: '^\\d{2}-\\d{3}-\\d{4}$' + }, + text: { + type: 'string', + pattern: '^\\w+$' + }, + patternWithSingleQuotes: { + type: 'string', + pattern: "^[a-zA-Z0-9']*$" + }, + patternWithNewline: { + type: 'string', + pattern: 'aaa\\nbbb' + }, + patternWithBacktick: { + type: 'string', + pattern: 'aaa`bbb' + } + } +} as const; + +export const parameter_ActivityParamsSchema = { + type: 'object', + properties: { + description: { + type: 'string' + }, + graduate_id: { + type: 'integer' + }, + organization_id: { + type: 'integer' + }, + parent_activity: { + type: 'integer' + }, + post_id: { + type: 'integer' + } + } +} as const; + +export const response_PostActivityResponseSchema = { + type: 'object', + properties: { + description: { + type: 'string' + }, + graduate_id: { + type: 'integer' + }, + organization_id: { + type: 'integer' + }, + parent_activity_id: { + type: 'integer' + }, + post_id: { + type: 'integer' + } + } +} as const; + +export const failure_FailureSchema = { + type: 'object', + properties: { + error: { + type: 'string' + }, + message: { + type: 'string' + }, + reference_code: { + type: 'string' + } + } +} as const; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/sdk.gen.ts new file mode 100644 index 000000000..8c3eadef9 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/sdk.gen.ts @@ -0,0 +1,277 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const serviceWithEmptyTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions/', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options + }); +}; + +export const callWithDefaultParameters = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Body should not be unknown + * Body should not be unknown + */ +export const postApiVbyApiVersionBody = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/body', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/types.gen.ts new file mode 100644 index 000000000..56640474e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/types.gen.ts @@ -0,0 +1,1164 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + foo?: string; + bar?: string; +}>; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a type-only model that defines Date as a string + */ +export type _Date = string; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp: string | null; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +export type Default = { + name?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ParameterActivityParams = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity?: number; + post_id?: number; +}; + +export type ResponsePostActivityResponse = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity_id?: number; + post_id?: number; +}; + +export type FailureFailure = { + error?: string; + message?: string; + reference_code?: string; +}; + +export type ServiceWithEmptyTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions/'; +}; + +export type CallWithParametersData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter that goes into the query params + */ + parameterQuery: string; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query: { + /** + * This is a simple string with default value + */ + parameterString: string; + /** + * This is a simple number with default value + */ + parameterNumber: number; + /** + * This is a simple boolean with default value + */ + parameterBoolean: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + }; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: string; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: NonAsciiStringæøåÆøÅöôêÊ字符串; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PostApiVbyApiVersionBodyData = { + /** + * Body should not be unknown + */ + body: ParameterActivityParams; + path?: never; + query?: never; + url: '/api/v{api-version}/body'; +}; + +export type PostApiVbyApiVersionBodyErrors = { + /** + * Bad Request + */ + 400: FailureFailure; + /** + * Internal Server Error + */ + 500: FailureFailure; +}; + +export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; + +export type PostApiVbyApiVersionBodyResponses = { + /** + * OK + */ + 200: ResponsePostActivityResponse; +}; + +export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts new file mode 100644 index 000000000..caa002cde --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts @@ -0,0 +1,19 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base', + throwOnError: true +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts new file mode 100644 index 000000000..c6bb42442 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts @@ -0,0 +1,277 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const serviceWithEmptyTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions/', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options + }); +}; + +export const callWithDefaultParameters = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Body should not be unknown + * Body should not be unknown + */ +export const postApiVbyApiVersionBody = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/body', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts new file mode 100644 index 000000000..56640474e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts @@ -0,0 +1,1164 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + foo?: string; + bar?: string; +}>; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a type-only model that defines Date as a string + */ +export type _Date = string; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp: string | null; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +export type Default = { + name?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ParameterActivityParams = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity?: number; + post_id?: number; +}; + +export type ResponsePostActivityResponse = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity_id?: number; + post_id?: number; +}; + +export type FailureFailure = { + error?: string; + message?: string; + reference_code?: string; +}; + +export type ServiceWithEmptyTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions/'; +}; + +export type CallWithParametersData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter that goes into the query params + */ + parameterQuery: string; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query: { + /** + * This is a simple string with default value + */ + parameterString: string; + /** + * This is a simple number with default value + */ + parameterNumber: number; + /** + * This is a simple boolean with default value + */ + parameterBoolean: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + }; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: string; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: NonAsciiStringæøåÆøÅöôêÊ字符串; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PostApiVbyApiVersionBodyData = { + /** + * Body should not be unknown + */ + body: ParameterActivityParams; + path?: never; + query?: never; + url: '/api/v{api-version}/body'; +}; + +export type PostApiVbyApiVersionBodyErrors = { + /** + * Bad Request + */ + 400: FailureFailure; + /** + * Internal Server Error + */ + 500: FailureFailure; +}; + +export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; + +export type PostApiVbyApiVersionBodyResponses = { + /** + * OK + */ + 200: ResponsePostActivityResponse; +}; + +export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts new file mode 100644 index 000000000..b3e776847 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts @@ -0,0 +1,32 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { PostFooData, PostFooResponse } from './types.gen'; +import { postFooResponseTransformer } from './transformers.gen'; +import { zPostFooResponse } from './zod.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const postFoo = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + responseTransformer: postFooResponseTransformer, + responseValidator: async (data) => { + return await zPostFooResponse.parseAsync(data); + }, + url: '/foo', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts new file mode 100644 index 000000000..419690a91 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts @@ -0,0 +1,13 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { PostFooResponse } from './types.gen'; + +const fooSchemaResponseTransformer = (data: any) => { + data.foo = BigInt(data.foo.toString()); + return data; +}; + +export const postFooResponseTransformer = async (data: any): Promise => { + data = fooSchemaResponseTransformer(data); + return data; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/types.gen.ts new file mode 100644 index 000000000..7066bdf0e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/types.gen.ts @@ -0,0 +1,32 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + bar?: number; + foo: bigint; + id: string; +}; + +export type Bar = { + foo: number; + [key: string]: number; +}; + +export type PostFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type PostFooResponses = { + /** + * OK + */ + 200: Foo; +}; + +export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; + +export type ClientOptions = { + baseUrl: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/zod.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/zod.gen.ts new file mode 100644 index 000000000..328fe6811 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/zod.gen.ts @@ -0,0 +1,15 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { z } from 'zod'; + +export const zFoo = z.object({ + bar: z.number().int().optional(), + foo: z.coerce.bigint(), + id: z.string() +}); + +export const zBar = z.object({ + foo: z.number().int() +}); + +export const zPostFooResponse = zFoo; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts new file mode 100644 index 000000000..19e7990c4 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts @@ -0,0 +1,37 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type ReadableFooRead = ReadableBarRead & { + readonly foo?: string; +}; + +export type WritableFooRead = WritableBarRead; + +export type ReadableBarRead = Baz & { + readonly bar?: string; +}; + +export type WritableBarRead = Baz; + +export type Baz = { + baz?: string; +}; + +export type PostFooReadData = { + body: WritableFooRead; + path?: never; + query?: never; + url: '/foo-read'; +}; + +export type PostFooReadResponses = { + /** + * OK + */ + 200: ReadableFooRead; +}; + +export type PostFooReadResponse = PostFooReadResponses[keyof PostFooReadResponses]; + +export type ClientOptions = { + baseUrl: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts new file mode 100644 index 000000000..ed86a05be --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts @@ -0,0 +1,33 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type FooRead = BarRead & { + readonly foo?: string; +}; + +export type BarRead = Baz & { + readonly bar?: string; +}; + +export type Baz = { + baz?: string; +}; + +export type PostFooReadData = { + body: FooRead; + path?: never; + query?: never; + url: '/foo-read'; +}; + +export type PostFooReadResponses = { + /** + * OK + */ + 200: FooRead; +}; + +export type PostFooReadResponse = PostFooReadResponses[keyof PostFooReadResponses]; + +export type ClientOptions = { + baseUrl: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts new file mode 100644 index 000000000..ca14d791e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts @@ -0,0 +1,708 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, DefaultService, SimpleService, DescriptionsService, ParametersService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, ComplexService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError } from '@tanstack/angular-query-experimental'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); + +export const serviceWithEmptyTagOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.serviceWithEmptyTag({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: serviceWithEmptyTagQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NoContentService.callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await CollectionFormatService.collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await TypesService.types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ComplexService.complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); + +export const postApiVbyApiVersionBodyOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.postApiVbyApiVersionBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionBodyMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.postApiVbyApiVersionBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts new file mode 100644 index 000000000..bfd6beb48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts @@ -0,0 +1,356 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export class DefaultService { + public static serviceWithEmptyTag(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static patchApiVbyApiVersionNoTag(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static fooWow(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + /** + * Body should not be unknown + * Body should not be unknown + */ + public static postApiVbyApiVersionBody(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/body', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class SimpleService { + public static deleteCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static getCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static headCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static optionsCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static patchCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static postCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static putCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); + } + +} + +export class DescriptionsService { + public static callWithDescriptions(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions/', + ...options + }); + } + +} + +export class ParametersService { + public static callWithParameters(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options + }); + } + + public static callWithWeirdParameterNames(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options + }); + } + +} + +export class DefaultsService { + public static callWithDefaultParameters(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callWithDefaultOptionalParameters(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callToTestOrderOfParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + +} + +export class DuplicateService { + public static duplicateName(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName2(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName3(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName4(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + +} + +export class NoContentService { + public static callWithNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); + } + + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + +} + +export class ResponseService { + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + + public static callWithResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithDuplicateResponses(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithResponses(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); + } + +} + +export class MultipleTags1Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags2Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags3Service { + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class CollectionFormatService { + public static collectionFormat(options: Options) { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/collectionFormat', + ...options + }); + } + +} + +export class TypesService { + public static types(options: Options) { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/types', + ...options + }); + } + +} + +export class ComplexService { + public static complexTypes(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); + } + +} + +export class HeaderService { + public static callWithResultFromHeader(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); + } + +} + +export class ErrorService { + public static testErrorCode(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts new file mode 100644 index 000000000..56640474e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts @@ -0,0 +1,1164 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + foo?: string; + bar?: string; +}>; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a type-only model that defines Date as a string + */ +export type _Date = string; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp: string | null; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +export type Default = { + name?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ParameterActivityParams = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity?: number; + post_id?: number; +}; + +export type ResponsePostActivityResponse = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity_id?: number; + post_id?: number; +}; + +export type FailureFailure = { + error?: string; + message?: string; + reference_code?: string; +}; + +export type ServiceWithEmptyTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions/'; +}; + +export type CallWithParametersData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter that goes into the query params + */ + parameterQuery: string; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query: { + /** + * This is a simple string with default value + */ + parameterString: string; + /** + * This is a simple number with default value + */ + parameterNumber: number; + /** + * This is a simple boolean with default value + */ + parameterBoolean: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + }; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: string; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: NonAsciiStringæøåÆøÅöôêÊ字符串; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PostApiVbyApiVersionBodyData = { + /** + * Body should not be unknown + */ + body: ParameterActivityParams; + path?: never; + query?: never; + url: '/api/v{api-version}/body'; +}; + +export type PostApiVbyApiVersionBodyErrors = { + /** + * Bad Request + */ + 400: FailureFailure; + /** + * Internal Server Error + */ + 500: FailureFailure; +}; + +export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; + +export type PostApiVbyApiVersionBodyResponses = { + /** + * OK + */ + 200: ResponsePostActivityResponse; +}; + +export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts new file mode 100644 index 000000000..2103361ab --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts @@ -0,0 +1,709 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, serviceWithEmptyTag, patchApiVbyApiVersionNoTag, fooWow, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, callWithDescriptions, callWithParameters, callWithWeirdParameterNames, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, complexTypes, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, postApiVbyApiVersionBody } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError } from '@tanstack/angular-query-experimental'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; +import type { AxiosError } from 'axios'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); + +export const serviceWithEmptyTagOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await serviceWithEmptyTag({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: serviceWithEmptyTagQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); + +export const postApiVbyApiVersionBodyOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionBodyMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts new file mode 100644 index 000000000..1d97df8bc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts new file mode 100644 index 000000000..dac17aaa1 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts @@ -0,0 +1,277 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-axios'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const serviceWithEmptyTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions/', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options + }); +}; + +export const callWithDefaultParameters = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Body should not be unknown + * Body should not be unknown + */ +export const postApiVbyApiVersionBody = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/body', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts new file mode 100644 index 000000000..b8bb1830f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts @@ -0,0 +1,1164 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + foo?: string; + bar?: string; +}>; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a type-only model that defines Date as a string + */ +export type _Date = string; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp: string | null; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +export type Default = { + name?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ParameterActivityParams = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity?: number; + post_id?: number; +}; + +export type ResponsePostActivityResponse = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity_id?: number; + post_id?: number; +}; + +export type FailureFailure = { + error?: string; + message?: string; + reference_code?: string; +}; + +export type ServiceWithEmptyTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions/'; +}; + +export type CallWithParametersData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter that goes into the query params + */ + parameterQuery: string; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query: { + /** + * This is a simple string with default value + */ + parameterString: string; + /** + * This is a simple number with default value + */ + parameterNumber: number; + /** + * This is a simple boolean with default value + */ + parameterBoolean: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + }; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: string; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: NonAsciiStringæøåÆøÅöôêÊ字符串; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PostApiVbyApiVersionBodyData = { + /** + * Body should not be unknown + */ + body: ParameterActivityParams; + path?: never; + query?: never; + url: '/api/v{api-version}/body'; +}; + +export type PostApiVbyApiVersionBodyErrors = { + /** + * Bad Request + */ + 400: FailureFailure; + /** + * Internal Server Error + */ + 500: FailureFailure; +}; + +export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; + +export type PostApiVbyApiVersionBodyResponses = { + /** + * OK + */ + 200: ResponsePostActivityResponse; +}; + +export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts new file mode 100644 index 000000000..e30beba43 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts @@ -0,0 +1,708 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, serviceWithEmptyTag, patchApiVbyApiVersionNoTag, fooWow, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, callWithDescriptions, callWithParameters, callWithWeirdParameterNames, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, complexTypes, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, postApiVbyApiVersionBody } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError } from '@tanstack/angular-query-experimental'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); + +export const serviceWithEmptyTagOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await serviceWithEmptyTag({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: serviceWithEmptyTagQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); + +export const postApiVbyApiVersionBodyOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionBodyMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts new file mode 100644 index 000000000..8c3eadef9 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts @@ -0,0 +1,277 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const serviceWithEmptyTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions/', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options + }); +}; + +export const callWithDefaultParameters = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Body should not be unknown + * Body should not be unknown + */ +export const postApiVbyApiVersionBody = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/body', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts new file mode 100644 index 000000000..56640474e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts @@ -0,0 +1,1164 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + foo?: string; + bar?: string; +}>; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a type-only model that defines Date as a string + */ +export type _Date = string; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp: string | null; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +export type Default = { + name?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ParameterActivityParams = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity?: number; + post_id?: number; +}; + +export type ResponsePostActivityResponse = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity_id?: number; + post_id?: number; +}; + +export type FailureFailure = { + error?: string; + message?: string; + reference_code?: string; +}; + +export type ServiceWithEmptyTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions/'; +}; + +export type CallWithParametersData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter that goes into the query params + */ + parameterQuery: string; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query: { + /** + * This is a simple string with default value + */ + parameterString: string; + /** + * This is a simple number with default value + */ + parameterNumber: number; + /** + * This is a simple boolean with default value + */ + parameterBoolean: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + }; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: string; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: NonAsciiStringæøåÆøÅöôêÊ字符串; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PostApiVbyApiVersionBodyData = { + /** + * Body should not be unknown + */ + body: ParameterActivityParams; + path?: never; + query?: never; + url: '/api/v{api-version}/body'; +}; + +export type PostApiVbyApiVersionBodyErrors = { + /** + * Bad Request + */ + 400: FailureFailure; + /** + * Internal Server Error + */ + 500: FailureFailure; +}; + +export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; + +export type PostApiVbyApiVersionBodyResponses = { + /** + * OK + */ + 200: ResponsePostActivityResponse; +}; + +export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts new file mode 100644 index 000000000..dd75fa888 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts @@ -0,0 +1,708 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, DefaultService, SimpleService, DescriptionsService, ParametersService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, ComplexService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; +import { queryOptions, type UseMutationOptions, type DefaultError } from '@tanstack/react-query'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); + +export const serviceWithEmptyTagOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.serviceWithEmptyTag({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: serviceWithEmptyTagQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NoContentService.callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await CollectionFormatService.collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await TypesService.types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ComplexService.complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); + +export const postApiVbyApiVersionBodyOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.postApiVbyApiVersionBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionBodyMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.postApiVbyApiVersionBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts new file mode 100644 index 000000000..bfd6beb48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts @@ -0,0 +1,356 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export class DefaultService { + public static serviceWithEmptyTag(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static patchApiVbyApiVersionNoTag(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static fooWow(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + /** + * Body should not be unknown + * Body should not be unknown + */ + public static postApiVbyApiVersionBody(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/body', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class SimpleService { + public static deleteCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static getCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static headCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static optionsCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static patchCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static postCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static putCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); + } + +} + +export class DescriptionsService { + public static callWithDescriptions(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions/', + ...options + }); + } + +} + +export class ParametersService { + public static callWithParameters(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options + }); + } + + public static callWithWeirdParameterNames(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options + }); + } + +} + +export class DefaultsService { + public static callWithDefaultParameters(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callWithDefaultOptionalParameters(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callToTestOrderOfParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + +} + +export class DuplicateService { + public static duplicateName(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName2(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName3(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName4(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + +} + +export class NoContentService { + public static callWithNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); + } + + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + +} + +export class ResponseService { + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + + public static callWithResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithDuplicateResponses(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithResponses(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); + } + +} + +export class MultipleTags1Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags2Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags3Service { + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class CollectionFormatService { + public static collectionFormat(options: Options) { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/collectionFormat', + ...options + }); + } + +} + +export class TypesService { + public static types(options: Options) { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/types', + ...options + }); + } + +} + +export class ComplexService { + public static complexTypes(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); + } + +} + +export class HeaderService { + public static callWithResultFromHeader(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); + } + +} + +export class ErrorService { + public static testErrorCode(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/types.gen.ts new file mode 100644 index 000000000..56640474e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/types.gen.ts @@ -0,0 +1,1164 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + foo?: string; + bar?: string; +}>; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a type-only model that defines Date as a string + */ +export type _Date = string; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp: string | null; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +export type Default = { + name?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ParameterActivityParams = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity?: number; + post_id?: number; +}; + +export type ResponsePostActivityResponse = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity_id?: number; + post_id?: number; +}; + +export type FailureFailure = { + error?: string; + message?: string; + reference_code?: string; +}; + +export type ServiceWithEmptyTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions/'; +}; + +export type CallWithParametersData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter that goes into the query params + */ + parameterQuery: string; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query: { + /** + * This is a simple string with default value + */ + parameterString: string; + /** + * This is a simple number with default value + */ + parameterNumber: number; + /** + * This is a simple boolean with default value + */ + parameterBoolean: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + }; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: string; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: NonAsciiStringæøåÆøÅöôêÊ字符串; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PostApiVbyApiVersionBodyData = { + /** + * Body should not be unknown + */ + body: ParameterActivityParams; + path?: never; + query?: never; + url: '/api/v{api-version}/body'; +}; + +export type PostApiVbyApiVersionBodyErrors = { + /** + * Bad Request + */ + 400: FailureFailure; + /** + * Internal Server Error + */ + 500: FailureFailure; +}; + +export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; + +export type PostApiVbyApiVersionBodyResponses = { + /** + * OK + */ + 200: ResponsePostActivityResponse; +}; + +export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts new file mode 100644 index 000000000..b471576fd --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts @@ -0,0 +1,709 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, serviceWithEmptyTag, patchApiVbyApiVersionNoTag, fooWow, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, callWithDescriptions, callWithParameters, callWithWeirdParameterNames, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, complexTypes, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, postApiVbyApiVersionBody } from '../sdk.gen'; +import { queryOptions, type UseMutationOptions, type DefaultError } from '@tanstack/react-query'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; +import type { AxiosError } from 'axios'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); + +export const serviceWithEmptyTagOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await serviceWithEmptyTag({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: serviceWithEmptyTagQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); + +export const postApiVbyApiVersionBodyOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionBodyMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/client.gen.ts new file mode 100644 index 000000000..1d97df8bc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/sdk.gen.ts new file mode 100644 index 000000000..dac17aaa1 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/sdk.gen.ts @@ -0,0 +1,277 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-axios'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const serviceWithEmptyTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions/', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options + }); +}; + +export const callWithDefaultParameters = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Body should not be unknown + * Body should not be unknown + */ +export const postApiVbyApiVersionBody = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/body', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/types.gen.ts new file mode 100644 index 000000000..b8bb1830f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/types.gen.ts @@ -0,0 +1,1164 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + foo?: string; + bar?: string; +}>; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a type-only model that defines Date as a string + */ +export type _Date = string; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp: string | null; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +export type Default = { + name?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ParameterActivityParams = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity?: number; + post_id?: number; +}; + +export type ResponsePostActivityResponse = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity_id?: number; + post_id?: number; +}; + +export type FailureFailure = { + error?: string; + message?: string; + reference_code?: string; +}; + +export type ServiceWithEmptyTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions/'; +}; + +export type CallWithParametersData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter that goes into the query params + */ + parameterQuery: string; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query: { + /** + * This is a simple string with default value + */ + parameterString: string; + /** + * This is a simple number with default value + */ + parameterNumber: number; + /** + * This is a simple boolean with default value + */ + parameterBoolean: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + }; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: string; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: NonAsciiStringæøåÆøÅöôêÊ字符串; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PostApiVbyApiVersionBodyData = { + /** + * Body should not be unknown + */ + body: ParameterActivityParams; + path?: never; + query?: never; + url: '/api/v{api-version}/body'; +}; + +export type PostApiVbyApiVersionBodyErrors = { + /** + * Bad Request + */ + 400: FailureFailure; + /** + * Internal Server Error + */ + 500: FailureFailure; +}; + +export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; + +export type PostApiVbyApiVersionBodyResponses = { + /** + * OK + */ + 200: ResponsePostActivityResponse; +}; + +export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts new file mode 100644 index 000000000..ff1ce5508 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts @@ -0,0 +1,708 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, serviceWithEmptyTag, patchApiVbyApiVersionNoTag, fooWow, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, callWithDescriptions, callWithParameters, callWithWeirdParameterNames, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, complexTypes, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, postApiVbyApiVersionBody } from '../sdk.gen'; +import { queryOptions, type UseMutationOptions, type DefaultError } from '@tanstack/react-query'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); + +export const serviceWithEmptyTagOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await serviceWithEmptyTag({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: serviceWithEmptyTagQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); + +export const postApiVbyApiVersionBodyOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionBodyMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts new file mode 100644 index 000000000..8c3eadef9 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts @@ -0,0 +1,277 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const serviceWithEmptyTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions/', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options + }); +}; + +export const callWithDefaultParameters = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Body should not be unknown + * Body should not be unknown + */ +export const postApiVbyApiVersionBody = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/body', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/types.gen.ts new file mode 100644 index 000000000..56640474e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/types.gen.ts @@ -0,0 +1,1164 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + foo?: string; + bar?: string; +}>; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a type-only model that defines Date as a string + */ +export type _Date = string; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp: string | null; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +export type Default = { + name?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ParameterActivityParams = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity?: number; + post_id?: number; +}; + +export type ResponsePostActivityResponse = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity_id?: number; + post_id?: number; +}; + +export type FailureFailure = { + error?: string; + message?: string; + reference_code?: string; +}; + +export type ServiceWithEmptyTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions/'; +}; + +export type CallWithParametersData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter that goes into the query params + */ + parameterQuery: string; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query: { + /** + * This is a simple string with default value + */ + parameterString: string; + /** + * This is a simple number with default value + */ + parameterNumber: number; + /** + * This is a simple boolean with default value + */ + parameterBoolean: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + }; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: string; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: NonAsciiStringæøåÆøÅöôêÊ字符串; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PostApiVbyApiVersionBodyData = { + /** + * Body should not be unknown + */ + body: ParameterActivityParams; + path?: never; + query?: never; + url: '/api/v{api-version}/body'; +}; + +export type PostApiVbyApiVersionBodyErrors = { + /** + * Bad Request + */ + 400: FailureFailure; + /** + * Internal Server Error + */ + 500: FailureFailure; +}; + +export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; + +export type PostApiVbyApiVersionBodyResponses = { + /** + * OK + */ + 200: ResponsePostActivityResponse; +}; + +export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts new file mode 100644 index 000000000..209343aee --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts @@ -0,0 +1,708 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, DefaultService, SimpleService, DescriptionsService, ParametersService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, ComplexService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError } from '@tanstack/solid-query'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); + +export const serviceWithEmptyTagOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.serviceWithEmptyTag({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: serviceWithEmptyTagQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NoContentService.callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await CollectionFormatService.collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await TypesService.types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ComplexService.complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); + +export const postApiVbyApiVersionBodyOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.postApiVbyApiVersionBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionBodyMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.postApiVbyApiVersionBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts new file mode 100644 index 000000000..bfd6beb48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts @@ -0,0 +1,356 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export class DefaultService { + public static serviceWithEmptyTag(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static patchApiVbyApiVersionNoTag(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static fooWow(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + /** + * Body should not be unknown + * Body should not be unknown + */ + public static postApiVbyApiVersionBody(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/body', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class SimpleService { + public static deleteCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static getCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static headCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static optionsCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static patchCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static postCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static putCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); + } + +} + +export class DescriptionsService { + public static callWithDescriptions(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions/', + ...options + }); + } + +} + +export class ParametersService { + public static callWithParameters(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options + }); + } + + public static callWithWeirdParameterNames(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options + }); + } + +} + +export class DefaultsService { + public static callWithDefaultParameters(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callWithDefaultOptionalParameters(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callToTestOrderOfParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + +} + +export class DuplicateService { + public static duplicateName(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName2(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName3(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName4(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + +} + +export class NoContentService { + public static callWithNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); + } + + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + +} + +export class ResponseService { + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + + public static callWithResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithDuplicateResponses(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithResponses(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); + } + +} + +export class MultipleTags1Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags2Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags3Service { + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class CollectionFormatService { + public static collectionFormat(options: Options) { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/collectionFormat', + ...options + }); + } + +} + +export class TypesService { + public static types(options: Options) { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/types', + ...options + }); + } + +} + +export class ComplexService { + public static complexTypes(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); + } + +} + +export class HeaderService { + public static callWithResultFromHeader(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); + } + +} + +export class ErrorService { + public static testErrorCode(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/types.gen.ts new file mode 100644 index 000000000..56640474e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/types.gen.ts @@ -0,0 +1,1164 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + foo?: string; + bar?: string; +}>; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a type-only model that defines Date as a string + */ +export type _Date = string; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp: string | null; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +export type Default = { + name?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ParameterActivityParams = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity?: number; + post_id?: number; +}; + +export type ResponsePostActivityResponse = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity_id?: number; + post_id?: number; +}; + +export type FailureFailure = { + error?: string; + message?: string; + reference_code?: string; +}; + +export type ServiceWithEmptyTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions/'; +}; + +export type CallWithParametersData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter that goes into the query params + */ + parameterQuery: string; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query: { + /** + * This is a simple string with default value + */ + parameterString: string; + /** + * This is a simple number with default value + */ + parameterNumber: number; + /** + * This is a simple boolean with default value + */ + parameterBoolean: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + }; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: string; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: NonAsciiStringæøåÆøÅöôêÊ字符串; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PostApiVbyApiVersionBodyData = { + /** + * Body should not be unknown + */ + body: ParameterActivityParams; + path?: never; + query?: never; + url: '/api/v{api-version}/body'; +}; + +export type PostApiVbyApiVersionBodyErrors = { + /** + * Bad Request + */ + 400: FailureFailure; + /** + * Internal Server Error + */ + 500: FailureFailure; +}; + +export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; + +export type PostApiVbyApiVersionBodyResponses = { + /** + * OK + */ + 200: ResponsePostActivityResponse; +}; + +export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts new file mode 100644 index 000000000..9447fb08c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts @@ -0,0 +1,709 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, serviceWithEmptyTag, patchApiVbyApiVersionNoTag, fooWow, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, callWithDescriptions, callWithParameters, callWithWeirdParameterNames, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, complexTypes, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, postApiVbyApiVersionBody } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError } from '@tanstack/solid-query'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; +import type { AxiosError } from 'axios'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); + +export const serviceWithEmptyTagOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await serviceWithEmptyTag({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: serviceWithEmptyTagQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); + +export const postApiVbyApiVersionBodyOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionBodyMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts new file mode 100644 index 000000000..1d97df8bc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts new file mode 100644 index 000000000..dac17aaa1 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts @@ -0,0 +1,277 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-axios'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const serviceWithEmptyTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions/', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options + }); +}; + +export const callWithDefaultParameters = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Body should not be unknown + * Body should not be unknown + */ +export const postApiVbyApiVersionBody = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/body', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/types.gen.ts new file mode 100644 index 000000000..b8bb1830f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/types.gen.ts @@ -0,0 +1,1164 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + foo?: string; + bar?: string; +}>; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a type-only model that defines Date as a string + */ +export type _Date = string; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp: string | null; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +export type Default = { + name?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ParameterActivityParams = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity?: number; + post_id?: number; +}; + +export type ResponsePostActivityResponse = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity_id?: number; + post_id?: number; +}; + +export type FailureFailure = { + error?: string; + message?: string; + reference_code?: string; +}; + +export type ServiceWithEmptyTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions/'; +}; + +export type CallWithParametersData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter that goes into the query params + */ + parameterQuery: string; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query: { + /** + * This is a simple string with default value + */ + parameterString: string; + /** + * This is a simple number with default value + */ + parameterNumber: number; + /** + * This is a simple boolean with default value + */ + parameterBoolean: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + }; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: string; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: NonAsciiStringæøåÆøÅöôêÊ字符串; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PostApiVbyApiVersionBodyData = { + /** + * Body should not be unknown + */ + body: ParameterActivityParams; + path?: never; + query?: never; + url: '/api/v{api-version}/body'; +}; + +export type PostApiVbyApiVersionBodyErrors = { + /** + * Bad Request + */ + 400: FailureFailure; + /** + * Internal Server Error + */ + 500: FailureFailure; +}; + +export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; + +export type PostApiVbyApiVersionBodyResponses = { + /** + * OK + */ + 200: ResponsePostActivityResponse; +}; + +export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts new file mode 100644 index 000000000..d42562174 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts @@ -0,0 +1,708 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, serviceWithEmptyTag, patchApiVbyApiVersionNoTag, fooWow, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, callWithDescriptions, callWithParameters, callWithWeirdParameterNames, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, complexTypes, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, postApiVbyApiVersionBody } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError } from '@tanstack/solid-query'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); + +export const serviceWithEmptyTagOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await serviceWithEmptyTag({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: serviceWithEmptyTagQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); + +export const postApiVbyApiVersionBodyOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionBodyMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts new file mode 100644 index 000000000..8c3eadef9 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts @@ -0,0 +1,277 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const serviceWithEmptyTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions/', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options + }); +}; + +export const callWithDefaultParameters = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Body should not be unknown + * Body should not be unknown + */ +export const postApiVbyApiVersionBody = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/body', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/types.gen.ts new file mode 100644 index 000000000..56640474e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/types.gen.ts @@ -0,0 +1,1164 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + foo?: string; + bar?: string; +}>; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a type-only model that defines Date as a string + */ +export type _Date = string; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp: string | null; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +export type Default = { + name?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ParameterActivityParams = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity?: number; + post_id?: number; +}; + +export type ResponsePostActivityResponse = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity_id?: number; + post_id?: number; +}; + +export type FailureFailure = { + error?: string; + message?: string; + reference_code?: string; +}; + +export type ServiceWithEmptyTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions/'; +}; + +export type CallWithParametersData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter that goes into the query params + */ + parameterQuery: string; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query: { + /** + * This is a simple string with default value + */ + parameterString: string; + /** + * This is a simple number with default value + */ + parameterNumber: number; + /** + * This is a simple boolean with default value + */ + parameterBoolean: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + }; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: string; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: NonAsciiStringæøåÆøÅöôêÊ字符串; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PostApiVbyApiVersionBodyData = { + /** + * Body should not be unknown + */ + body: ParameterActivityParams; + path?: never; + query?: never; + url: '/api/v{api-version}/body'; +}; + +export type PostApiVbyApiVersionBodyErrors = { + /** + * Bad Request + */ + 400: FailureFailure; + /** + * Internal Server Error + */ + 500: FailureFailure; +}; + +export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; + +export type PostApiVbyApiVersionBodyResponses = { + /** + * OK + */ + 200: ResponsePostActivityResponse; +}; + +export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts new file mode 100644 index 000000000..9d1e3eb8d --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts @@ -0,0 +1,708 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, DefaultService, SimpleService, DescriptionsService, ParametersService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, ComplexService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError } from '@tanstack/svelte-query'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); + +export const serviceWithEmptyTagOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.serviceWithEmptyTag({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: serviceWithEmptyTagQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NoContentService.callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await CollectionFormatService.collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await TypesService.types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ComplexService.complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); + +export const postApiVbyApiVersionBodyOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.postApiVbyApiVersionBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionBodyMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.postApiVbyApiVersionBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts new file mode 100644 index 000000000..bfd6beb48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts @@ -0,0 +1,356 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export class DefaultService { + public static serviceWithEmptyTag(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static patchApiVbyApiVersionNoTag(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static fooWow(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + /** + * Body should not be unknown + * Body should not be unknown + */ + public static postApiVbyApiVersionBody(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/body', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class SimpleService { + public static deleteCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static getCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static headCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static optionsCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static patchCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static postCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static putCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); + } + +} + +export class DescriptionsService { + public static callWithDescriptions(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions/', + ...options + }); + } + +} + +export class ParametersService { + public static callWithParameters(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options + }); + } + + public static callWithWeirdParameterNames(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options + }); + } + +} + +export class DefaultsService { + public static callWithDefaultParameters(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callWithDefaultOptionalParameters(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callToTestOrderOfParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + +} + +export class DuplicateService { + public static duplicateName(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName2(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName3(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName4(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + +} + +export class NoContentService { + public static callWithNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); + } + + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + +} + +export class ResponseService { + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + + public static callWithResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithDuplicateResponses(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithResponses(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); + } + +} + +export class MultipleTags1Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags2Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags3Service { + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class CollectionFormatService { + public static collectionFormat(options: Options) { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/collectionFormat', + ...options + }); + } + +} + +export class TypesService { + public static types(options: Options) { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/types', + ...options + }); + } + +} + +export class ComplexService { + public static complexTypes(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); + } + +} + +export class HeaderService { + public static callWithResultFromHeader(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); + } + +} + +export class ErrorService { + public static testErrorCode(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts new file mode 100644 index 000000000..56640474e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts @@ -0,0 +1,1164 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + foo?: string; + bar?: string; +}>; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a type-only model that defines Date as a string + */ +export type _Date = string; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp: string | null; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +export type Default = { + name?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ParameterActivityParams = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity?: number; + post_id?: number; +}; + +export type ResponsePostActivityResponse = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity_id?: number; + post_id?: number; +}; + +export type FailureFailure = { + error?: string; + message?: string; + reference_code?: string; +}; + +export type ServiceWithEmptyTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions/'; +}; + +export type CallWithParametersData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter that goes into the query params + */ + parameterQuery: string; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query: { + /** + * This is a simple string with default value + */ + parameterString: string; + /** + * This is a simple number with default value + */ + parameterNumber: number; + /** + * This is a simple boolean with default value + */ + parameterBoolean: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + }; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: string; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: NonAsciiStringæøåÆøÅöôêÊ字符串; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PostApiVbyApiVersionBodyData = { + /** + * Body should not be unknown + */ + body: ParameterActivityParams; + path?: never; + query?: never; + url: '/api/v{api-version}/body'; +}; + +export type PostApiVbyApiVersionBodyErrors = { + /** + * Bad Request + */ + 400: FailureFailure; + /** + * Internal Server Error + */ + 500: FailureFailure; +}; + +export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; + +export type PostApiVbyApiVersionBodyResponses = { + /** + * OK + */ + 200: ResponsePostActivityResponse; +}; + +export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts new file mode 100644 index 000000000..8edd12a3e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts @@ -0,0 +1,709 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, serviceWithEmptyTag, patchApiVbyApiVersionNoTag, fooWow, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, callWithDescriptions, callWithParameters, callWithWeirdParameterNames, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, complexTypes, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, postApiVbyApiVersionBody } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError } from '@tanstack/svelte-query'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; +import type { AxiosError } from 'axios'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); + +export const serviceWithEmptyTagOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await serviceWithEmptyTag({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: serviceWithEmptyTagQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); + +export const postApiVbyApiVersionBodyOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionBodyMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts new file mode 100644 index 000000000..1d97df8bc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts new file mode 100644 index 000000000..dac17aaa1 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts @@ -0,0 +1,277 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-axios'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const serviceWithEmptyTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions/', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options + }); +}; + +export const callWithDefaultParameters = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Body should not be unknown + * Body should not be unknown + */ +export const postApiVbyApiVersionBody = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/body', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/types.gen.ts new file mode 100644 index 000000000..b8bb1830f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/types.gen.ts @@ -0,0 +1,1164 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + foo?: string; + bar?: string; +}>; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a type-only model that defines Date as a string + */ +export type _Date = string; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp: string | null; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +export type Default = { + name?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ParameterActivityParams = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity?: number; + post_id?: number; +}; + +export type ResponsePostActivityResponse = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity_id?: number; + post_id?: number; +}; + +export type FailureFailure = { + error?: string; + message?: string; + reference_code?: string; +}; + +export type ServiceWithEmptyTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions/'; +}; + +export type CallWithParametersData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter that goes into the query params + */ + parameterQuery: string; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query: { + /** + * This is a simple string with default value + */ + parameterString: string; + /** + * This is a simple number with default value + */ + parameterNumber: number; + /** + * This is a simple boolean with default value + */ + parameterBoolean: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + }; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: string; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: NonAsciiStringæøåÆøÅöôêÊ字符串; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PostApiVbyApiVersionBodyData = { + /** + * Body should not be unknown + */ + body: ParameterActivityParams; + path?: never; + query?: never; + url: '/api/v{api-version}/body'; +}; + +export type PostApiVbyApiVersionBodyErrors = { + /** + * Bad Request + */ + 400: FailureFailure; + /** + * Internal Server Error + */ + 500: FailureFailure; +}; + +export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; + +export type PostApiVbyApiVersionBodyResponses = { + /** + * OK + */ + 200: ResponsePostActivityResponse; +}; + +export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts new file mode 100644 index 000000000..861ca8e05 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts @@ -0,0 +1,708 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, serviceWithEmptyTag, patchApiVbyApiVersionNoTag, fooWow, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, callWithDescriptions, callWithParameters, callWithWeirdParameterNames, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, complexTypes, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, postApiVbyApiVersionBody } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError } from '@tanstack/svelte-query'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); + +export const serviceWithEmptyTagOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await serviceWithEmptyTag({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: serviceWithEmptyTagQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); + +export const postApiVbyApiVersionBodyOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionBodyMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts new file mode 100644 index 000000000..8c3eadef9 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts @@ -0,0 +1,277 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const serviceWithEmptyTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions/', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options + }); +}; + +export const callWithDefaultParameters = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Body should not be unknown + * Body should not be unknown + */ +export const postApiVbyApiVersionBody = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/body', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts new file mode 100644 index 000000000..56640474e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts @@ -0,0 +1,1164 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + foo?: string; + bar?: string; +}>; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a type-only model that defines Date as a string + */ +export type _Date = string; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp: string | null; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +export type Default = { + name?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ParameterActivityParams = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity?: number; + post_id?: number; +}; + +export type ResponsePostActivityResponse = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity_id?: number; + post_id?: number; +}; + +export type FailureFailure = { + error?: string; + message?: string; + reference_code?: string; +}; + +export type ServiceWithEmptyTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions/'; +}; + +export type CallWithParametersData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter that goes into the query params + */ + parameterQuery: string; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query: { + /** + * This is a simple string with default value + */ + parameterString: string; + /** + * This is a simple number with default value + */ + parameterNumber: number; + /** + * This is a simple boolean with default value + */ + parameterBoolean: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + }; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: string; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: NonAsciiStringæøåÆøÅöôêÊ字符串; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PostApiVbyApiVersionBodyData = { + /** + * Body should not be unknown + */ + body: ParameterActivityParams; + path?: never; + query?: never; + url: '/api/v{api-version}/body'; +}; + +export type PostApiVbyApiVersionBodyErrors = { + /** + * Bad Request + */ + 400: FailureFailure; + /** + * Internal Server Error + */ + 500: FailureFailure; +}; + +export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; + +export type PostApiVbyApiVersionBodyResponses = { + /** + * OK + */ + 200: ResponsePostActivityResponse; +}; + +export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts new file mode 100644 index 000000000..b55f69dd6 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts @@ -0,0 +1,708 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, DefaultService, SimpleService, DescriptionsService, ParametersService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, ComplexService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; +import { queryOptions, type UseMutationOptions, type DefaultError } from '@tanstack/vue-query'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); + +export const serviceWithEmptyTagOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.serviceWithEmptyTag({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: serviceWithEmptyTagQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NoContentService.callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await CollectionFormatService.collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await TypesService.types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ComplexService.complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); + +export const postApiVbyApiVersionBodyOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.postApiVbyApiVersionBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionBodyMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.postApiVbyApiVersionBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts new file mode 100644 index 000000000..bfd6beb48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts @@ -0,0 +1,356 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export class DefaultService { + public static serviceWithEmptyTag(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static patchApiVbyApiVersionNoTag(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static fooWow(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + /** + * Body should not be unknown + * Body should not be unknown + */ + public static postApiVbyApiVersionBody(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/body', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class SimpleService { + public static deleteCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static getCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static headCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static optionsCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static patchCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static postCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static putCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); + } + +} + +export class DescriptionsService { + public static callWithDescriptions(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions/', + ...options + }); + } + +} + +export class ParametersService { + public static callWithParameters(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options + }); + } + + public static callWithWeirdParameterNames(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options + }); + } + +} + +export class DefaultsService { + public static callWithDefaultParameters(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callWithDefaultOptionalParameters(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callToTestOrderOfParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + +} + +export class DuplicateService { + public static duplicateName(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName2(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName3(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName4(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + +} + +export class NoContentService { + public static callWithNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); + } + + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + +} + +export class ResponseService { + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + + public static callWithResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithDuplicateResponses(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithResponses(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); + } + +} + +export class MultipleTags1Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags2Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags3Service { + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class CollectionFormatService { + public static collectionFormat(options: Options) { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/collectionFormat', + ...options + }); + } + +} + +export class TypesService { + public static types(options: Options) { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/types', + ...options + }); + } + +} + +export class ComplexService { + public static complexTypes(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); + } + +} + +export class HeaderService { + public static callWithResultFromHeader(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); + } + +} + +export class ErrorService { + public static testErrorCode(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/types.gen.ts new file mode 100644 index 000000000..56640474e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/types.gen.ts @@ -0,0 +1,1164 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + foo?: string; + bar?: string; +}>; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a type-only model that defines Date as a string + */ +export type _Date = string; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp: string | null; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +export type Default = { + name?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ParameterActivityParams = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity?: number; + post_id?: number; +}; + +export type ResponsePostActivityResponse = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity_id?: number; + post_id?: number; +}; + +export type FailureFailure = { + error?: string; + message?: string; + reference_code?: string; +}; + +export type ServiceWithEmptyTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions/'; +}; + +export type CallWithParametersData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter that goes into the query params + */ + parameterQuery: string; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query: { + /** + * This is a simple string with default value + */ + parameterString: string; + /** + * This is a simple number with default value + */ + parameterNumber: number; + /** + * This is a simple boolean with default value + */ + parameterBoolean: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + }; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: string; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: NonAsciiStringæøåÆøÅöôêÊ字符串; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PostApiVbyApiVersionBodyData = { + /** + * Body should not be unknown + */ + body: ParameterActivityParams; + path?: never; + query?: never; + url: '/api/v{api-version}/body'; +}; + +export type PostApiVbyApiVersionBodyErrors = { + /** + * Bad Request + */ + 400: FailureFailure; + /** + * Internal Server Error + */ + 500: FailureFailure; +}; + +export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; + +export type PostApiVbyApiVersionBodyResponses = { + /** + * OK + */ + 200: ResponsePostActivityResponse; +}; + +export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts new file mode 100644 index 000000000..53685b154 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts @@ -0,0 +1,709 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, serviceWithEmptyTag, patchApiVbyApiVersionNoTag, fooWow, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, callWithDescriptions, callWithParameters, callWithWeirdParameterNames, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, complexTypes, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, postApiVbyApiVersionBody } from '../sdk.gen'; +import { queryOptions, type UseMutationOptions, type DefaultError } from '@tanstack/vue-query'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; +import type { AxiosError } from 'axios'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); + +export const serviceWithEmptyTagOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await serviceWithEmptyTag({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: serviceWithEmptyTagQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); + +export const postApiVbyApiVersionBodyOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionBodyMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts new file mode 100644 index 000000000..1d97df8bc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts new file mode 100644 index 000000000..dac17aaa1 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts @@ -0,0 +1,277 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-axios'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const serviceWithEmptyTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions/', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options + }); +}; + +export const callWithDefaultParameters = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Body should not be unknown + * Body should not be unknown + */ +export const postApiVbyApiVersionBody = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/body', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/types.gen.ts new file mode 100644 index 000000000..b8bb1830f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/types.gen.ts @@ -0,0 +1,1164 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + foo?: string; + bar?: string; +}>; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a type-only model that defines Date as a string + */ +export type _Date = string; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp: string | null; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +export type Default = { + name?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ParameterActivityParams = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity?: number; + post_id?: number; +}; + +export type ResponsePostActivityResponse = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity_id?: number; + post_id?: number; +}; + +export type FailureFailure = { + error?: string; + message?: string; + reference_code?: string; +}; + +export type ServiceWithEmptyTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions/'; +}; + +export type CallWithParametersData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter that goes into the query params + */ + parameterQuery: string; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query: { + /** + * This is a simple string with default value + */ + parameterString: string; + /** + * This is a simple number with default value + */ + parameterNumber: number; + /** + * This is a simple boolean with default value + */ + parameterBoolean: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + }; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: string; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: NonAsciiStringæøåÆøÅöôêÊ字符串; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PostApiVbyApiVersionBodyData = { + /** + * Body should not be unknown + */ + body: ParameterActivityParams; + path?: never; + query?: never; + url: '/api/v{api-version}/body'; +}; + +export type PostApiVbyApiVersionBodyErrors = { + /** + * Bad Request + */ + 400: FailureFailure; + /** + * Internal Server Error + */ + 500: FailureFailure; +}; + +export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; + +export type PostApiVbyApiVersionBodyResponses = { + /** + * OK + */ + 200: ResponsePostActivityResponse; +}; + +export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts new file mode 100644 index 000000000..932ae795e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts @@ -0,0 +1,708 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, serviceWithEmptyTag, patchApiVbyApiVersionNoTag, fooWow, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, callWithDescriptions, callWithParameters, callWithWeirdParameterNames, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, complexTypes, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, postApiVbyApiVersionBody } from '../sdk.gen'; +import { queryOptions, type UseMutationOptions, type DefaultError } from '@tanstack/vue-query'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); + +export const serviceWithEmptyTagOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await serviceWithEmptyTag({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: serviceWithEmptyTagQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); + +export const postApiVbyApiVersionBodyOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionBodyMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts new file mode 100644 index 000000000..8c3eadef9 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts @@ -0,0 +1,277 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const serviceWithEmptyTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions/', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options + }); +}; + +export const callWithDefaultParameters = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Body should not be unknown + * Body should not be unknown + */ +export const postApiVbyApiVersionBody = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/body', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/types.gen.ts new file mode 100644 index 000000000..56640474e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/types.gen.ts @@ -0,0 +1,1164 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + foo?: string; + bar?: string; +}>; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a type-only model that defines Date as a string + */ +export type _Date = string; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp: string | null; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +export type Default = { + name?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ParameterActivityParams = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity?: number; + post_id?: number; +}; + +export type ResponsePostActivityResponse = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity_id?: number; + post_id?: number; +}; + +export type FailureFailure = { + error?: string; + message?: string; + reference_code?: string; +}; + +export type ServiceWithEmptyTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions/'; +}; + +export type CallWithParametersData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter that goes into the query params + */ + parameterQuery: string; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query: { + /** + * This is a simple string with default value + */ + parameterString: string; + /** + * This is a simple number with default value + */ + parameterNumber: number; + /** + * This is a simple boolean with default value + */ + parameterBoolean: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + }; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: string; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: NonAsciiStringæøåÆøÅöôêÊ字符串; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PostApiVbyApiVersionBodyData = { + /** + * Body should not be unknown + */ + body: ParameterActivityParams; + path?: never; + query?: never; + url: '/api/v{api-version}/body'; +}; + +export type PostApiVbyApiVersionBodyErrors = { + /** + * Bad Request + */ + 400: FailureFailure; + /** + * Internal Server Error + */ + 500: FailureFailure; +}; + +export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; + +export type PostApiVbyApiVersionBodyResponses = { + /** + * OK + */ + 200: ResponsePostActivityResponse; +}; + +export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/fastify.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/fastify.gen.ts new file mode 100644 index 000000000..9edc94612 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/fastify.gen.ts @@ -0,0 +1,74 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, CallWithNoContentResponseResponses, CallWithResponseAndNoContentResponseResponses, DummyAResponses, DummyBResponses, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponses, CallWithResponsesErrors, CallWithResponsesResponses, CollectionFormatData, TypesData, TypesResponses, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponses, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Responses, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyErrors, PostApiVbyApiVersionBodyResponses } from './types.gen'; +import type { RouteHandler } from 'fastify'; + +export type RouteHandlers = { + callWithDescriptions: RouteHandler<{ + Querystring?: CallWithDescriptionsData['query']; + }>; + callWithParameters: RouteHandler<{ + Headers: CallWithParametersData['headers']; + Params: CallWithParametersData['path']; + Querystring: CallWithParametersData['query']; + }>; + callWithWeirdParameterNames: RouteHandler<{ + Headers: CallWithWeirdParameterNamesData['headers']; + Params: CallWithWeirdParameterNamesData['path']; + Querystring: CallWithWeirdParameterNamesData['query']; + }>; + callWithDefaultParameters: RouteHandler<{ + Querystring: CallWithDefaultParametersData['query']; + }>; + callWithDefaultOptionalParameters: RouteHandler<{ + Querystring?: CallWithDefaultOptionalParametersData['query']; + }>; + callToTestOrderOfParams: RouteHandler<{ + Querystring: CallToTestOrderOfParamsData['query']; + }>; + callWithNoContentResponse: RouteHandler<{ + Reply: CallWithNoContentResponseResponses; + }>; + callWithResponseAndNoContentResponse: RouteHandler<{ + Reply: CallWithResponseAndNoContentResponseResponses; + }>; + dummyA: RouteHandler<{ + Reply: DummyAResponses; + }>; + dummyB: RouteHandler<{ + Reply: DummyBResponses; + }>; + callWithDuplicateResponses: RouteHandler<{ + Reply: Omit & CallWithDuplicateResponsesResponses; + }>; + callWithResponses: RouteHandler<{ + Reply: Omit & CallWithResponsesResponses; + }>; + collectionFormat: RouteHandler<{ + Querystring: CollectionFormatData['query']; + }>; + types: RouteHandler<{ + Params?: TypesData['path']; + Querystring: TypesData['query']; + Reply: TypesResponses; + }>; + complexTypes: RouteHandler<{ + Querystring: ComplexTypesData['query']; + Reply: ComplexTypesErrors & ComplexTypesResponses; + }>; + callWithResultFromHeader: RouteHandler<{ + Reply: CallWithResultFromHeaderErrors & CallWithResultFromHeaderResponses; + }>; + testErrorCode: RouteHandler<{ + Querystring: TestErrorCodeData['query']; + Reply: TestErrorCodeErrors & TestErrorCodeResponses; + }>; + nonAsciiæøåÆøÅöôêÊ字符串: RouteHandler<{ + Querystring: NonAsciiæøåÆøÅöôêÊ字符串Data['query']; + Reply: NonAsciiæøåÆøÅöôêÊ字符串Responses; + }>; + postApiVbyApiVersionBody: RouteHandler<{ + Body: PostApiVbyApiVersionBodyData['body']; + Reply: PostApiVbyApiVersionBodyErrors & PostApiVbyApiVersionBodyResponses; + }>; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/types.gen.ts new file mode 100644 index 000000000..56640474e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/types.gen.ts @@ -0,0 +1,1164 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + foo?: string; + bar?: string; +}>; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a type-only model that defines Date as a string + */ +export type _Date = string; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp: string | null; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +export type Default = { + name?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ParameterActivityParams = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity?: number; + post_id?: number; +}; + +export type ResponsePostActivityResponse = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity_id?: number; + post_id?: number; +}; + +export type FailureFailure = { + error?: string; + message?: string; + reference_code?: string; +}; + +export type ServiceWithEmptyTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions/'; +}; + +export type CallWithParametersData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter that goes into the query params + */ + parameterQuery: string; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + body?: never; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query: { + /** + * This is a simple string with default value + */ + parameterString: string; + /** + * This is a simple number with default value + */ + parameterNumber: number; + /** + * This is a simple boolean with default value + */ + parameterBoolean: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: unknown; +}; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithString; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + }; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: string; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: NonAsciiStringæøåÆøÅöôêÊ字符串; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PostApiVbyApiVersionBodyData = { + /** + * Body should not be unknown + */ + body: ParameterActivityParams; + path?: never; + query?: never; + url: '/api/v{api-version}/body'; +}; + +export type PostApiVbyApiVersionBodyErrors = { + /** + * Bad Request + */ + 400: FailureFailure; + /** + * Internal Server Error + */ + 500: FailureFailure; +}; + +export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; + +export type PostApiVbyApiVersionBodyResponses = { + /** + * OK + */ + 200: ResponsePostActivityResponse; +}; + +export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/zod/default/zod.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/zod/default/zod.gen.ts new file mode 100644 index 000000000..08f27248d --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/zod/default/zod.gen.ts @@ -0,0 +1,271 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { z } from 'zod'; + +export const zCommentWithBreaks = z.number().int(); + +export const zCommentWithBackticks = z.number().int(); + +export const zCommentWithBackticksAndQuotes = z.number().int(); + +export const zCommentWithSlashes = z.number().int(); + +export const zCommentWithExpressionPlaceholders = z.number().int(); + +export const zCommentWithQuotes = z.number().int(); + +export const zCommentWithReservedCharacters = z.number().int(); + +export const zSimpleInteger = z.number().int(); + +export const zSimpleBoolean = z.boolean(); + +export const zSimpleString = z.string(); + +export const zNonAsciiStringæøåÆøÅöôêÊ字符串 = z.string(); + +export const zSimpleFile = z.string(); + +export const zModelWithString = z.object({ + prop: z.string().optional() +}); + +export const zSimpleReference = zModelWithString; + +export const zSimpleStringWithPattern = z.string().max(64).regex(/^[a-zA-Z0-9_]*$/); + +export const zEnumWithStrings = z.enum([ + 'Success', + 'Warning', + 'Error', + "'Single Quote'", + '"Double Quotes"', + 'Non-ascii: øæåôöØÆÅÔÖ字符串' +]); + +export const zEnumWithNumbers = z.unknown(); + +export const zEnumFromDescription = z.number(); + +export const zEnumWithExtensions = z.unknown(); + +export const zArrayWithNumbers = z.array(z.number().int()); + +export const zArrayWithBooleans = z.array(z.boolean()); + +export const zArrayWithStrings = z.array(z.string()); + +export const zArrayWithReferences = z.array(zModelWithString); + +export const zArrayWithArray = z.array(z.array(zModelWithString)); + +export const zArrayWithProperties = z.array(z.object({ + foo: z.string().optional(), + bar: z.string().optional() +})); + +export const zDictionaryWithString = z.object({}); + +export const zDictionaryWithReference = z.object({}); + +export const zDictionaryWithArray = z.object({}); + +export const zDictionaryWithDictionary = z.object({}); + +export const zDictionaryWithProperties = z.object({}); + +export const zDate = z.string(); + +export const zModelWithInteger = z.object({ + prop: z.number().int().optional() +}); + +export const zModelWithBoolean = z.object({ + prop: z.boolean().optional() +}); + +export const zModelWithStringError = z.object({ + prop: z.string().optional() +}); + +export const zModelWithNullableString = z.object({ + nullableProp: z.union([ + z.string(), + z.null() + ]).optional(), + nullableRequiredProp: z.union([ + z.string(), + z.null() + ]) +}); + +export const zModelWithEnum = z.object({ + test: z.enum([ + 'Success', + 'Warning', + 'Error', + 'ØÆÅ字符串' + ]).optional(), + statusCode: z.enum([ + '100', + '200 FOO', + '300 FOO_BAR', + '400 foo-bar', + '500 foo.bar', + '600 foo&bar' + ]).optional(), + bool: z.unknown().optional() +}); + +export const zModelWithEnumFromDescription = z.object({ + test: z.number().int().optional() +}); + +export const zModelWithNestedEnums = z.object({ + dictionaryWithEnum: z.object({}).optional(), + dictionaryWithEnumFromDescription: z.object({}).optional(), + arrayWithEnum: z.array(z.enum([ + 'Success', + 'Warning', + 'Error' + ])).optional(), + arrayWithDescription: z.array(z.number().int()).optional() +}); + +export const zModelWithProperties = z.object({ + required: z.string(), + requiredAndReadOnly: z.string().readonly(), + string: z.string().optional(), + number: z.number().optional(), + boolean: z.boolean().optional(), + reference: zModelWithString.optional(), + 'property with space': z.string().optional(), + default: z.string().optional(), + try: z.string().optional(), + '@namespace.string': z.string().readonly().optional(), + '@namespace.integer': z.number().int().readonly().optional() +}); + +export const zModelWithReference = z.object({ + prop: zModelWithProperties.optional() +}); + +export const zModelWithArray = z.object({ + prop: z.array(zModelWithString).optional(), + propWithFile: z.array(z.string()).optional(), + propWithNumber: z.array(z.number()).optional() +}); + +export const zModelWithDictionary = z.object({ + prop: z.object({}).optional() +}); + +export const zModelWithCircularReference: z.AnyZodObject = z.object({ + prop: z.lazy(() => { + return zModelWithCircularReference; + }).optional() +}); + +export const zModelWithNestedProperties = z.object({ + first: z.object({ + second: z.object({ + third: z.string().readonly() + }).readonly() + }).readonly() +}); + +export const zModelWithDuplicateProperties = z.object({ + prop: zModelWithString.optional() +}); + +export const zModelWithOrderedProperties = z.object({ + zebra: z.string().optional(), + apple: z.string().optional(), + hawaii: z.string().optional() +}); + +export const zModelWithDuplicateImports = z.object({ + propA: zModelWithString.optional(), + propB: zModelWithString.optional(), + propC: zModelWithString.optional() +}); + +export const zModelThatExtends = zModelWithString.merge(z.object({ + propExtendsA: z.string().optional(), + propExtendsB: zModelWithString.optional() +})); + +export const zModelThatExtendsExtends = zModelWithString.merge(zModelThatExtends).merge(z.object({ + propExtendsC: z.string().optional(), + propExtendsD: zModelWithString.optional() +})); + +export const zDefault = z.object({ + name: z.string().optional() +}); + +export const zModelWithPattern = z.object({ + key: z.string().max(64).regex(/^[a-zA-Z0-9_]*$/), + name: z.string().max(255), + enabled: z.boolean().readonly().optional(), + modified: z.string().datetime().readonly().optional(), + id: z.string().regex(/^\d{2}-\d{3}-\d{4}$/).optional(), + text: z.string().regex(/^\w+$/).optional(), + patternWithSingleQuotes: z.string().regex(/^[a-zA-Z0-9']*$/).optional(), + patternWithNewline: z.string().regex(/aaa\nbbb/).optional(), + patternWithBacktick: z.string().regex(/aaa`bbb/).optional() +}); + +export const zParameterActivityParams = z.object({ + description: z.string().optional(), + graduate_id: z.number().int().optional(), + organization_id: z.number().int().optional(), + parent_activity: z.number().int().optional(), + post_id: z.number().int().optional() +}); + +export const zResponsePostActivityResponse = z.object({ + description: z.string().optional(), + graduate_id: z.number().int().optional(), + organization_id: z.number().int().optional(), + parent_activity_id: z.number().int().optional(), + post_id: z.number().int().optional() +}); + +export const zFailureFailure = z.object({ + error: z.string().optional(), + message: z.string().optional(), + reference_code: z.string().optional() +}); + +export const zCallWithResponseAndNoContentResponseResponse = z.union([ + z.number(), + z.unknown() +]); + +export const zCallWithResponseResponse = zModelWithString; + +export const zCallWithDuplicateResponsesResponse = zModelWithString; + +export const zCallWithResponsesResponse = z.union([ + z.object({ + '@namespace.string': z.string().readonly().optional(), + '@namespace.integer': z.number().int().readonly().optional(), + value: z.array(zModelWithString).readonly().optional() + }), + zModelThatExtends, + zModelThatExtendsExtends +]); + +export const zTypesResponse = z.union([ + z.number(), + z.string(), + z.boolean(), + z.object({}) +]); + +export const zComplexTypesResponse = z.array(zModelWithString); + +export const zNonAsciiæøåÆøÅöôêÊ字符串Response = zNonAsciiStringæøåÆøÅöôêÊ字符串; + +export const zPostApiVbyApiVersionBodyResponse = zResponsePostActivityResponse; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/types.gen.ts new file mode 100644 index 000000000..00a719fc6 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/types.gen.ts @@ -0,0 +1,37 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type FooReadReadable = BarReadReadable & { + readonly foo?: string; +}; + +export type FooReadWritable = BarReadWritable; + +export type BarReadReadable = Baz & { + readonly bar?: string; +}; + +export type BarReadWritable = Baz; + +export type Baz = { + baz?: string; +}; + +export type PostFooReadData = { + body: FooReadWritable; + path?: never; + query?: never; + url: '/foo-read'; +}; + +export type PostFooReadResponses = { + /** + * OK + */ + 200: FooReadReadable; +}; + +export type PostFooReadResponse = PostFooReadResponses[keyof PostFooReadResponses]; + +export type ClientOptions = { + baseUrl: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/sdk.gen.ts new file mode 100644 index 000000000..60211f6ff --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/sdk.gen.ts @@ -0,0 +1,33 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { SendEmailData, SendEmailResponse2, SendEmailError } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +/** + * Send a single email + */ +export const sendEmail = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/email', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/types.gen.ts new file mode 100644 index 000000000..fcf50280e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/types.gen.ts @@ -0,0 +1,136 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type SendEmailRequest = { + /** + * The sender email address. Must have a registered and confirmed Sender Signature. + */ + From?: string; + /** + * Recipient email address. Multiple addresses are comma seperated. Max 50. + */ + To?: string; + /** + * Recipient email address. Multiple addresses are comma seperated. Max 50. + */ + Cc?: string; + /** + * Bcc recipient email address. Multiple addresses are comma seperated. Max 50. + */ + Bcc?: string; + /** + * Email Subject + */ + Subject?: string; + /** + * Email tag that allows you to categorize outgoing emails and get detailed statistics. + */ + Tag?: string; + /** + * If no TextBody specified HTML email message + */ + HtmlBody?: string; + /** + * If no HtmlBody specified Plain text email message + */ + TextBody?: string; + /** + * Reply To override email address. Defaults to the Reply To set in the sender signature. + */ + ReplyTo?: string; + /** + * Activate open tracking for this email. + */ + TrackOpens?: boolean; + /** + * Replace links in content to enable "click tracking" stats. Default is 'null', which uses the server's LinkTracking setting'. + */ + TrackLinks?: 'None' | 'HtmlAndText' | 'HtmlOnly' | 'TextOnly'; + Headers?: HeaderCollection; + Attachments?: AttachmentCollection; +}; + +/** + * A single header for an email message. + */ +export type MessageHeader = { + /** + * The header's name. + */ + Name?: string; + /** + * The header's value. + */ + Value?: string; +}; + +export type HeaderCollection = Array; + +/** + * An attachment for an email message. + */ +export type Attachment = { + Name?: string; + Content?: string; + ContentType?: string; + ContentID?: string; +}; + +export type AttachmentCollection = Array; + +/** + * The standard response when a postmark message is sent + */ +export type SendEmailResponse = { + To?: string; + SubmittedAt?: string; + MessageID?: string; + ErrorCode?: number; + Message?: string; +}; + +/** + * A Postmark API error. + */ +export type StandardPostmarkResponse = { + ErrorCode?: number; + Message?: string; +}; + +export type SendEmailData = { + body?: SendEmailRequest; + headers: { + /** + * The token associated with the Server on which this request will operate. + */ + 'X-Postmark-Server-Token': string; + }; + path?: never; + query?: never; + url: '/email'; +}; + +export type SendEmailErrors = { + /** + * An error was generated due to incorrect use of the API. See the Message associated with this response for more information. + */ + 422: StandardPostmarkResponse; + /** + * Indicates an internal server error occurred. + */ + 500: unknown; +}; + +export type SendEmailError = SendEmailErrors[keyof SendEmailErrors]; + +export type SendEmailResponses = { + /** + * OK + */ + 200: SendEmailResponse; +}; + +export type SendEmailResponse2 = SendEmailResponses[keyof SendEmailResponses]; + +export type ClientOptions = { + baseUrl: `${string}://api.postmarkapp.com` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/sdk.gen.ts new file mode 100644 index 000000000..2bd416990 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/sdk.gen.ts @@ -0,0 +1,33 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { GetFooData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const getFoo = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + security: [ + { + in: 'query', + name: 'foo', + type: 'apiKey' + } + ], + url: '/foo', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/types.gen.ts new file mode 100644 index 000000000..a53fefa03 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/types.gen.ts @@ -0,0 +1,19 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type ClientOptions = { + baseUrl: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/sdk.gen.ts new file mode 100644 index 000000000..69fd85eda --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/sdk.gen.ts @@ -0,0 +1,32 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { GetFooData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const getFoo = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + security: [ + { + scheme: 'basic', + type: 'http' + } + ], + url: '/foo', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/types.gen.ts new file mode 100644 index 000000000..a53fefa03 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/types.gen.ts @@ -0,0 +1,19 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type ClientOptions = { + baseUrl: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-false/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-false/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/security-false/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-false/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-false/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/security-false/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-false/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-false/sdk.gen.ts new file mode 100644 index 000000000..14ebd7036 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/security-false/sdk.gen.ts @@ -0,0 +1,26 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { GetFooData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const getFoo = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/foo', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-false/types.gen.ts new file mode 100644 index 000000000..a53fefa03 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/security-false/types.gen.ts @@ -0,0 +1,19 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type ClientOptions = { + baseUrl: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/sdk.gen.ts new file mode 100644 index 000000000..bcb05a226 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/sdk.gen.ts @@ -0,0 +1,32 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { GetFooData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const getFoo = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + security: [ + { + scheme: 'bearer', + type: 'http' + } + ], + url: '/foo', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/types.gen.ts new file mode 100644 index 000000000..a53fefa03 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/types.gen.ts @@ -0,0 +1,19 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type ClientOptions = { + baseUrl: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/types.gen.ts new file mode 100644 index 000000000..6906f1774 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/types.gen.ts @@ -0,0 +1,21 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: string; +}; + +export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}/v1` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/servers-host/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/servers-host/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/servers-host/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/servers-host/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/servers-host/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/servers-host/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/servers-host/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/servers-host/types.gen.ts new file mode 100644 index 000000000..b39de6295 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/servers-host/types.gen.ts @@ -0,0 +1,21 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: string; +}; + +export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; + +export type ClientOptions = { + baseUrl: `${string}://foo.com` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/servers/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/servers/client.gen.ts new file mode 100644 index 000000000..89e76c00f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/servers/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'https://foo.com/v1' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/servers/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/servers/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/servers/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/servers/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/servers/types.gen.ts new file mode 100644 index 000000000..499949960 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/2.0.x/servers/types.gen.ts @@ -0,0 +1,21 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: string; +}; + +export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; + +export type ClientOptions = { + baseUrl: 'https://foo.com/v1' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-false/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-false/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-false/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-false/types.gen.ts new file mode 100644 index 000000000..6b84c8ade --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-false/types.gen.ts @@ -0,0 +1,17 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + foo: string; +}; + +export type Bar = Foo & { + [key: string]: never; +}; + +export type Baz = Foo & { + bar: string; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-true/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-true/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-true/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-true/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-true/types.gen.ts new file mode 100644 index 000000000..83d16749a --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-true/types.gen.ts @@ -0,0 +1,21 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + foo: string; + [key: string]: unknown | string; +}; + +export type Bar = Foo & { + [key: string]: unknown; +}; + +export type Baz = Foo & { + bar: string; + [key: string]: unknown | string; +}; + +export type Qux = {}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-undefined/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-undefined/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-undefined/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-undefined/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-undefined/types.gen.ts new file mode 100644 index 000000000..cb1ed0592 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-undefined/types.gen.ts @@ -0,0 +1,11 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + foo: { + [key: string]: unknown; + }; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/array-items-one-of-length-1/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/array-items-one-of-length-1/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/array-items-one-of-length-1/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/array-items-one-of-length-1/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/array-items-one-of-length-1/types.gen.ts new file mode 100644 index 000000000..b133cfb1a --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/array-items-one-of-length-1/types.gen.ts @@ -0,0 +1,11 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + foo?: Array; +}; + +export type Bar = string; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/sdk.gen.ts new file mode 100644 index 000000000..d305a220c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/sdk.gen.ts @@ -0,0 +1,31 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { PostFooData, PostFooResponse } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const postFoo = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + bodySerializer: null, + url: '/foo', + ...options, + headers: { + 'Content-Type': 'text/plain', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/types.gen.ts new file mode 100644 index 000000000..ff0becc55 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/types.gen.ts @@ -0,0 +1,21 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type PostFooData = { + body: string; + path?: never; + query?: never; + url: '/foo'; +}; + +export type PostFooResponses = { + /** + * OK + */ + 200: string; +}; + +export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/case-PascalCase/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/case-PascalCase/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/case-PascalCase/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/case-PascalCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/case-PascalCase/types.gen.ts new file mode 100644 index 000000000..45f3cd481 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/case-PascalCase/types.gen.ts @@ -0,0 +1,89 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * original name: 201 + */ +export type _201 = number; + +/** + * original name: Foo + */ +export type Foo = { + /** + * original name: fooBar + */ + fooBar: FooBar; + /** + * original name: BarBaz + */ + BarBaz: Foo; + /** + * original name: qux_quux + */ + qux_quux: { + /** + * original name: fooBar + */ + fooBar: FooBar2; + /** + * original name: BarBaz + */ + BarBaz: FooBar3; + /** + * original name: qux_quux + */ + qux_quux: boolean; + }; +}; + +/** + * original name: foo_bar + */ +export type FooBar = boolean; + +/** + * original name: fooBar + */ +export type FooBar2 = number; + +/** + * original name: FooBar + */ +export type FooBar3 = string; + +export type GetFooData = { + body: Foo; + path?: never; + query: { + /** + * original name: fooBar + */ + fooBar: string; + /** + * original name: BarBaz + */ + BarBaz: string; + /** + * original name: qux_quux + */ + qux_quux: string; + }; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: Foo; + /** + * OK + */ + 201: _201; +}; + +export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/case-camelCase/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/case-camelCase/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/case-camelCase/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/case-camelCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/case-camelCase/types.gen.ts new file mode 100644 index 000000000..2b4016129 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/case-camelCase/types.gen.ts @@ -0,0 +1,89 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * original name: 201 + */ +export type _201 = number; + +/** + * original name: Foo + */ +export type foo = { + /** + * original name: fooBar + */ + fooBar: fooBar; + /** + * original name: BarBaz + */ + BarBaz: foo; + /** + * original name: qux_quux + */ + qux_quux: { + /** + * original name: fooBar + */ + fooBar: fooBar2; + /** + * original name: BarBaz + */ + BarBaz: fooBar3; + /** + * original name: qux_quux + */ + qux_quux: boolean; + }; +}; + +/** + * original name: foo_bar + */ +export type fooBar = boolean; + +/** + * original name: fooBar + */ +export type fooBar2 = number; + +/** + * original name: FooBar + */ +export type fooBar3 = string; + +export type getFooData = { + body: foo; + path?: never; + query: { + /** + * original name: fooBar + */ + fooBar: string; + /** + * original name: BarBaz + */ + BarBaz: string; + /** + * original name: qux_quux + */ + qux_quux: string; + }; + url: '/foo'; +}; + +export type getFooResponses = { + /** + * OK + */ + 200: foo; + /** + * OK + */ + 201: _201; +}; + +export type getFooResponse = getFooResponses[keyof getFooResponses]; + +export type clientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/case-snake_case/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/case-snake_case/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/case-snake_case/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/case-snake_case/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/case-snake_case/types.gen.ts new file mode 100644 index 000000000..0e7c47f83 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/case-snake_case/types.gen.ts @@ -0,0 +1,89 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * original name: 201 + */ +export type _201 = number; + +/** + * original name: Foo + */ +export type foo = { + /** + * original name: fooBar + */ + fooBar: foo_bar; + /** + * original name: BarBaz + */ + BarBaz: foo; + /** + * original name: qux_quux + */ + qux_quux: { + /** + * original name: fooBar + */ + fooBar: foo_bar2; + /** + * original name: BarBaz + */ + BarBaz: foo_bar3; + /** + * original name: qux_quux + */ + qux_quux: boolean; + }; +}; + +/** + * original name: foo_bar + */ +export type foo_bar = boolean; + +/** + * original name: fooBar + */ +export type foo_bar2 = number; + +/** + * original name: FooBar + */ +export type foo_bar3 = string; + +export type get_foo_data = { + body: foo; + path?: never; + query: { + /** + * original name: fooBar + */ + fooBar: string; + /** + * original name: BarBaz + */ + BarBaz: string; + /** + * original name: qux_quux + */ + qux_quux: string; + }; + url: '/foo'; +}; + +export type get_foo_responses = { + /** + * OK + */ + 200: foo; + /** + * OK + */ + 201: _201; +}; + +export type get_foo_response = get_foo_responses[keyof get_foo_responses]; + +export type client_options = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/case/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/case/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/case/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/case/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/case/types.gen.ts new file mode 100644 index 000000000..0118c79fe --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/case/types.gen.ts @@ -0,0 +1,89 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * original name: 201 + */ +export type _201 = number; + +/** + * original name: Foo + */ +export type Foo = { + /** + * original name: fooBar + */ + fooBar: foo_bar; + /** + * original name: BarBaz + */ + BarBaz: Foo; + /** + * original name: qux_quux + */ + qux_quux: { + /** + * original name: fooBar + */ + fooBar: fooBar; + /** + * original name: BarBaz + */ + BarBaz: FooBar; + /** + * original name: qux_quux + */ + qux_quux: boolean; + }; +}; + +/** + * original name: foo_bar + */ +export type foo_bar = boolean; + +/** + * original name: fooBar + */ +export type fooBar = number; + +/** + * original name: FooBar + */ +export type FooBar = string; + +export type GetFoo_Data = { + body: Foo; + path?: never; + query: { + /** + * original name: fooBar + */ + fooBar: string; + /** + * original name: BarBaz + */ + BarBaz: string; + /** + * original name: qux_quux + */ + qux_quux: string; + }; + url: '/foo'; +}; + +export type GetFoo_Responses = { + /** + * OK + */ + 200: Foo; + /** + * OK + */ + 201: _201; +}; + +export type GetFoo_Response = GetFoo_Responses[keyof GetFoo_Responses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/components-request-bodies/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/components-request-bodies/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/components-request-bodies/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/components-request-bodies/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/components-request-bodies/types.gen.ts new file mode 100644 index 000000000..769d4ee8c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/components-request-bodies/types.gen.ts @@ -0,0 +1,29 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Foo + */ +export type Foo = { + page?: number; +}; + +export type PostFooData = { + /** + * Foo + */ + body: Foo; + path?: never; + query?: never; + url: '/foo'; +}; + +export type PostFooResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/content-binary/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/content-binary/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/content-binary/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/content-binary/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/content-binary/types.gen.ts new file mode 100644 index 000000000..e8a09c992 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/content-binary/types.gen.ts @@ -0,0 +1,31 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + 200: string; +}; + +export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; + +export type GetBarData = { + body?: never; + path?: never; + query?: never; + url: '/bar'; +}; + +export type GetBarResponses = { + 200: Blob | File; +}; + +export type GetBarResponse = GetBarResponses[keyof GetBarResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-all-of/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-all-of/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-all-of/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-all-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-all-of/types.gen.ts new file mode 100644 index 000000000..d74f66a4a --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-all-of/types.gen.ts @@ -0,0 +1,49 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + id: string; +}; + +export type Bar = Foo & { + id: 'Bar'; +} & { + bar?: string; +}; + +export type Baz = Foo & { + id: 'Baz'; +} & { + baz?: string; +}; + +export type Qux = Foo & { + id: 'Qux'; +} & { + qux?: boolean; +}; + +export type FooMapped = { + id: string; +}; + +export type BarMapped = FooMapped & { + id: 'bar'; +} & { + bar?: string; +}; + +export type BazMapped = FooMapped & { + id: 'baz'; +} & { + baz?: string; +}; + +export type QuxMapped = FooMapped & { + id: 'QuxMapped'; +} & { + qux?: boolean; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-any-of/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-any-of/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-any-of/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-any-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-any-of/types.gen.ts new file mode 100644 index 000000000..cdd9c641f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-any-of/types.gen.ts @@ -0,0 +1,28 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = ({ + type?: 'Bar'; +} & Bar) | ({ + type?: 'Baz'; +} & Baz); + +export type Baz = Qux; + +export type Bar = Qux; + +export type Qux = { + id: string; + type: Quux; +}; + +export type Quux = 'Bar' | 'Baz'; + +export type Quuz = ({ + type?: 'bar'; +} & Bar) | ({ + type?: 'baz'; +} & Baz); + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-mapped-many/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-mapped-many/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-mapped-many/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-mapped-many/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-mapped-many/types.gen.ts new file mode 100644 index 000000000..bbbd8dfa9 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-mapped-many/types.gen.ts @@ -0,0 +1,19 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = ({ + foo?: 'one'; +} & Bar) | ({ + foo?: 'three'; +} & Baz); + +export type Bar = { + foo?: 'one' | 'two'; +}; + +export type Baz = { + foo?: 'three'; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-one-of/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-one-of/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-one-of/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-one-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-one-of/types.gen.ts new file mode 100644 index 000000000..cdd9c641f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-one-of/types.gen.ts @@ -0,0 +1,28 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = ({ + type?: 'Bar'; +} & Bar) | ({ + type?: 'Baz'; +} & Baz); + +export type Baz = Qux; + +export type Bar = Qux; + +export type Qux = { + id: string; + type: Quux; +}; + +export type Quux = 'Bar' | 'Baz'; + +export type Quuz = ({ + type?: 'bar'; +} & Bar) | ({ + type?: 'baz'; +} & Baz); + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-escape/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-escape/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-escape/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-escape/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-escape/types.gen.ts new file mode 100644 index 000000000..d3fff794b --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-escape/types.gen.ts @@ -0,0 +1,11 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + foo?: "foo'bar" | 'foo"bar'; +}; + +export type Bar = "foo'bar" | 'foo"bar'; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-javascript/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-javascript/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-javascript/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-javascript/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-javascript/types.gen.ts new file mode 100644 index 000000000..bf1c86991 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-javascript/types.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Type = 'foo' | 'bar'; + +export const Type = { + FOO: 'foo', + BAR: 'bar' +} as const; + +export type Foo = { + type?: 'foo' | 'bar'; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript-namespace/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript-namespace/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript-namespace/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript-namespace/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript-namespace/types.gen.ts new file mode 100644 index 000000000..ef7778bd5 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript-namespace/types.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export namespace Foo { + export enum Type { + FOO = 'foo', + BAR = 'bar' + } +} + +export type Foo = { + type?: 'foo' | 'bar'; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript/types.gen.ts new file mode 100644 index 000000000..86b67e018 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript/types.gen.ts @@ -0,0 +1,14 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export enum Type { + FOO = 'foo', + BAR = 'bar' +} + +export type Foo = { + type?: 'foo' | 'bar'; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline/types.gen.ts new file mode 100644 index 000000000..de2459b6b --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline/types.gen.ts @@ -0,0 +1,11 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Type = 'foo' | 'bar'; + +export type Foo = { + type?: 'foo' | 'bar'; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-PascalCase/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-PascalCase/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-PascalCase/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-PascalCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-PascalCase/types.gen.ts new file mode 100644 index 000000000..8c89a55c8 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-PascalCase/types.gen.ts @@ -0,0 +1,48 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _110 = '1-10' | '11-20'; + +export const _110 = { + 110: '1-10', + 1120: '11-20' +} as const; + +export type MyFoo = 'myFoo' | 'myBar'; + +export const MyFoo = { + MyFoo: 'myFoo', + MyBar: 'myBar' +} as const; + +export type MyFoo2 = 'MyFoo' | 'MyBar'; + +export const MyFoo2 = { + MyFoo: 'MyFoo', + MyBar: 'MyBar' +} as const; + +export type Foo = 'foo' | 'bar' | null | '' | true | false; + +export const Foo = { + Foo: 'foo', + Bar: 'bar', + Null: null, + '': '', + True: true, + False: false +} as const; + +export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; + +export const Numbers = { + 100: 100, + 200: 200, + 300: 300, + '-100': -100, + '-200': -200, + '-300': -300 +} as const; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts new file mode 100644 index 000000000..66f2f4dc0 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts @@ -0,0 +1,48 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _110 = '1-10' | '11-20'; + +export const _110 = { + '1_10': '1-10', + '11_20': '11-20' +} as const; + +export type MyFoo = 'myFoo' | 'myBar'; + +export const MyFoo = { + MY_FOO: 'myFoo', + MY_BAR: 'myBar' +} as const; + +export type MyFoo2 = 'MyFoo' | 'MyBar'; + +export const MyFoo2 = { + MY_FOO: 'MyFoo', + MY_BAR: 'MyBar' +} as const; + +export type Foo = 'foo' | 'bar' | null | '' | true | false; + +export const Foo = { + FOO: 'foo', + BAR: 'bar', + NULL: null, + '': '', + TRUE: true, + FALSE: false +} as const; + +export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; + +export const Numbers = { + 100: 100, + 200: 200, + 300: 300, + '-100': -100, + '-200': -200, + '-300': -300 +} as const; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-camelCase/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-camelCase/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-camelCase/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-camelCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-camelCase/types.gen.ts new file mode 100644 index 000000000..7f0f85ab5 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-camelCase/types.gen.ts @@ -0,0 +1,48 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _110 = '1-10' | '11-20'; + +export const _110 = { + 110: '1-10', + 1120: '11-20' +} as const; + +export type MyFoo = 'myFoo' | 'myBar'; + +export const MyFoo = { + myFoo: 'myFoo', + myBar: 'myBar' +} as const; + +export type MyFoo2 = 'MyFoo' | 'MyBar'; + +export const MyFoo2 = { + myFoo: 'MyFoo', + myBar: 'MyBar' +} as const; + +export type Foo = 'foo' | 'bar' | null | '' | true | false; + +export const Foo = { + foo: 'foo', + bar: 'bar', + null: null, + '': '', + true: true, + false: false +} as const; + +export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; + +export const Numbers = { + 100: 100, + 200: 200, + 300: 300, + '-100': -100, + '-200': -200, + '-300': -300 +} as const; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-preserve/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-preserve/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-preserve/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-preserve/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-preserve/types.gen.ts new file mode 100644 index 000000000..2a631eac8 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-preserve/types.gen.ts @@ -0,0 +1,48 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _110 = '1-10' | '11-20'; + +export const _110 = { + '1-10': '1-10', + '11-20': '11-20' +} as const; + +export type MyFoo = 'myFoo' | 'myBar'; + +export const MyFoo = { + myFoo: 'myFoo', + myBar: 'myBar' +} as const; + +export type MyFoo2 = 'MyFoo' | 'MyBar'; + +export const MyFoo2 = { + MyFoo: 'MyFoo', + MyBar: 'MyBar' +} as const; + +export type Foo = 'foo' | 'bar' | null | '' | true | false; + +export const Foo = { + foo: 'foo', + bar: 'bar', + null: null, + '': '', + true: true, + false: false +} as const; + +export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; + +export const Numbers = { + 100: 100, + 200: 200, + 300: 300, + '-100': -100, + '-200': -200, + '-300': -300 +} as const; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-snake_case/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-snake_case/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-snake_case/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-snake_case/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-snake_case/types.gen.ts new file mode 100644 index 000000000..81146d8df --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-snake_case/types.gen.ts @@ -0,0 +1,48 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _110 = '1-10' | '11-20'; + +export const _110 = { + '1_10': '1-10', + '11_20': '11-20' +} as const; + +export type MyFoo = 'myFoo' | 'myBar'; + +export const MyFoo = { + my_foo: 'myFoo', + my_bar: 'myBar' +} as const; + +export type MyFoo2 = 'MyFoo' | 'MyBar'; + +export const MyFoo2 = { + my_foo: 'MyFoo', + my_bar: 'MyBar' +} as const; + +export type Foo = 'foo' | 'bar' | null | '' | true | false; + +export const Foo = { + foo: 'foo', + bar: 'bar', + null: null, + '': '', + true: true, + false: false +} as const; + +export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; + +export const Numbers = { + 100: 100, + 200: 200, + 300: 300, + '-100': -100, + '-200': -200, + '-300': -300 +} as const; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-PascalCase/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-PascalCase/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-PascalCase/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-PascalCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-PascalCase/types.gen.ts new file mode 100644 index 000000000..2f43e6815 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-PascalCase/types.gen.ts @@ -0,0 +1,31 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export enum _110 { + _110 = '1-10', + _1120 = '11-20' +} + +export enum MyFoo { + MyFoo = 'myFoo', + MyBar = 'myBar' +} + +export enum MyFoo2 { + MyFoo = 'MyFoo', + MyBar = 'MyBar' +} + +export type Foo = 'foo' | 'bar' | null | '' | true | false; + +export enum Numbers { + _100 = 100, + _200 = 200, + _300 = 300, + '_-100' = -100, + '_-200' = -200, + '_-300' = -300 +} + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts new file mode 100644 index 000000000..541fd2094 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts @@ -0,0 +1,31 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export enum _110 { + '1_10' = '1-10', + '11_20' = '11-20' +} + +export enum MyFoo { + MY_FOO = 'myFoo', + MY_BAR = 'myBar' +} + +export enum MyFoo2 { + MY_FOO = 'MyFoo', + MY_BAR = 'MyBar' +} + +export type Foo = 'foo' | 'bar' | null | '' | true | false; + +export enum Numbers { + _100 = 100, + _200 = 200, + _300 = 300, + '_-100' = -100, + '_-200' = -200, + '_-300' = -300 +} + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-camelCase/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-camelCase/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-camelCase/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-camelCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-camelCase/types.gen.ts new file mode 100644 index 000000000..49796afc5 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-camelCase/types.gen.ts @@ -0,0 +1,31 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export enum _110 { + _110 = '1-10', + _1120 = '11-20' +} + +export enum MyFoo { + myFoo = 'myFoo', + myBar = 'myBar' +} + +export enum MyFoo2 { + myFoo = 'MyFoo', + myBar = 'MyBar' +} + +export type Foo = 'foo' | 'bar' | null | '' | true | false; + +export enum Numbers { + _100 = 100, + _200 = 200, + _300 = 300, + '_-100' = -100, + '_-200' = -200, + '_-300' = -300 +} + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-preserve/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-preserve/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-preserve/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-preserve/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-preserve/types.gen.ts new file mode 100644 index 000000000..9ee13c15d --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-preserve/types.gen.ts @@ -0,0 +1,31 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export enum _110 { + '1-10' = '1-10', + '11-20' = '11-20' +} + +export enum MyFoo { + myFoo = 'myFoo', + myBar = 'myBar' +} + +export enum MyFoo2 { + MyFoo = 'MyFoo', + MyBar = 'MyBar' +} + +export type Foo = 'foo' | 'bar' | null | '' | true | false; + +export enum Numbers { + _100 = 100, + _200 = 200, + _300 = 300, + '_-100' = -100, + '_-200' = -200, + '_-300' = -300 +} + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-snake_case/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-snake_case/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-snake_case/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-snake_case/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-snake_case/types.gen.ts new file mode 100644 index 000000000..3a07bbbc6 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-snake_case/types.gen.ts @@ -0,0 +1,31 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export enum _110 { + '1_10' = '1-10', + '11_20' = '11-20' +} + +export enum MyFoo { + my_foo = 'myFoo', + my_bar = 'myBar' +} + +export enum MyFoo2 { + my_foo = 'MyFoo', + my_bar = 'MyBar' +} + +export type Foo = 'foo' | 'bar' | null | '' | true | false; + +export enum Numbers { + _100 = 100, + _200 = 200, + _300 = 300, + '_-100' = -100, + '_-200' = -200, + '_-300' = -300 +} + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values/types.gen.ts new file mode 100644 index 000000000..334fc7e35 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values/types.gen.ts @@ -0,0 +1,15 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _110 = '1-10' | '11-20'; + +export type MyFoo = 'myFoo' | 'myBar'; + +export type MyFoo2 = 'MyFoo' | 'MyBar'; + +export type Foo = 'foo' | 'bar' | null | '' | true | false; + +export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-null/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-null/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-null/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-null/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-null/types.gen.ts new file mode 100644 index 000000000..48d0f83a2 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-null/types.gen.ts @@ -0,0 +1,11 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = 'foo' | 'bar' | null; + +export type Bar = 'foo' | 'bar'; + +export type Baz = 'foo' | 'bar'; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-null/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-null/zod.gen.ts new file mode 100644 index 000000000..ef3e1daa7 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/enum-null/zod.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { z } from 'zod'; + +export const zFoo = z.enum([ + 'foo', + 'bar' +]); + +export const zBar = z.enum([ + 'foo', + 'bar' +]); + +export const zBaz = z.enum([ + 'foo', + 'bar' +]); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/exclude-deprecated/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/exclude-deprecated/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/exclude-deprecated/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/exclude-deprecated/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/exclude-deprecated/types.gen.ts new file mode 100644 index 000000000..f09b2f30d --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/exclude-deprecated/types.gen.ts @@ -0,0 +1,21 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = string; + +export type PostFooData = { + body: Foo; + path?: never; + query?: never; + url: '/foo'; +}; + +export type PostFooResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/@tanstack/react-query.gen.ts new file mode 100644 index 000000000..d2d72e484 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/@tanstack/react-query.gen.ts @@ -0,0 +1,99 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, create } from '../sdk.gen'; +import { queryOptions, type UseMutationOptions, type DefaultError } from '@tanstack/react-query'; +import type { CreateData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const createQueryKey2 = (options?: Options) => createQueryKey('create', options); + +export const createOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await create({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: createQueryKey2(options) + }); +}; + +export const createMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await create({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const createQueryKey2 = (options?: Options) => createQueryKey('create', options); + +export const createOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await create({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: createQueryKey2(options) + }); +}; + +export const createMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await create({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/sdk.gen.ts new file mode 100644 index 000000000..8f8c0777a --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/sdk.gen.ts @@ -0,0 +1,40 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { CreateData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const create = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/foo', + ...options + }); +}; + +export const create = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/foo', + ...options + }); +}; + +export const create = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/foo', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/types.gen.ts new file mode 100644 index 000000000..38b0bfb2b --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/types.gen.ts @@ -0,0 +1,47 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type CreateData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type CreateResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type CreateData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type CreateResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type CreateData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type CreateResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/operation-204/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/operation-204/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/operation-204/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/operation-204/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/operation-204/types.gen.ts new file mode 100644 index 000000000..0250e75aa --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/operation-204/types.gen.ts @@ -0,0 +1,25 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type PostFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type PostFooResponses = { + /** + * OK + */ + 200: string; + /** + * Created + */ + 204: void; +}; + +export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/client.gen.ts new file mode 100644 index 000000000..c4dedd629 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/sdk.gen.ts new file mode 100644 index 000000000..fd567117c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/sdk.gen.ts @@ -0,0 +1,32 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-axios'; +import type { PostFooData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const postFoo = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/foo', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/types.gen.ts new file mode 100644 index 000000000..e1ed1030b --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/types.gen.ts @@ -0,0 +1,21 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type PostFooData = { + body?: never; + path?: never; + query?: { + foo?: Array; + }; + url: '/foo'; +}; + +export type PostFooResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ClientOptions = { + baseURL: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/sdk.gen.ts new file mode 100644 index 000000000..b34dd5ddb --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/sdk.gen.ts @@ -0,0 +1,32 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { PostFooData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const postFoo = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/foo', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/types.gen.ts new file mode 100644 index 000000000..d69993ad2 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/types.gen.ts @@ -0,0 +1,21 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type PostFooData = { + body?: never; + path?: never; + query?: { + foo?: Array; + }; + url: '/foo'; +}; + +export type PostFooResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts new file mode 100644 index 000000000..9cc4305a3 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts @@ -0,0 +1,1987 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export const _400Schema = { + description: 'Model with number-only name', + type: 'string' +} as const; + +export const camelCaseCommentWithBreaksSchema = { + description: `Testing multiline comments in string: First line +Second line + +Fourth line`, + type: 'integer' +} as const; + +export const CommentWithBreaksSchema = { + description: `Testing multiline comments in string: First line +Second line + +Fourth line`, + type: 'integer' +} as const; + +export const CommentWithBackticksSchema = { + description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work', + type: 'integer' +} as const; + +export const CommentWithBackticksAndQuotesSchema = { + description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`, + type: 'integer' +} as const; + +export const CommentWithSlashesSchema = { + description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work', + type: 'integer' +} as const; + +export const CommentWithExpressionPlaceholdersSchema = { + description: 'Testing expression placeholders in string: ${expression} should work', + type: 'integer' +} as const; + +export const CommentWithQuotesSchema = { + description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`, + type: 'integer' +} as const; + +export const CommentWithReservedCharactersSchema = { + description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work', + type: 'integer' +} as const; + +export const SimpleIntegerSchema = { + description: 'This is a simple number', + type: 'integer' +} as const; + +export const SimpleBooleanSchema = { + description: 'This is a simple boolean', + type: 'boolean' +} as const; + +export const SimpleStringSchema = { + description: 'This is a simple string', + type: 'string' +} as const; + +export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = { + description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)', + type: 'string' +} as const; + +export const SimpleFileSchema = { + description: 'This is a simple file', + format: 'binary', + type: 'string' +} as const; + +export const SimpleReferenceSchema = { + description: 'This is a simple reference', + allOf: [ + { + '$ref': '#/components/schemas/ModelWithString' + } + ] +} as const; + +export const SimpleStringWithPatternSchema = { + description: 'This is a simple string', + type: 'string', + nullable: true, + maxLength: 64, + pattern: '^[a-zA-Z0-9_]*$' +} as const; + +export const EnumWithStringsSchema = { + description: 'This is a simple enum with strings', + enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串'] +} as const; + +export const EnumWithReplacedCharactersSchema = { + enum: ["'Single Quote'", '"Double Quotes"', 'øæåôöØÆÅÔÖ字符串', 3.1, ''], + type: 'string' +} as const; + +export const EnumWithNumbersSchema = { + description: 'This is a simple enum with numbers', + enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3], + default: 200 +} as const; + +export const EnumFromDescriptionSchema = { + description: 'Success=1,Warning=2,Error=3', + type: 'number' +} as const; + +export const EnumWithExtensionsSchema = { + description: 'This is a simple enum with numbers', + enum: [200, 400, 500], + 'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'], + 'x-enum-descriptions': ['Used when the status of something is successful', 'Used when the status of something has a warning', 'Used when the status of something has an error'] +} as const; + +export const EnumWithXEnumNamesSchema = { + enum: [0, 1, 2], + 'x-enumNames': ['zero', 'one', 'two'] +} as const; + +export const ArrayWithNumbersSchema = { + description: 'This is a simple array with numbers', + type: 'array', + items: { + type: 'integer' + } +} as const; + +export const ArrayWithBooleansSchema = { + description: 'This is a simple array with booleans', + type: 'array', + items: { + type: 'boolean' + } +} as const; + +export const ArrayWithStringsSchema = { + description: 'This is a simple array with strings', + type: 'array', + items: { + type: 'string' + }, + default: ['test'] +} as const; + +export const ArrayWithReferencesSchema = { + description: 'This is a simple array with references', + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithString' + } +} as const; + +export const ArrayWithArraySchema = { + description: 'This is a simple array containing an array', + type: 'array', + items: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithString' + } + } +} as const; + +export const ArrayWithPropertiesSchema = { + description: 'This is a simple array with properties', + type: 'array', + items: { + type: 'object', + properties: { + '16x16': { + '$ref': '#/components/schemas/camelCaseCommentWithBreaks' + }, + bar: { + type: 'string' + } + } + } +} as const; + +export const ArrayWithAnyOfPropertiesSchema = { + description: 'This is a simple array with any of properties', + type: 'array', + items: { + anyOf: [ + { + type: 'object', + properties: { + foo: { + type: 'string', + default: 'test' + } + } + }, + { + type: 'object', + properties: { + bar: { + type: 'string' + } + } + } + ] + } +} as const; + +export const AnyOfAnyAndNullSchema = { + type: 'object', + properties: { + data: { + anyOf: [ + {}, + { + nullable: true + } + ] + } + } +} as const; + +export const AnyOfArraysSchema = { + description: 'This is a simple array with any of properties', + type: 'object', + properties: { + results: { + items: { + anyOf: [ + { + type: 'object', + properties: { + foo: { + type: 'string' + } + } + }, + { + type: 'object', + properties: { + bar: { + type: 'string' + } + } + } + ] + }, + type: 'array' + } + } +} as const; + +export const DictionaryWithStringSchema = { + description: 'This is a string dictionary', + type: 'object', + additionalProperties: { + type: 'string' + } +} as const; + +export const DictionaryWithPropertiesAndAdditionalPropertiesSchema = { + type: 'object', + properties: { + foo: { + type: 'number' + }, + bar: { + type: 'boolean' + } + }, + additionalProperties: { + type: 'string' + } +} as const; + +export const DictionaryWithReferenceSchema = { + description: 'This is a string reference', + type: 'object', + additionalProperties: { + '$ref': '#/components/schemas/ModelWithString' + } +} as const; + +export const DictionaryWithArraySchema = { + description: 'This is a complex dictionary', + type: 'object', + additionalProperties: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithString' + } + } +} as const; + +export const DictionaryWithDictionarySchema = { + description: 'This is a string dictionary', + type: 'object', + additionalProperties: { + type: 'object', + additionalProperties: { + type: 'string' + } + } +} as const; + +export const DictionaryWithPropertiesSchema = { + description: 'This is a complex dictionary', + type: 'object', + additionalProperties: { + type: 'object', + properties: { + foo: { + type: 'string' + }, + bar: { + type: 'string' + } + } + } +} as const; + +export const ModelWithIntegerSchema = { + description: 'This is a model with one number property', + type: 'object', + properties: { + prop: { + description: 'This is a simple number property', + type: 'integer' + } + } +} as const; + +export const ModelWithBooleanSchema = { + description: 'This is a model with one boolean property', + type: 'object', + properties: { + prop: { + description: 'This is a simple boolean property', + type: 'boolean' + } + } +} as const; + +export const ModelWithStringSchema = { + description: 'This is a model with one string property', + type: 'object', + properties: { + prop: { + description: 'This is a simple string property', + type: 'string' + } + } +} as const; + +export const ModelWithStringErrorSchema = { + description: 'This is a model with one string property', + type: 'object', + properties: { + prop: { + description: 'This is a simple string property', + type: 'string' + } + } +} as const; + +export const Model_From_ZendeskSchema = { + description: `\`Comment\` or \`VoiceComment\`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets)`, + type: 'string' +} as const; + +export const ModelWithNullableStringSchema = { + description: 'This is a model with one string property', + type: 'object', + required: ['nullableRequiredProp1', 'nullableRequiredProp2'], + properties: { + nullableProp1: { + description: 'This is a simple string property', + type: 'string', + nullable: true + }, + nullableRequiredProp1: { + description: 'This is a simple string property', + type: 'string', + nullable: true + }, + nullableProp2: { + description: 'This is a simple string property', + nullable: true, + type: 'string' + }, + nullableRequiredProp2: { + description: 'This is a simple string property', + nullable: true, + type: 'string' + }, + 'foo_bar-enum': { + description: 'This is a simple enum with strings', + enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + } + } +} as const; + +export const ModelWithEnumSchema = { + description: 'This is a model with one enum', + type: 'object', + properties: { + 'foo_bar-enum': { + description: 'This is a simple enum with strings', + enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + }, + statusCode: { + description: 'These are the HTTP error code enums', + enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar'] + }, + bool: { + description: 'Simple boolean enum', + type: 'boolean', + enum: [true] + } + } +} as const; + +export const ModelWithEnumWithHyphenSchema = { + description: 'This is a model with one enum with escaped name', + type: 'object', + properties: { + 'foo-bar-baz-qux': { + type: 'string', + enum: ['3.0'], + title: 'Foo-Bar-Baz-Qux', + default: '3.0' + } + } +} as const; + +export const ModelWithEnumFromDescriptionSchema = { + description: 'This is a model with one enum', + type: 'object', + properties: { + test: { + type: 'integer', + description: 'Success=1,Warning=2,Error=3' + } + } +} as const; + +export const ModelWithNestedEnumsSchema = { + description: 'This is a model with nested enums', + type: 'object', + properties: { + dictionaryWithEnum: { + type: 'object', + additionalProperties: { + enum: ['Success', 'Warning', 'Error'] + } + }, + dictionaryWithEnumFromDescription: { + type: 'object', + additionalProperties: { + type: 'integer', + description: 'Success=1,Warning=2,Error=3' + } + }, + arrayWithEnum: { + type: 'array', + items: { + enum: ['Success', 'Warning', 'Error'] + } + }, + arrayWithDescription: { + type: 'array', + items: { + type: 'integer', + description: 'Success=1,Warning=2,Error=3' + } + }, + 'foo_bar-enum': { + description: 'This is a simple enum with strings', + enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + } + } +} as const; + +export const ModelWithReferenceSchema = { + description: 'This is a model with one property containing a reference', + type: 'object', + properties: { + prop: { + '$ref': '#/components/schemas/ModelWithProperties' + } + } +} as const; + +export const ModelWithArrayReadOnlyAndWriteOnlySchema = { + description: 'This is a model with one property containing an array', + type: 'object', + properties: { + prop: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnly' + } + }, + propWithFile: { + type: 'array', + items: { + format: 'binary', + type: 'string' + } + }, + propWithNumber: { + type: 'array', + items: { + type: 'number' + } + } + } +} as const; + +export const ModelWithArraySchema = { + description: 'This is a model with one property containing an array', + type: 'object', + properties: { + prop: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithString' + } + }, + propWithFile: { + type: 'array', + items: { + format: 'binary', + type: 'string' + } + }, + propWithNumber: { + type: 'array', + items: { + type: 'number' + } + } + } +} as const; + +export const ModelWithDictionarySchema = { + description: 'This is a model with one property containing a dictionary', + type: 'object', + properties: { + prop: { + type: 'object', + additionalProperties: { + type: 'string' + } + } + } +} as const; + +export const DeprecatedModelSchema = { + deprecated: true, + description: 'This is a deprecated model with a deprecated property', + type: 'object', + properties: { + prop: { + deprecated: true, + description: 'This is a deprecated property', + type: 'string' + } + } +} as const; + +export const ModelWithCircularReferenceSchema = { + description: 'This is a model with one property containing a circular reference', + type: 'object', + properties: { + prop: { + '$ref': '#/components/schemas/ModelWithCircularReference' + } + } +} as const; + +export const CompositionWithOneOfSchema = { + description: "This is a model with one property with a 'one of' relationship", + type: 'object', + properties: { + propA: { + type: 'object', + oneOf: [ + { + '$ref': '#/components/schemas/ModelWithString' + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const CompositionWithOneOfAnonymousSchema = { + description: "This is a model with one property with a 'one of' relationship where the options are not $ref", + type: 'object', + properties: { + propA: { + type: 'object', + oneOf: [ + { + description: 'Anonymous object type', + type: 'object', + properties: { + propA: { + type: 'string' + } + } + }, + { + description: 'Anonymous string type', + type: 'string' + }, + { + description: 'Anonymous integer type', + type: 'integer' + } + ] + } + } +} as const; + +export const ModelCircleSchema = { + description: 'Circle', + type: 'object', + required: ['kind'], + properties: { + kind: { + type: 'string' + }, + radius: { + type: 'number' + } + } +} as const; + +export const ModelSquareSchema = { + description: 'Square', + type: 'object', + required: ['kind'], + properties: { + kind: { + type: 'string' + }, + sideLength: { + type: 'number' + } + } +} as const; + +export const CompositionWithOneOfDiscriminatorSchema = { + description: "This is a model with one property with a 'one of' relationship where the options are not $ref", + type: 'object', + oneOf: [ + { + '$ref': '#/components/schemas/ModelCircle' + }, + { + '$ref': '#/components/schemas/ModelSquare' + } + ], + discriminator: { + propertyName: 'kind', + mapping: { + circle: '#/components/schemas/ModelCircle', + square: '#/components/schemas/ModelSquare' + } + } +} as const; + +export const CompositionWithAnyOfSchema = { + description: "This is a model with one property with a 'any of' relationship", + type: 'object', + properties: { + propA: { + type: 'object', + anyOf: [ + { + '$ref': '#/components/schemas/ModelWithString' + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const CompositionWithAnyOfAnonymousSchema = { + description: "This is a model with one property with a 'any of' relationship where the options are not $ref", + type: 'object', + properties: { + propA: { + type: 'object', + anyOf: [ + { + description: 'Anonymous object type', + type: 'object', + properties: { + propA: { + type: 'string' + } + } + }, + { + description: 'Anonymous string type', + type: 'string' + }, + { + description: 'Anonymous integer type', + type: 'integer' + } + ] + } + } +} as const; + +export const CompositionWithNestedAnyAndTypeNullSchema = { + description: "This is a model with nested 'any of' property with a type null", + type: 'object', + properties: { + propA: { + type: 'object', + anyOf: [ + { + items: { + nullable: true, + allOf: [ + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + }, + type: 'array' + }, + { + items: { + nullable: true, + allOf: [ + { + '$ref': '#/components/schemas/ModelWithArray' + } + ] + }, + type: 'array' + } + ] + } + } +} as const; + +export const _3e_num_1ПериодSchema = { + enum: ['Bird', 'Dog'], + type: 'string' +} as const; + +export const ConstValueSchema = { + enum: ['ConstValue'], + type: 'string' +} as const; + +export const CompositionWithNestedAnyOfAndNullSchema = { + description: "This is a model with one property with a 'any of' relationship where the options are not $ref", + type: 'object', + properties: { + propA: { + nullable: true, + allOf: [ + { + items: { + anyOf: [ + { + '$ref': '#/components/schemas/3e-num_1Период' + }, + { + '$ref': '#/components/schemas/ConstValue' + } + ] + }, + type: 'array' + } + ], + title: 'Scopes' + } + } +} as const; + +export const CompositionWithOneOfAndNullableSchema = { + description: "This is a model with one property with a 'one of' relationship", + type: 'object', + properties: { + propA: { + nullable: true, + type: 'object', + oneOf: [ + { + type: 'object', + properties: { + boolean: { + type: 'boolean' + } + } + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const CompositionWithOneOfAndSimpleDictionarySchema = { + description: 'This is a model that contains a simple dictionary within composition', + type: 'object', + properties: { + propA: { + oneOf: [ + { + type: 'boolean' + }, + { + type: 'object', + additionalProperties: { + type: 'number' + } + } + ] + } + } +} as const; + +export const CompositionWithOneOfAndSimpleArrayDictionarySchema = { + description: 'This is a model that contains a dictionary of simple arrays within composition', + type: 'object', + properties: { + propA: { + oneOf: [ + { + type: 'boolean' + }, + { + type: 'object', + additionalProperties: { + type: 'array', + items: { + type: 'boolean' + } + } + } + ] + } + } +} as const; + +export const CompositionWithOneOfAndComplexArrayDictionarySchema = { + description: 'This is a model that contains a dictionary of complex arrays (composited) within composition', + type: 'object', + properties: { + propA: { + oneOf: [ + { + type: 'boolean' + }, + { + type: 'object', + additionalProperties: { + type: 'array', + items: { + oneOf: [ + { + type: 'number' + }, + { + type: 'string' + } + ] + } + } + } + ] + } + } +} as const; + +export const CompositionWithAllOfAndNullableSchema = { + description: "This is a model with one property with a 'all of' relationship", + type: 'object', + properties: { + propA: { + nullable: true, + type: 'object', + allOf: [ + { + type: 'object', + properties: { + boolean: { + type: 'boolean' + } + } + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const CompositionWithAnyOfAndNullableSchema = { + description: "This is a model with one property with a 'any of' relationship", + type: 'object', + properties: { + propA: { + nullable: true, + type: 'object', + anyOf: [ + { + type: 'object', + properties: { + boolean: { + type: 'boolean' + } + } + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const CompositionBaseModelSchema = { + description: 'This is a base model with two simple optional properties', + type: 'object', + properties: { + firstName: { + type: 'string' + }, + lastname: { + type: 'string' + } + } +} as const; + +export const CompositionExtendedModelSchema = { + description: 'This is a model that extends the base model', + type: 'object', + allOf: [ + { + '$ref': '#/components/schemas/CompositionBaseModel' + } + ], + properties: { + age: { + type: 'number' + } + }, + required: ['firstName', 'lastname', 'age'] +} as const; + +export const ModelWithPropertiesSchema = { + description: 'This is a model with one nested property', + type: 'object', + required: ['required', 'requiredAndReadOnly', 'requiredAndNullable'], + properties: { + required: { + type: 'string' + }, + requiredAndReadOnly: { + type: 'string', + readOnly: true + }, + requiredAndNullable: { + type: 'string', + nullable: true + }, + string: { + type: 'string' + }, + number: { + type: 'number' + }, + boolean: { + type: 'boolean' + }, + reference: { + '$ref': '#/components/schemas/ModelWithString' + }, + 'property with space': { + type: 'string' + }, + default: { + type: 'string' + }, + try: { + type: 'string' + }, + '@namespace.string': { + type: 'string', + readOnly: true + }, + '@namespace.integer': { + type: 'integer', + readOnly: true + } + } +} as const; + +export const ModelWithNestedPropertiesSchema = { + description: 'This is a model with one nested property', + type: 'object', + required: ['first'], + properties: { + first: { + type: 'object', + required: ['second'], + readOnly: true, + nullable: true, + properties: { + second: { + type: 'object', + required: ['third'], + readOnly: true, + nullable: true, + properties: { + third: { + type: 'string', + required: true, + readOnly: true, + nullable: true + } + } + } + } + } + } +} as const; + +export const ModelWithDuplicatePropertiesSchema = { + description: 'This is a model with duplicated properties', + type: 'object', + properties: { + prop: { + '$ref': '#/components/schemas/ModelWithString' + } + } +} as const; + +export const ModelWithOrderedPropertiesSchema = { + description: 'This is a model with ordered properties', + type: 'object', + properties: { + zebra: { + type: 'string' + }, + apple: { + type: 'string' + }, + hawaii: { + type: 'string' + } + } +} as const; + +export const ModelWithDuplicateImportsSchema = { + description: 'This is a model with duplicated imports', + type: 'object', + properties: { + propA: { + '$ref': '#/components/schemas/ModelWithString' + }, + propB: { + '$ref': '#/components/schemas/ModelWithString' + }, + propC: { + '$ref': '#/components/schemas/ModelWithString' + } + } +} as const; + +export const ModelThatExtendsSchema = { + description: 'This is a model that extends another model', + type: 'object', + allOf: [ + { + '$ref': '#/components/schemas/ModelWithString' + }, + { + type: 'object', + properties: { + propExtendsA: { + type: 'string' + }, + propExtendsB: { + '$ref': '#/components/schemas/ModelWithString' + } + } + } + ] +} as const; + +export const ModelThatExtendsExtendsSchema = { + description: 'This is a model that extends another model', + type: 'object', + allOf: [ + { + '$ref': '#/components/schemas/ModelWithString' + }, + { + '$ref': '#/components/schemas/ModelThatExtends' + }, + { + type: 'object', + properties: { + propExtendsC: { + type: 'string' + }, + propExtendsD: { + '$ref': '#/components/schemas/ModelWithString' + } + } + } + ] +} as const; + +export const ModelWithPatternSchema = { + description: 'This is a model that contains a some patterns', + type: 'object', + required: ['key', 'name'], + properties: { + key: { + maxLength: 64, + pattern: '^[a-zA-Z0-9_]*$', + type: 'string' + }, + name: { + maxLength: 255, + type: 'string' + }, + enabled: { + type: 'boolean', + readOnly: true + }, + modified: { + type: 'string', + format: 'date-time', + readOnly: true + }, + id: { + type: 'string', + pattern: '^\\d{2}-\\d{3}-\\d{4}$' + }, + text: { + type: 'string', + pattern: '^\\w+$' + }, + patternWithSingleQuotes: { + type: 'string', + pattern: "^[a-zA-Z0-9']*$" + }, + patternWithNewline: { + type: 'string', + pattern: 'aaa\\nbbb' + }, + patternWithBacktick: { + type: 'string', + pattern: 'aaa`bbb' + } + } +} as const; + +export const FileSchema = { + required: ['mime'], + type: 'object', + properties: { + id: { + title: 'Id', + type: 'string', + readOnly: true, + minLength: 1 + }, + updated_at: { + title: 'Updated at', + type: 'string', + format: 'date-time', + readOnly: true + }, + created_at: { + title: 'Created at', + type: 'string', + format: 'date-time', + readOnly: true + }, + mime: { + title: 'Mime', + type: 'string', + maxLength: 24, + minLength: 1 + }, + file: { + title: 'File', + type: 'string', + readOnly: true, + format: 'uri' + } + } +} as const; + +export const defaultSchema = { + type: 'object', + properties: { + name: { + type: 'string' + } + } +} as const; + +export const PageableSchema = { + type: 'object', + properties: { + page: { + minimum: 0, + type: 'integer', + format: 'int32', + default: 0 + }, + size: { + minimum: 1, + type: 'integer', + format: 'int32' + }, + sort: { + type: 'array', + items: { + type: 'string' + } + } + } +} as const; + +export const FreeFormObjectWithoutAdditionalPropertiesSchema = { + description: 'This is a free-form object without additionalProperties.', + type: 'object' +} as const; + +export const FreeFormObjectWithAdditionalPropertiesEqTrueSchema = { + description: 'This is a free-form object with additionalProperties: true.', + type: 'object', + additionalProperties: true +} as const; + +export const FreeFormObjectWithAdditionalPropertiesEqEmptyObjectSchema = { + description: 'This is a free-form object with additionalProperties: {}.', + type: 'object', + additionalProperties: {} +} as const; + +export const ModelWithConstSchema = { + type: 'object', + properties: { + String: { + enum: ['String'], + type: 'string' + }, + number: { + enum: [0], + type: 'number' + }, + null: { + nullable: true + }, + withType: { + enum: ['Some string'], + type: 'string' + } + } +} as const; + +export const ModelWithAdditionalPropertiesEqTrueSchema = { + description: 'This is a model with one property and additionalProperties: true', + type: 'object', + properties: { + prop: { + description: 'This is a simple string property', + type: 'string' + } + }, + additionalProperties: true +} as const; + +export const NestedAnyOfArraysNullableSchema = { + properties: { + nullableArray: { + nullable: true, + allOf: [ + { + items: { + anyOf: [ + { + type: 'string' + }, + { + type: 'boolean' + } + ] + }, + type: 'array' + } + ] + } + }, + type: 'object' +} as const; + +export const CompositionWithOneOfAndPropertiesSchema = { + type: 'object', + oneOf: [ + { + type: 'object', + required: ['foo'], + properties: { + foo: { + '$ref': '#/components/parameters/SimpleParameter' + } + }, + additionalProperties: false + }, + { + type: 'object', + required: ['bar'], + properties: { + bar: { + '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' + } + }, + additionalProperties: false + } + ], + required: ['baz', 'qux'], + properties: { + baz: { + type: 'integer', + format: 'uint16', + minimum: 0, + nullable: true + }, + qux: { + type: 'integer', + format: 'uint8', + minimum: 0 + } + } +} as const; + +export const NullableObjectSchema = { + description: 'An object that can be null', + nullable: true, + type: 'object', + properties: { + foo: { + type: 'string' + } + }, + default: null +} as const; + +export const CharactersInDescriptionSchema = { + type: 'string', + description: 'Some % character' +} as const; + +export const ModelWithNullableObjectSchema = { + type: 'object', + properties: { + data: { + '$ref': '#/components/schemas/NullableObject' + } + } +} as const; + +export const ModelWithOneOfEnumSchema = { + oneOf: [ + { + type: 'object', + required: ['foo'], + properties: { + foo: { + type: 'string', + enum: ['Bar'] + } + } + }, + { + type: 'object', + required: ['foo'], + properties: { + foo: { + type: 'string', + enum: ['Baz'] + } + } + }, + { + type: 'object', + required: ['foo'], + properties: { + foo: { + type: 'string', + enum: ['Qux'] + } + } + }, + { + type: 'object', + required: ['content', 'foo'], + properties: { + content: { + type: 'string', + format: 'date-time' + }, + foo: { + type: 'string', + enum: ['Quux'] + } + } + }, + { + type: 'object', + required: ['content', 'foo'], + properties: { + content: { + type: 'array', + items: { + type: 'string', + format: 'date-time' + }, + maxItems: 2, + minItems: 2 + }, + foo: { + type: 'string', + enum: ['Corge'] + } + } + } + ] +} as const; + +export const ModelWithNestedArrayEnumsDataFooSchema = { + enum: ['foo', 'bar'], + type: 'string' +} as const; + +export const ModelWithNestedArrayEnumsDataBarSchema = { + enum: ['baz', 'qux'], + type: 'string' +} as const; + +export const ModelWithNestedArrayEnumsDataSchema = { + type: 'object', + properties: { + foo: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' + } + }, + bar: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataBar' + } + } + } +} as const; + +export const ModelWithNestedArrayEnumsSchema = { + type: 'object', + properties: { + array_strings: { + type: 'array', + items: { + type: 'string' + } + }, + data: { + allOf: [ + { + '$ref': '#/components/schemas/ModelWithNestedArrayEnumsData' + } + ] + } + } +} as const; + +export const ModelWithNestedCompositionEnumsSchema = { + type: 'object', + properties: { + foo: { + allOf: [ + { + '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' + } + ] + } + } +} as const; + +export const ModelWithReadOnlyAndWriteOnlySchema = { + type: 'object', + required: ['foo', 'bar', 'baz'], + properties: { + foo: { + type: 'string' + }, + bar: { + readOnly: true, + type: 'string' + }, + baz: { + type: 'string', + writeOnly: true + } + } +} as const; + +export const ModelWithConstantSizeArraySchema = { + type: 'array', + items: { + type: 'number' + }, + minItems: 2, + maxItems: 2 +} as const; + +export const ModelWithAnyOfConstantSizeArraySchema = { + type: 'array', + items: { + oneOf: [ + { + type: 'number' + }, + { + type: 'string' + } + ] + }, + minItems: 3, + maxItems: 3 +} as const; + +export const ModelWithPrefixItemsConstantSizeArraySchema = { + type: 'array', + items: { + oneOf: [ + { + '$ref': '#/components/schemas/ModelWithInteger' + }, + { + type: 'number' + }, + { + type: 'string' + } + ] + } +} as const; + +export const ModelWithAnyOfConstantSizeArrayNullableSchema = { + type: 'array', + items: { + oneOf: [ + { + type: 'number', + nullable: true + }, + { + type: 'string' + } + ] + }, + minItems: 3, + maxItems: 3 +} as const; + +export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsSchema = { + type: 'array', + items: { + oneOf: [ + { + type: 'number' + }, + { + '$ref': '#/components/schemas/import' + } + ] + }, + minItems: 2, + maxItems: 2 +} as const; + +export const ModelWithAnyOfConstantSizeArrayAndIntersectSchema = { + type: 'array', + items: { + allOf: [ + { + type: 'number' + }, + { + type: 'string' + } + ] + }, + minItems: 2, + maxItems: 2 +} as const; + +export const ModelWithNumericEnumUnionSchema = { + type: 'object', + properties: { + value: { + type: 'number', + description: 'Период', + enum: [-10, -1, 0, 1, 3, 6, 12] + } + } +} as const; + +export const ModelWithBackticksInDescriptionSchema = { + description: 'Some description with `back ticks`', + type: 'object', + properties: { + template: { + type: 'string', + description: `The template \`that\` should be used for parsing and importing the contents of the CSV file. + +

There is one placeholder currently supported:

  • \${x} - refers to the n-th column in the CSV file, e.g. \${1}, \${2}, ...)

Example of a correct JSON template:

+
+[
+  {
+    "resourceType": "Asset",
+    "identifier": {
+      "name": "\${1}",
+      "domain": {
+        "name": "\${2}",
+        "community": {
+          "name": "Some Community"
+        }
+      }
+    },
+    "attributes" : {
+      "00000000-0000-0000-0000-000000003115" : [ {
+        "value" : "\${3}" 
+      } ],
+      "00000000-0000-0000-0000-000000000222" : [ {
+        "value" : "\${4}"
+      } ]
+    }
+  }
+]
+
` + } + } +} as const; + +export const ModelWithOneOfAndPropertiesSchema = { + type: 'object', + oneOf: [ + { + '$ref': '#/components/parameters/SimpleParameter' + }, + { + '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' + } + ], + required: ['baz', 'qux'], + properties: { + baz: { + type: 'integer', + format: 'uint16', + minimum: 0, + nullable: true + }, + qux: { + type: 'integer', + format: 'uint8', + minimum: 0 + } + } +} as const; + +export const ParameterSimpleParameterUnusedSchema = { + description: 'Model used to test deduplication strategy (unused)', + type: 'string' +} as const; + +export const PostServiceWithEmptyTagResponseSchema = { + description: 'Model used to test deduplication strategy', + type: 'string' +} as const; + +export const PostServiceWithEmptyTagResponse2Schema = { + description: 'Model used to test deduplication strategy', + type: 'string' +} as const; + +export const DeleteFooDataSchema = { + description: 'Model used to test deduplication strategy', + type: 'string' +} as const; + +export const DeleteFooData2Schema = { + description: 'Model used to test deduplication strategy', + type: 'string' +} as const; + +export const importSchema = { + description: 'Model with restricted keyword name', + type: 'string' +} as const; + +export const SchemaWithFormRestrictedKeysSchema = { + properties: { + description: { + type: 'string' + }, + 'x-enum-descriptions': { + type: 'string' + }, + 'x-enum-varnames': { + type: 'string' + }, + 'x-enumNames': { + type: 'string' + }, + title: { + type: 'string' + }, + object: { + type: 'object', + properties: { + description: { + type: 'string' + }, + 'x-enum-descriptions': { + type: 'string' + }, + 'x-enum-varnames': { + type: 'string' + }, + 'x-enumNames': { + type: 'string' + }, + title: { + type: 'string' + } + } + }, + array: { + type: 'array', + items: { + type: 'object', + properties: { + description: { + type: 'string' + }, + 'x-enum-descriptions': { + type: 'string' + }, + 'x-enum-varnames': { + type: 'string' + }, + 'x-enumNames': { + type: 'string' + }, + title: { + type: 'string' + } + } + } + } + } +} as const; + +export const io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptionsSchema = { + description: 'This schema was giving PascalCase transformations a hard time', + properties: { + preconditions: { + allOf: [ + { + '$ref': '#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions' + } + ], + description: 'Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.' + } + }, + type: 'object' +} as const; + +export const io_k8s_apimachinery_pkg_apis_meta_v1_PreconditionsSchema = { + description: 'This schema was giving PascalCase transformations a hard time', + properties: { + resourceVersion: { + description: 'Specifies the target ResourceVersion', + type: 'string' + }, + uid: { + description: 'Specifies the target UID.', + type: 'string' + } + }, + type: 'object' +} as const; + +export const AdditionalPropertiesUnknownIssueSchema = { + type: 'object', + properties: {}, + additionalProperties: { + anyOf: [ + { + type: 'string' + }, + { + type: 'number' + } + ] + } +} as const; + +export const AdditionalPropertiesUnknownIssue2Schema = { + type: 'object', + additionalProperties: { + anyOf: [ + { + type: 'string' + }, + { + type: 'number' + } + ] + } +} as const; + +export const AdditionalPropertiesUnknownIssue3Schema = { + type: 'object', + allOf: [ + { + type: 'string' + }, + { + type: 'object', + required: ['entries'], + properties: { + entries: { + type: 'object', + additionalProperties: { + '$ref': '#/components/schemas/AdditionalPropertiesUnknownIssue' + } + } + } + } + ] +} as const; + +export const AdditionalPropertiesIntegerIssueSchema = { + type: 'object', + required: ['value'], + properties: { + value: { + type: 'integer' + } + }, + additionalProperties: { + type: 'integer' + } +} as const; + +export const OneOfAllOfIssueSchema = { + oneOf: [ + { + allOf: [ + { + oneOf: [ + { + '$ref': '#/components/schemas/ConstValue' + }, + { + '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]' + } + ] + }, + { + '$ref': '#/components/schemas/3e-num_1Период' + } + ] + }, + { + '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]' + } + ] +} as const; + +export const Generic_Schema_Duplicate_Issue_1_System_Boolean_Schema = { + type: 'object', + properties: { + item: { + type: 'boolean' + }, + error: { + type: 'string', + nullable: true + }, + hasError: { + type: 'boolean', + readOnly: true + }, + data: { + type: 'object', + properties: {}, + additionalProperties: false + } + }, + additionalProperties: false +} as const; + +export const Generic_Schema_Duplicate_Issue_1_System_String_Schema = { + type: 'object', + properties: { + item: { + type: 'string', + nullable: true + }, + error: { + type: 'string', + nullable: true + }, + hasError: { + type: 'boolean', + readOnly: true + } + }, + additionalProperties: false +} as const; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/sdk.gen.ts new file mode 100644 index 000000000..7f932711f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/types.gen.ts new file mode 100644 index 000000000..8d98b563e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/types.gen.ts @@ -0,0 +1,2023 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: unknown; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = Array; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +export type SimpleRequestBody = ModelWithString; + +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts new file mode 100644 index 000000000..caa002cde --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts @@ -0,0 +1,19 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base', + throwOnError: true +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts new file mode 100644 index 000000000..4300b2379 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts new file mode 100644 index 000000000..8d98b563e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts @@ -0,0 +1,2023 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: unknown; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = Array; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +export type SimpleRequestBody = ModelWithString; + +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts new file mode 100644 index 000000000..b3e776847 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts @@ -0,0 +1,32 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { PostFooData, PostFooResponse } from './types.gen'; +import { postFooResponseTransformer } from './transformers.gen'; +import { zPostFooResponse } from './zod.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const postFoo = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + responseTransformer: postFooResponseTransformer, + responseValidator: async (data) => { + return await zPostFooResponse.parseAsync(data); + }, + url: '/foo', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts new file mode 100644 index 000000000..419690a91 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts @@ -0,0 +1,13 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { PostFooResponse } from './types.gen'; + +const fooSchemaResponseTransformer = (data: any) => { + data.foo = BigInt(data.foo.toString()); + return data; +}; + +export const postFooResponseTransformer = async (data: any): Promise => { + data = fooSchemaResponseTransformer(data); + return data; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/types.gen.ts new file mode 100644 index 000000000..a796d8382 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/types.gen.ts @@ -0,0 +1,32 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + bar?: number; + foo: bigint; + id: string; +}; + +export type Bar = { + foo: number; + [key: string]: number; +}; + +export type PostFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type PostFooResponses = { + /** + * OK + */ + 200: Foo; +}; + +export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/zod.gen.ts new file mode 100644 index 000000000..328fe6811 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/zod.gen.ts @@ -0,0 +1,15 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { z } from 'zod'; + +export const zFoo = z.object({ + bar: z.number().int().optional(), + foo: z.coerce.bigint(), + id: z.string() +}); + +export const zBar = z.object({ + foo: z.number().int() +}); + +export const zPostFooResponse = zFoo; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts new file mode 100644 index 000000000..8ef32fabb --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts @@ -0,0 +1,87 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type ReadableFooReadWrite = ReadableBarRead; + +export type WritableFooReadWrite = WritableBarRead & { + foo?: string; +}; + +export type ReadableFooRead = ReadableBarRead & { + readonly foo?: string; +}; + +export type WritableFooRead = WritableBarRead; + +export type ReadableFooWrite = ReadableBarWrite; + +export type WritableFooWrite = WritableBarWrite & { + foo?: string; +}; + +export type ReadableBarRead = Baz | { + readonly bar?: string; +}; + +export type WritableBarRead = Baz; + +export type ReadableBarWrite = Baz; + +export type WritableBarWrite = Baz | { + bar?: string; +}; + +export type Baz = { + baz?: string; +}; + +export type PostFooReadWriteData = { + body: WritableFooReadWrite; + path?: never; + query?: never; + url: '/foo-read-write'; +}; + +export type PostFooReadWriteResponses = { + /** + * OK + */ + 200: ReadableFooReadWrite; +}; + +export type PostFooReadWriteResponse = PostFooReadWriteResponses[keyof PostFooReadWriteResponses]; + +export type PostFooReadData = { + body: WritableFooRead; + path?: never; + query?: never; + url: '/foo-read'; +}; + +export type PostFooReadResponses = { + /** + * OK + */ + 200: ReadableFooRead; +}; + +export type PostFooReadResponse = PostFooReadResponses[keyof PostFooReadResponses]; + +export type PostFooWriteData = { + body: WritableFooWrite; + path?: never; + query?: never; + url: '/foo-write'; +}; + +export type PostFooWriteResponses = { + /** + * OK + */ + 200: ReadableFooWrite; +}; + +export type PostFooWriteResponse = PostFooWriteResponses[keyof PostFooWriteResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts new file mode 100644 index 000000000..3035bdbfd --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts @@ -0,0 +1,77 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type FooReadWrite = BarRead & { + foo?: string; +}; + +export type FooRead = BarRead & { + readonly foo?: string; +}; + +export type FooWrite = BarWrite & { + foo?: string; +}; + +export type BarRead = Baz | { + readonly bar?: string; +}; + +export type BarWrite = Baz | { + bar?: string; +}; + +export type Baz = { + baz?: string; +}; + +export type PostFooReadWriteData = { + body: FooReadWrite; + path?: never; + query?: never; + url: '/foo-read-write'; +}; + +export type PostFooReadWriteResponses = { + /** + * OK + */ + 200: FooReadWrite; +}; + +export type PostFooReadWriteResponse = PostFooReadWriteResponses[keyof PostFooReadWriteResponses]; + +export type PostFooReadData = { + body: FooRead; + path?: never; + query?: never; + url: '/foo-read'; +}; + +export type PostFooReadResponses = { + /** + * OK + */ + 200: FooRead; +}; + +export type PostFooReadResponse = PostFooReadResponses[keyof PostFooReadResponses]; + +export type PostFooWriteData = { + body: FooWrite; + path?: never; + query?: never; + url: '/foo-write'; +}; + +export type PostFooWriteResponses = { + /** + * OK + */ + 200: FooWrite; +}; + +export type PostFooWriteResponse = PostFooWriteResponses[keyof PostFooWriteResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts new file mode 100644 index 000000000..33e101093 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts @@ -0,0 +1,1128 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, DefaultService, SimpleService, ParametersService, DescriptionsService, DeprecatedService, RequestBodyService, FormDataService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, UploadService, FileResponseService, ComplexService, MultipartService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/angular-query-experimental'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.export({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.import({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.import({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DeprecatedService.deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DeprecatedService.deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await FormDataService.postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await FormDataService.postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NoContentService.callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await CollectionFormatService.collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await TypesService.types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await UploadService.uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await UploadService.uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await FileResponseService.fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ComplexService.complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipartService.multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipartService.multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await MultipartService.multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ComplexService.complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts new file mode 100644 index 000000000..e94d5103c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts @@ -0,0 +1,506 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export class DefaultService { + public static export(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static patchApiVbyApiVersionNoTag(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static import(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static fooWow(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static getApiVbyApiVersionSimpleOperation(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); + } + +} + +export class SimpleService { + public static apiVVersionODataControllerCount(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); + } + + public static deleteCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static getCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static headCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static optionsCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static patchCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static postCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static putCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); + } + +} + +export class ParametersService { + public static deleteFoo(options: Options) { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); + } + + public static callWithParameters(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static callWithWeirdParameterNames(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static getCallWithOptionalParam(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static postCallWithOptionalParam(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class DescriptionsService { + public static callWithDescriptions(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); + } + +} + +export class DeprecatedService { + /** + * @deprecated + */ + public static deprecatedCall(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); + } + +} + +export class RequestBodyService { + public static postApiVbyApiVersionRequestBody(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class FormDataService { + public static postApiVbyApiVersionFormData(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); + } + +} + +export class DefaultsService { + public static callWithDefaultParameters(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callWithDefaultOptionalParameters(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callToTestOrderOfParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + +} + +export class DuplicateService { + public static duplicateName(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName2(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName3(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName4(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + +} + +export class NoContentService { + public static callWithNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); + } + + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + +} + +export class ResponseService { + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + + public static callWithResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithDuplicateResponses(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithResponses(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); + } + +} + +export class MultipleTags1Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags2Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags3Service { + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class CollectionFormatService { + public static collectionFormat(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); + } + +} + +export class TypesService { + public static types(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); + } + +} + +export class UploadService { + public static uploadFile(options: Options) { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); + } + +} + +export class FileResponseService { + public static fileResponse(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); + } + +} + +export class ComplexService { + public static complexTypes(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); + } + + public static complexParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); + } + +} + +export class MultipartService { + public static multipartResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); + } + + public static multipartRequest(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); + } + +} + +export class HeaderService { + public static callWithResultFromHeader(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); + } + +} + +export class ErrorService { + public static testErrorCode(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); + } + + /** + * Login User + */ + public static putWithFormUrlEncoded(options: Options) { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts new file mode 100644 index 000000000..8d98b563e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts @@ -0,0 +1,2023 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: unknown; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = Array; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +export type SimpleRequestBody = ModelWithString; + +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts new file mode 100644 index 000000000..6c51e6e80 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts @@ -0,0 +1,1129 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/angular-query-experimental'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import type { AxiosError } from 'axios'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await export_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await import_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await import_({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts new file mode 100644 index 000000000..1d97df8bc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts new file mode 100644 index 000000000..9e76f2fd8 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts @@ -0,0 +1,410 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + responseType: 'blob', + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts new file mode 100644 index 000000000..b970b0cd9 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts @@ -0,0 +1,2023 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: unknown; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = Array; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +export type SimpleRequestBody = ModelWithString; + +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts new file mode 100644 index 000000000..8b834b887 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts @@ -0,0 +1,1128 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/angular-query-experimental'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await export_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await import_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await import_({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts new file mode 100644 index 000000000..7f932711f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts new file mode 100644 index 000000000..8d98b563e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts @@ -0,0 +1,2023 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: unknown; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = Array; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +export type SimpleRequestBody = ModelWithString; + +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts new file mode 100644 index 000000000..05426b6bd --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts @@ -0,0 +1,1128 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, DefaultService, SimpleService, ParametersService, DescriptionsService, DeprecatedService, RequestBodyService, FormDataService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, UploadService, FileResponseService, ComplexService, MultipartService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; +import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/react-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.export({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.import({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.import({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DeprecatedService.deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DeprecatedService.deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await FormDataService.postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await FormDataService.postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NoContentService.callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await CollectionFormatService.collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await TypesService.types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await UploadService.uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await UploadService.uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await FileResponseService.fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ComplexService.complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipartService.multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipartService.multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await MultipartService.multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ComplexService.complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts new file mode 100644 index 000000000..e94d5103c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts @@ -0,0 +1,506 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export class DefaultService { + public static export(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static patchApiVbyApiVersionNoTag(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static import(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static fooWow(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static getApiVbyApiVersionSimpleOperation(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); + } + +} + +export class SimpleService { + public static apiVVersionODataControllerCount(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); + } + + public static deleteCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static getCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static headCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static optionsCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static patchCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static postCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static putCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); + } + +} + +export class ParametersService { + public static deleteFoo(options: Options) { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); + } + + public static callWithParameters(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static callWithWeirdParameterNames(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static getCallWithOptionalParam(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static postCallWithOptionalParam(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class DescriptionsService { + public static callWithDescriptions(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); + } + +} + +export class DeprecatedService { + /** + * @deprecated + */ + public static deprecatedCall(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); + } + +} + +export class RequestBodyService { + public static postApiVbyApiVersionRequestBody(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class FormDataService { + public static postApiVbyApiVersionFormData(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); + } + +} + +export class DefaultsService { + public static callWithDefaultParameters(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callWithDefaultOptionalParameters(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callToTestOrderOfParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + +} + +export class DuplicateService { + public static duplicateName(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName2(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName3(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName4(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + +} + +export class NoContentService { + public static callWithNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); + } + + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + +} + +export class ResponseService { + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + + public static callWithResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithDuplicateResponses(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithResponses(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); + } + +} + +export class MultipleTags1Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags2Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags3Service { + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class CollectionFormatService { + public static collectionFormat(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); + } + +} + +export class TypesService { + public static types(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); + } + +} + +export class UploadService { + public static uploadFile(options: Options) { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); + } + +} + +export class FileResponseService { + public static fileResponse(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); + } + +} + +export class ComplexService { + public static complexTypes(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); + } + + public static complexParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); + } + +} + +export class MultipartService { + public static multipartResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); + } + + public static multipartRequest(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); + } + +} + +export class HeaderService { + public static callWithResultFromHeader(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); + } + +} + +export class ErrorService { + public static testErrorCode(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); + } + + /** + * Login User + */ + public static putWithFormUrlEncoded(options: Options) { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/types.gen.ts new file mode 100644 index 000000000..8d98b563e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/types.gen.ts @@ -0,0 +1,2023 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: unknown; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = Array; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +export type SimpleRequestBody = ModelWithString; + +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts new file mode 100644 index 000000000..43c7a6a12 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts @@ -0,0 +1,1129 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; +import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/react-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import type { AxiosError } from 'axios'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await export_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await import_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await import_({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/client.gen.ts new file mode 100644 index 000000000..1d97df8bc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/sdk.gen.ts new file mode 100644 index 000000000..9e76f2fd8 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/sdk.gen.ts @@ -0,0 +1,410 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + responseType: 'blob', + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/types.gen.ts new file mode 100644 index 000000000..b970b0cd9 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/types.gen.ts @@ -0,0 +1,2023 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: unknown; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = Array; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +export type SimpleRequestBody = ModelWithString; + +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts new file mode 100644 index 000000000..0cd713c64 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts @@ -0,0 +1,1128 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; +import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/react-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await export_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await import_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await import_({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts new file mode 100644 index 000000000..7f932711f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/types.gen.ts new file mode 100644 index 000000000..8d98b563e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/types.gen.ts @@ -0,0 +1,2023 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: unknown; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = Array; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +export type SimpleRequestBody = ModelWithString; + +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts new file mode 100644 index 000000000..ba5915d9f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts @@ -0,0 +1,1128 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, DefaultService, SimpleService, ParametersService, DescriptionsService, DeprecatedService, RequestBodyService, FormDataService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, UploadService, FileResponseService, ComplexService, MultipartService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/solid-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.export({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.import({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.import({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DeprecatedService.deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DeprecatedService.deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await FormDataService.postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await FormDataService.postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NoContentService.callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await CollectionFormatService.collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await TypesService.types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await UploadService.uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await UploadService.uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await FileResponseService.fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ComplexService.complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipartService.multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipartService.multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await MultipartService.multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ComplexService.complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts new file mode 100644 index 000000000..e94d5103c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts @@ -0,0 +1,506 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export class DefaultService { + public static export(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static patchApiVbyApiVersionNoTag(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static import(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static fooWow(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static getApiVbyApiVersionSimpleOperation(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); + } + +} + +export class SimpleService { + public static apiVVersionODataControllerCount(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); + } + + public static deleteCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static getCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static headCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static optionsCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static patchCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static postCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static putCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); + } + +} + +export class ParametersService { + public static deleteFoo(options: Options) { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); + } + + public static callWithParameters(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static callWithWeirdParameterNames(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static getCallWithOptionalParam(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static postCallWithOptionalParam(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class DescriptionsService { + public static callWithDescriptions(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); + } + +} + +export class DeprecatedService { + /** + * @deprecated + */ + public static deprecatedCall(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); + } + +} + +export class RequestBodyService { + public static postApiVbyApiVersionRequestBody(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class FormDataService { + public static postApiVbyApiVersionFormData(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); + } + +} + +export class DefaultsService { + public static callWithDefaultParameters(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callWithDefaultOptionalParameters(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callToTestOrderOfParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + +} + +export class DuplicateService { + public static duplicateName(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName2(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName3(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName4(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + +} + +export class NoContentService { + public static callWithNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); + } + + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + +} + +export class ResponseService { + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + + public static callWithResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithDuplicateResponses(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithResponses(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); + } + +} + +export class MultipleTags1Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags2Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags3Service { + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class CollectionFormatService { + public static collectionFormat(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); + } + +} + +export class TypesService { + public static types(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); + } + +} + +export class UploadService { + public static uploadFile(options: Options) { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); + } + +} + +export class FileResponseService { + public static fileResponse(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); + } + +} + +export class ComplexService { + public static complexTypes(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); + } + + public static complexParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); + } + +} + +export class MultipartService { + public static multipartResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); + } + + public static multipartRequest(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); + } + +} + +export class HeaderService { + public static callWithResultFromHeader(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); + } + +} + +export class ErrorService { + public static testErrorCode(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); + } + + /** + * Login User + */ + public static putWithFormUrlEncoded(options: Options) { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/types.gen.ts new file mode 100644 index 000000000..8d98b563e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/types.gen.ts @@ -0,0 +1,2023 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: unknown; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = Array; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +export type SimpleRequestBody = ModelWithString; + +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts new file mode 100644 index 000000000..0855483e8 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts @@ -0,0 +1,1129 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/solid-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import type { AxiosError } from 'axios'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await export_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await import_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await import_({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts new file mode 100644 index 000000000..1d97df8bc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts new file mode 100644 index 000000000..9e76f2fd8 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts @@ -0,0 +1,410 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + responseType: 'blob', + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/types.gen.ts new file mode 100644 index 000000000..b970b0cd9 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/types.gen.ts @@ -0,0 +1,2023 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: unknown; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = Array; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +export type SimpleRequestBody = ModelWithString; + +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts new file mode 100644 index 000000000..51709ca90 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts @@ -0,0 +1,1128 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/solid-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await export_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await import_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await import_({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts new file mode 100644 index 000000000..7f932711f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/types.gen.ts new file mode 100644 index 000000000..8d98b563e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/types.gen.ts @@ -0,0 +1,2023 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: unknown; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = Array; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +export type SimpleRequestBody = ModelWithString; + +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts new file mode 100644 index 000000000..cae8ef1f5 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts @@ -0,0 +1,1128 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, DefaultService, SimpleService, ParametersService, DescriptionsService, DeprecatedService, RequestBodyService, FormDataService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, UploadService, FileResponseService, ComplexService, MultipartService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/svelte-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.export({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.import({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.import({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DeprecatedService.deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DeprecatedService.deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await FormDataService.postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await FormDataService.postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NoContentService.callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await CollectionFormatService.collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await TypesService.types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await UploadService.uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await UploadService.uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await FileResponseService.fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ComplexService.complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipartService.multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipartService.multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await MultipartService.multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ComplexService.complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts new file mode 100644 index 000000000..e94d5103c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts @@ -0,0 +1,506 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export class DefaultService { + public static export(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static patchApiVbyApiVersionNoTag(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static import(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static fooWow(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static getApiVbyApiVersionSimpleOperation(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); + } + +} + +export class SimpleService { + public static apiVVersionODataControllerCount(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); + } + + public static deleteCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static getCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static headCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static optionsCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static patchCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static postCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static putCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); + } + +} + +export class ParametersService { + public static deleteFoo(options: Options) { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); + } + + public static callWithParameters(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static callWithWeirdParameterNames(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static getCallWithOptionalParam(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static postCallWithOptionalParam(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class DescriptionsService { + public static callWithDescriptions(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); + } + +} + +export class DeprecatedService { + /** + * @deprecated + */ + public static deprecatedCall(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); + } + +} + +export class RequestBodyService { + public static postApiVbyApiVersionRequestBody(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class FormDataService { + public static postApiVbyApiVersionFormData(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); + } + +} + +export class DefaultsService { + public static callWithDefaultParameters(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callWithDefaultOptionalParameters(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callToTestOrderOfParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + +} + +export class DuplicateService { + public static duplicateName(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName2(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName3(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName4(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + +} + +export class NoContentService { + public static callWithNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); + } + + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + +} + +export class ResponseService { + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + + public static callWithResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithDuplicateResponses(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithResponses(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); + } + +} + +export class MultipleTags1Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags2Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags3Service { + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class CollectionFormatService { + public static collectionFormat(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); + } + +} + +export class TypesService { + public static types(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); + } + +} + +export class UploadService { + public static uploadFile(options: Options) { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); + } + +} + +export class FileResponseService { + public static fileResponse(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); + } + +} + +export class ComplexService { + public static complexTypes(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); + } + + public static complexParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); + } + +} + +export class MultipartService { + public static multipartResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); + } + + public static multipartRequest(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); + } + +} + +export class HeaderService { + public static callWithResultFromHeader(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); + } + +} + +export class ErrorService { + public static testErrorCode(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); + } + + /** + * Login User + */ + public static putWithFormUrlEncoded(options: Options) { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts new file mode 100644 index 000000000..8d98b563e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts @@ -0,0 +1,2023 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: unknown; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = Array; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +export type SimpleRequestBody = ModelWithString; + +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts new file mode 100644 index 000000000..9ba592ed0 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts @@ -0,0 +1,1129 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/svelte-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import type { AxiosError } from 'axios'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await export_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await import_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await import_({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts new file mode 100644 index 000000000..1d97df8bc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts new file mode 100644 index 000000000..9e76f2fd8 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts @@ -0,0 +1,410 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + responseType: 'blob', + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/types.gen.ts new file mode 100644 index 000000000..b970b0cd9 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/types.gen.ts @@ -0,0 +1,2023 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: unknown; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = Array; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +export type SimpleRequestBody = ModelWithString; + +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts new file mode 100644 index 000000000..7527d5f7d --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts @@ -0,0 +1,1128 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/svelte-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await export_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await import_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await import_({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts new file mode 100644 index 000000000..7f932711f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts new file mode 100644 index 000000000..8d98b563e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts @@ -0,0 +1,2023 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: unknown; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = Array; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +export type SimpleRequestBody = ModelWithString; + +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts new file mode 100644 index 000000000..cf95804c4 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts @@ -0,0 +1,1128 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, DefaultService, SimpleService, ParametersService, DescriptionsService, DeprecatedService, RequestBodyService, FormDataService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, UploadService, FileResponseService, ComplexService, MultipartService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; +import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/vue-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.export({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.import({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.import({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DeprecatedService.deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DeprecatedService.deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await FormDataService.postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await FormDataService.postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NoContentService.callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await CollectionFormatService.collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await TypesService.types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await UploadService.uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await UploadService.uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await FileResponseService.fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ComplexService.complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipartService.multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipartService.multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await MultipartService.multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ComplexService.complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts new file mode 100644 index 000000000..e94d5103c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts @@ -0,0 +1,506 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export class DefaultService { + public static export(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static patchApiVbyApiVersionNoTag(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static import(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static fooWow(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static getApiVbyApiVersionSimpleOperation(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); + } + +} + +export class SimpleService { + public static apiVVersionODataControllerCount(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); + } + + public static deleteCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static getCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static headCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static optionsCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static patchCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static postCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static putCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); + } + +} + +export class ParametersService { + public static deleteFoo(options: Options) { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); + } + + public static callWithParameters(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static callWithWeirdParameterNames(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static getCallWithOptionalParam(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static postCallWithOptionalParam(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class DescriptionsService { + public static callWithDescriptions(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); + } + +} + +export class DeprecatedService { + /** + * @deprecated + */ + public static deprecatedCall(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); + } + +} + +export class RequestBodyService { + public static postApiVbyApiVersionRequestBody(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class FormDataService { + public static postApiVbyApiVersionFormData(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); + } + +} + +export class DefaultsService { + public static callWithDefaultParameters(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callWithDefaultOptionalParameters(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callToTestOrderOfParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + +} + +export class DuplicateService { + public static duplicateName(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName2(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName3(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName4(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + +} + +export class NoContentService { + public static callWithNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); + } + + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + +} + +export class ResponseService { + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + + public static callWithResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithDuplicateResponses(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithResponses(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); + } + +} + +export class MultipleTags1Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags2Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags3Service { + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class CollectionFormatService { + public static collectionFormat(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); + } + +} + +export class TypesService { + public static types(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); + } + +} + +export class UploadService { + public static uploadFile(options: Options) { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); + } + +} + +export class FileResponseService { + public static fileResponse(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); + } + +} + +export class ComplexService { + public static complexTypes(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); + } + + public static complexParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); + } + +} + +export class MultipartService { + public static multipartResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); + } + + public static multipartRequest(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); + } + +} + +export class HeaderService { + public static callWithResultFromHeader(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); + } + +} + +export class ErrorService { + public static testErrorCode(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); + } + + /** + * Login User + */ + public static putWithFormUrlEncoded(options: Options) { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/types.gen.ts new file mode 100644 index 000000000..8d98b563e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/types.gen.ts @@ -0,0 +1,2023 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: unknown; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = Array; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +export type SimpleRequestBody = ModelWithString; + +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts new file mode 100644 index 000000000..12019c68f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts @@ -0,0 +1,1129 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; +import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/vue-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import type { AxiosError } from 'axios'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await export_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await import_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await import_({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts new file mode 100644 index 000000000..1d97df8bc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts new file mode 100644 index 000000000..9e76f2fd8 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts @@ -0,0 +1,410 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + responseType: 'blob', + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/types.gen.ts new file mode 100644 index 000000000..b970b0cd9 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/types.gen.ts @@ -0,0 +1,2023 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: unknown; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = Array; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +export type SimpleRequestBody = ModelWithString; + +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts new file mode 100644 index 000000000..70669eb30 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts @@ -0,0 +1,1128 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; +import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/vue-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await export_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await import_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await import_({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts new file mode 100644 index 000000000..7f932711f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/types.gen.ts new file mode 100644 index 000000000..8d98b563e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/types.gen.ts @@ -0,0 +1,2023 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: unknown; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = Array; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +export type SimpleRequestBody = ModelWithString; + +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/fastify.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/fastify.gen.ts new file mode 100644 index 000000000..03f6f3f43 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/fastify.gen.ts @@ -0,0 +1,130 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ImportData, ImportResponses, ApiVVersionODataControllerCountResponses, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponses, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponses, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, CallWithNoContentResponseResponses, CallWithResponseAndNoContentResponseResponses, DummyAResponses, DummyBResponses, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponses, CallWithResponsesErrors, CallWithResponsesResponses, CollectionFormatData, TypesData, TypesResponses, UploadFileData, UploadFileResponses, FileResponseData, FileResponseResponses, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponses, MultipartResponseResponses, MultipartRequestData, ComplexParamsData, ComplexParamsResponses, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Responses, PutWithFormUrlEncodedData } from './types.gen'; +import type { RouteHandler } from 'fastify'; + +export type RouteHandlers = { + import: RouteHandler<{ + Body: ImportData['body']; + Reply: Omit; + }>; + apiVVersionODataControllerCount: RouteHandler<{ + Reply: ApiVVersionODataControllerCountResponses; + }>; + getApiVbyApiVersionSimpleOperation: RouteHandler<{ + Params: GetApiVbyApiVersionSimpleOperationData['path']; + Reply: GetApiVbyApiVersionSimpleOperationResponses; + }>; + deleteFoo: RouteHandler<{ + Headers: DeleteFooData3['headers']; + Params: DeleteFooData3['path']; + }>; + callWithDescriptions: RouteHandler<{ + Querystring?: CallWithDescriptionsData['query']; + }>; + deprecatedCall: RouteHandler<{ + Headers: DeprecatedCallData['headers']; + }>; + callWithParameters: RouteHandler<{ + Body: CallWithParametersData['body']; + Headers: CallWithParametersData['headers']; + Params: CallWithParametersData['path']; + Querystring: CallWithParametersData['query']; + }>; + callWithWeirdParameterNames: RouteHandler<{ + Body: CallWithWeirdParameterNamesData['body']; + Headers: CallWithWeirdParameterNamesData['headers']; + Params: CallWithWeirdParameterNamesData['path']; + Querystring: CallWithWeirdParameterNamesData['query']; + }>; + getCallWithOptionalParam: RouteHandler<{ + Body: GetCallWithOptionalParamData['body']; + Querystring?: GetCallWithOptionalParamData['query']; + }>; + postCallWithOptionalParam: RouteHandler<{ + Body: PostCallWithOptionalParamData['body']; + Querystring: PostCallWithOptionalParamData['query']; + Reply: PostCallWithOptionalParamResponses; + }>; + postApiVbyApiVersionRequestBody: RouteHandler<{ + Body: PostApiVbyApiVersionRequestBodyData['body']; + Querystring?: PostApiVbyApiVersionRequestBodyData['query']; + }>; + postApiVbyApiVersionFormData: RouteHandler<{ + Body: PostApiVbyApiVersionFormDataData['body']; + Querystring?: PostApiVbyApiVersionFormDataData['query']; + }>; + callWithDefaultParameters: RouteHandler<{ + Querystring?: CallWithDefaultParametersData['query']; + }>; + callWithDefaultOptionalParameters: RouteHandler<{ + Querystring?: CallWithDefaultOptionalParametersData['query']; + }>; + callToTestOrderOfParams: RouteHandler<{ + Querystring: CallToTestOrderOfParamsData['query']; + }>; + callWithNoContentResponse: RouteHandler<{ + Reply: CallWithNoContentResponseResponses; + }>; + callWithResponseAndNoContentResponse: RouteHandler<{ + Reply: CallWithResponseAndNoContentResponseResponses; + }>; + dummyA: RouteHandler<{ + Reply: DummyAResponses; + }>; + dummyB: RouteHandler<{ + Reply: DummyBResponses; + }>; + callWithDuplicateResponses: RouteHandler<{ + Reply: Omit & CallWithDuplicateResponsesResponses; + }>; + callWithResponses: RouteHandler<{ + Reply: Omit & CallWithResponsesResponses; + }>; + collectionFormat: RouteHandler<{ + Querystring: CollectionFormatData['query']; + }>; + types: RouteHandler<{ + Params?: TypesData['path']; + Querystring: TypesData['query']; + Reply: TypesResponses; + }>; + uploadFile: RouteHandler<{ + Body: UploadFileData['body']; + Params: UploadFileData['path']; + Reply: UploadFileResponses; + }>; + fileResponse: RouteHandler<{ + Params: FileResponseData['path']; + Reply: FileResponseResponses; + }>; + complexTypes: RouteHandler<{ + Querystring: ComplexTypesData['query']; + Reply: ComplexTypesErrors & ComplexTypesResponses; + }>; + multipartResponse: RouteHandler<{ + Reply: MultipartResponseResponses; + }>; + multipartRequest: RouteHandler<{ + Body: MultipartRequestData['body']; + }>; + complexParams: RouteHandler<{ + Body: ComplexParamsData['body']; + Params: ComplexParamsData['path']; + Reply: ComplexParamsResponses; + }>; + callWithResultFromHeader: RouteHandler<{ + Reply: CallWithResultFromHeaderErrors & CallWithResultFromHeaderResponses; + }>; + testErrorCode: RouteHandler<{ + Querystring: TestErrorCodeData['query']; + Reply: TestErrorCodeErrors & TestErrorCodeResponses; + }>; + nonAsciiæøåÆøÅöôêÊ字符串: RouteHandler<{ + Querystring: NonAsciiæøåÆøÅöôêÊ字符串Data['query']; + Reply: NonAsciiæøåÆøÅöôêÊ字符串Responses; + }>; + putWithFormUrlEncoded: RouteHandler<{ + Body: PutWithFormUrlEncodedData['body']; + }>; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/types.gen.ts new file mode 100644 index 000000000..8d98b563e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/types.gen.ts @@ -0,0 +1,2023 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: unknown; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = Array; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +export type SimpleRequestBody = ModelWithString; + +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/zod/default/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/zod/default/zod.gen.ts new file mode 100644 index 000000000..de7def82c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/zod/default/zod.gen.ts @@ -0,0 +1,763 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { z } from 'zod'; + +export const z400 = z.string(); + +export const zCamelCaseCommentWithBreaks = z.number().int(); + +export const zCommentWithBreaks = z.number().int(); + +export const zCommentWithBackticks = z.number().int(); + +export const zCommentWithBackticksAndQuotes = z.number().int(); + +export const zCommentWithSlashes = z.number().int(); + +export const zCommentWithExpressionPlaceholders = z.number().int(); + +export const zCommentWithQuotes = z.number().int(); + +export const zCommentWithReservedCharacters = z.number().int(); + +export const zSimpleInteger = z.number().int(); + +export const zSimpleBoolean = z.boolean(); + +export const zSimpleString = z.string(); + +export const zNonAsciiStringæøåÆøÅöôêÊ字符串 = z.string(); + +export const zSimpleFile = z.string(); + +export const zModelWithString = z.object({ + prop: z.string().optional() +}); + +export const zSimpleReference = zModelWithString; + +export const zSimpleStringWithPattern = z.union([ + z.string().max(64).regex(/^[a-zA-Z0-9_]*$/), + z.null() +]); + +export const zEnumWithStrings = z.enum([ + 'Success', + 'Warning', + 'Error', + "'Single Quote'", + '"Double Quotes"', + 'Non-ascii: øæåôöØÆÅÔÖ字符串' +]); + +export const zEnumWithReplacedCharacters = z.enum([ + "'Single Quote'", + '"Double Quotes"', + 'øæåôöØÆÅÔÖ字符串', + '' +]); + +export const zEnumWithNumbers = z.unknown(); + +export const zEnumFromDescription = z.number(); + +export const zEnumWithExtensions = z.unknown(); + +export const zEnumWithXEnumNames = z.unknown(); + +export const zArrayWithNumbers = z.array(z.number().int()); + +export const zArrayWithBooleans = z.array(z.boolean()); + +export const zArrayWithStrings = z.array(z.string()).default(['test']); + +export const zArrayWithReferences = z.array(zModelWithString); + +export const zArrayWithArray = z.array(z.array(zModelWithString)); + +export const zArrayWithProperties = z.array(z.object({ + '16x16': zCamelCaseCommentWithBreaks.optional(), + bar: z.string().optional() +})); + +export const zArrayWithAnyOfProperties = z.array(z.unknown()); + +export const zAnyOfAnyAndNull = z.object({ + data: z.unknown().optional() +}); + +export const zAnyOfArrays = z.object({ + results: z.array(z.unknown()).optional() +}); + +export const zDictionaryWithString = z.object({}); + +export const zDictionaryWithPropertiesAndAdditionalProperties = z.object({ + foo: z.number().optional(), + bar: z.boolean().optional() +}); + +export const zDictionaryWithReference = z.object({}); + +export const zDictionaryWithArray = z.object({}); + +export const zDictionaryWithDictionary = z.object({}); + +export const zDictionaryWithProperties = z.object({}); + +export const zModelWithInteger = z.object({ + prop: z.number().int().optional() +}); + +export const zModelWithBoolean = z.object({ + prop: z.boolean().optional() +}); + +export const zModelWithStringError = z.object({ + prop: z.string().optional() +}); + +export const zModelFromZendesk = z.string(); + +export const zModelWithNullableString = z.object({ + nullableProp1: z.union([ + z.string(), + z.null() + ]).optional(), + nullableRequiredProp1: z.union([ + z.string(), + z.null() + ]), + nullableProp2: z.union([ + z.string(), + z.null() + ]).optional(), + nullableRequiredProp2: z.union([ + z.string(), + z.null() + ]), + 'foo_bar-enum': z.enum([ + 'Success', + 'Warning', + 'Error', + 'ØÆÅ字符串' + ]).optional() +}); + +export const zModelWithEnum = z.object({ + 'foo_bar-enum': z.enum([ + 'Success', + 'Warning', + 'Error', + 'ØÆÅ字符串' + ]).optional(), + statusCode: z.enum([ + '100', + '200 FOO', + '300 FOO_BAR', + '400 foo-bar', + '500 foo.bar', + '600 foo&bar' + ]).optional(), + bool: z.unknown().optional() +}); + +export const zModelWithEnumWithHyphen = z.object({ + 'foo-bar-baz-qux': z.enum([ + '3.0' + ]).optional() +}); + +export const zModelWithEnumFromDescription = z.object({ + test: z.number().int().optional() +}); + +export const zModelWithNestedEnums = z.object({ + dictionaryWithEnum: z.object({}).optional(), + dictionaryWithEnumFromDescription: z.object({}).optional(), + arrayWithEnum: z.array(z.enum([ + 'Success', + 'Warning', + 'Error' + ])).optional(), + arrayWithDescription: z.array(z.number().int()).optional(), + 'foo_bar-enum': z.enum([ + 'Success', + 'Warning', + 'Error', + 'ØÆÅ字符串' + ]).optional() +}); + +export const zModelWithProperties = z.object({ + required: z.string(), + requiredAndReadOnly: z.string().readonly(), + requiredAndNullable: z.union([ + z.string(), + z.null() + ]), + string: z.string().optional(), + number: z.number().optional(), + boolean: z.boolean().optional(), + reference: zModelWithString.optional(), + 'property with space': z.string().optional(), + default: z.string().optional(), + try: z.string().optional(), + '@namespace.string': z.string().readonly().optional(), + '@namespace.integer': z.number().int().readonly().optional() +}); + +export const zModelWithReference = z.object({ + prop: zModelWithProperties.optional() +}); + +export const zModelWithReadOnlyAndWriteOnly = z.object({ + foo: z.string(), + bar: z.string().readonly(), + baz: z.string() +}); + +export const zModelWithArrayReadOnlyAndWriteOnly = z.object({ + prop: z.array(zModelWithReadOnlyAndWriteOnly).optional(), + propWithFile: z.array(z.string()).optional(), + propWithNumber: z.array(z.number()).optional() +}); + +export const zModelWithArray = z.object({ + prop: z.array(zModelWithString).optional(), + propWithFile: z.array(z.string()).optional(), + propWithNumber: z.array(z.number()).optional() +}); + +export const zModelWithDictionary = z.object({ + prop: z.object({}).optional() +}); + +export const zDeprecatedModel = z.object({ + prop: z.string().optional() +}); + +export const zModelWithCircularReference: z.AnyZodObject = z.object({ + prop: z.lazy(() => { + return zModelWithCircularReference; + }).optional() +}); + +export const zCompositionWithOneOf = z.object({ + propA: z.union([ + zModelWithString, + zModelWithEnum, + zModelWithArray, + zModelWithDictionary + ]).optional() +}); + +export const zCompositionWithOneOfAnonymous = z.object({ + propA: z.union([ + z.object({ + propA: z.string().optional() + }), + z.string(), + z.number().int() + ]).optional() +}); + +export const zModelCircle = z.object({ + kind: z.string(), + radius: z.number().optional() +}); + +export const zModelSquare = z.object({ + kind: z.string(), + sideLength: z.number().optional() +}); + +export const zCompositionWithOneOfDiscriminator = z.union([ + z.object({ + kind: z.literal('circle').optional() + }).merge(zModelCircle), + z.object({ + kind: z.literal('square').optional() + }).merge(zModelSquare) +]); + +export const zCompositionWithAnyOf = z.object({ + propA: z.union([ + zModelWithString, + zModelWithEnum, + zModelWithArray, + zModelWithDictionary + ]).optional() +}); + +export const zCompositionWithAnyOfAnonymous = z.object({ + propA: z.union([ + z.object({ + propA: z.string().optional() + }), + z.string(), + z.number().int() + ]).optional() +}); + +export const zCompositionWithNestedAnyAndTypeNull = z.object({ + propA: z.union([ + z.array(z.union([ + zModelWithDictionary, + z.null() + ])), + z.array(z.union([ + zModelWithArray, + z.null() + ])) + ]).optional() +}); + +export const z3eNum1Период = z.enum([ + 'Bird', + 'Dog' +]); + +export const zConstValue = z.enum([ + 'ConstValue' +]); + +export const zCompositionWithNestedAnyOfAndNull = z.object({ + propA: z.union([ + z.array(z.unknown()), + z.null() + ]).optional() +}); + +export const zCompositionWithOneOfAndNullable = z.object({ + propA: z.union([ + z.object({ + boolean: z.boolean().optional() + }), + zModelWithEnum, + zModelWithArray, + zModelWithDictionary, + z.null() + ]).optional() +}); + +export const zCompositionWithOneOfAndSimpleDictionary = z.object({ + propA: z.union([ + z.boolean(), + z.object({}) + ]).optional() +}); + +export const zCompositionWithOneOfAndSimpleArrayDictionary = z.object({ + propA: z.union([ + z.boolean(), + z.object({}) + ]).optional() +}); + +export const zCompositionWithOneOfAndComplexArrayDictionary = z.object({ + propA: z.union([ + z.boolean(), + z.object({}) + ]).optional() +}); + +export const zCompositionWithAllOfAndNullable = z.object({ + propA: z.union([ + z.object({ + boolean: z.boolean().optional() + }).merge(zModelWithEnum).merge(zModelWithArray).merge(zModelWithDictionary), + z.null() + ]).optional() +}); + +export const zCompositionWithAnyOfAndNullable = z.object({ + propA: z.union([ + z.object({ + boolean: z.boolean().optional() + }), + zModelWithEnum, + zModelWithArray, + zModelWithDictionary, + z.null() + ]).optional() +}); + +export const zCompositionBaseModel = z.object({ + firstName: z.string().optional(), + lastname: z.string().optional() +}); + +export const zCompositionExtendedModel = zCompositionBaseModel.merge(z.object({ + age: z.number(), + firstName: z.string(), + lastname: z.string() +})); + +export const zModelWithNestedProperties = z.object({ + first: z.union([ + z.object({ + second: z.union([ + z.object({ + third: z.union([ + z.string().readonly(), + z.null() + ]).readonly() + }).readonly(), + z.null() + ]).readonly() + }).readonly(), + z.null() + ]).readonly() +}); + +export const zModelWithDuplicateProperties = z.object({ + prop: zModelWithString.optional() +}); + +export const zModelWithOrderedProperties = z.object({ + zebra: z.string().optional(), + apple: z.string().optional(), + hawaii: z.string().optional() +}); + +export const zModelWithDuplicateImports = z.object({ + propA: zModelWithString.optional(), + propB: zModelWithString.optional(), + propC: zModelWithString.optional() +}); + +export const zModelThatExtends = zModelWithString.merge(z.object({ + propExtendsA: z.string().optional(), + propExtendsB: zModelWithString.optional() +})); + +export const zModelThatExtendsExtends = zModelWithString.merge(zModelThatExtends).merge(z.object({ + propExtendsC: z.string().optional(), + propExtendsD: zModelWithString.optional() +})); + +export const zModelWithPattern = z.object({ + key: z.string().max(64).regex(/^[a-zA-Z0-9_]*$/), + name: z.string().max(255), + enabled: z.boolean().readonly().optional(), + modified: z.string().datetime().readonly().optional(), + id: z.string().regex(/^\d{2}-\d{3}-\d{4}$/).optional(), + text: z.string().regex(/^\w+$/).optional(), + patternWithSingleQuotes: z.string().regex(/^[a-zA-Z0-9']*$/).optional(), + patternWithNewline: z.string().regex(/aaa\nbbb/).optional(), + patternWithBacktick: z.string().regex(/aaa`bbb/).optional() +}); + +export const zFile = z.object({ + id: z.string().min(1).readonly().optional(), + updated_at: z.string().datetime().readonly().optional(), + created_at: z.string().datetime().readonly().optional(), + mime: z.string().min(1).max(24), + file: z.string().url().readonly().optional() +}); + +export const zDefault = z.object({ + name: z.string().optional() +}); + +export const zPageable = z.object({ + page: z.number().int().gte(0).optional().default(0), + size: z.number().int().gte(1).optional(), + sort: z.array(z.string()).optional() +}); + +export const zFreeFormObjectWithoutAdditionalProperties = z.object({}); + +export const zFreeFormObjectWithAdditionalPropertiesEqTrue = z.object({}); + +export const zFreeFormObjectWithAdditionalPropertiesEqEmptyObject = z.object({}); + +export const zModelWithConst = z.object({ + String: z.enum([ + 'String' + ]).optional(), + number: z.unknown().optional(), + null: z.unknown().optional(), + withType: z.enum([ + 'Some string' + ]).optional() +}); + +export const zModelWithAdditionalPropertiesEqTrue = z.object({ + prop: z.string().optional() +}); + +export const zNestedAnyOfArraysNullable = z.object({ + nullableArray: z.union([ + z.array(z.unknown()), + z.null() + ]).optional() +}); + +export const zSimpleParameter = z.unknown(); + +export const zCompositionWithOneOfAndProperties = z.intersection(z.union([ + z.object({ + foo: zSimpleParameter + }), + z.object({ + bar: zNonAsciiStringæøåÆøÅöôêÊ字符串 + }) +]), z.object({ + baz: z.union([ + z.number().int().gte(0), + z.null() + ]), + qux: z.number().int().gte(0) +})); + +export const zNullableObject = z.union([ + z.object({ + foo: z.string().optional() + }), + z.null() +]).default(null); + +export const zCharactersInDescription = z.string(); + +export const zModelWithNullableObject = z.object({ + data: zNullableObject.optional() +}); + +export const zModelWithOneOfEnum = z.union([ + z.object({ + foo: z.enum([ + 'Bar' + ]) + }), + z.object({ + foo: z.enum([ + 'Baz' + ]) + }), + z.object({ + foo: z.enum([ + 'Qux' + ]) + }), + z.object({ + content: z.string().datetime(), + foo: z.enum([ + 'Quux' + ]) + }), + z.object({ + content: z.unknown(), + foo: z.enum([ + 'Corge' + ]) + }) +]); + +export const zModelWithNestedArrayEnumsDataFoo = z.enum([ + 'foo', + 'bar' +]); + +export const zModelWithNestedArrayEnumsDataBar = z.enum([ + 'baz', + 'qux' +]); + +export const zModelWithNestedArrayEnumsData = z.object({ + foo: z.array(zModelWithNestedArrayEnumsDataFoo).optional(), + bar: z.array(zModelWithNestedArrayEnumsDataBar).optional() +}); + +export const zModelWithNestedArrayEnums = z.object({ + array_strings: z.array(z.string()).optional(), + data: zModelWithNestedArrayEnumsData.optional() +}); + +export const zModelWithNestedCompositionEnums = z.object({ + foo: zModelWithNestedArrayEnumsDataFoo.optional() +}); + +export const zModelWithConstantSizeArray = z.unknown(); + +export const zModelWithAnyOfConstantSizeArray = z.unknown(); + +export const zModelWithPrefixItemsConstantSizeArray = z.array(z.unknown()); + +export const zModelWithAnyOfConstantSizeArrayNullable = z.unknown(); + +export const zModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = z.unknown(); + +export const zModelWithAnyOfConstantSizeArrayAndIntersect = z.unknown(); + +export const zModelWithNumericEnumUnion = z.object({ + value: z.unknown().optional() +}); + +export const zModelWithBackticksInDescription = z.object({ + template: z.string().optional() +}); + +export const zModelWithOneOfAndProperties = z.intersection(z.union([ + zSimpleParameter, + zNonAsciiStringæøåÆøÅöôêÊ字符串 +]), z.object({ + baz: z.union([ + z.number().int().gte(0), + z.null() + ]), + qux: z.number().int().gte(0) +})); + +export const zParameterSimpleParameterUnused = z.string(); + +export const zPostServiceWithEmptyTagResponse = z.string(); + +export const zPostServiceWithEmptyTagResponse2 = z.string(); + +export const zDeleteFooData = z.string(); + +export const zDeleteFooData2 = z.string(); + +export const zImport = z.string(); + +export const zSchemaWithFormRestrictedKeys = z.object({ + description: z.string().optional(), + 'x-enum-descriptions': z.string().optional(), + 'x-enum-varnames': z.string().optional(), + 'x-enumNames': z.string().optional(), + title: z.string().optional(), + object: z.object({ + description: z.string().optional(), + 'x-enum-descriptions': z.string().optional(), + 'x-enum-varnames': z.string().optional(), + 'x-enumNames': z.string().optional(), + title: z.string().optional() + }).optional(), + array: z.array(z.object({ + description: z.string().optional(), + 'x-enum-descriptions': z.string().optional(), + 'x-enum-varnames': z.string().optional(), + 'x-enumNames': z.string().optional(), + title: z.string().optional() + })).optional() +}); + +export const zIoK8sApimachineryPkgApisMetaV1Preconditions = z.object({ + resourceVersion: z.string().optional(), + uid: z.string().optional() +}); + +export const zIoK8sApimachineryPkgApisMetaV1DeleteOptions = z.object({ + preconditions: zIoK8sApimachineryPkgApisMetaV1Preconditions.optional() +}); + +export const zAdditionalPropertiesUnknownIssue = z.object({}); + +export const zAdditionalPropertiesUnknownIssue2 = z.object({}); + +export const zAdditionalPropertiesUnknownIssue3 = z.intersection(z.string(), z.object({ + entries: z.object({}) +})); + +export const zAdditionalPropertiesIntegerIssue = z.object({ + value: z.number().int() +}); + +export const zGenericSchemaDuplicateIssue1SystemBoolean = z.object({ + item: z.boolean().optional(), + error: z.union([ + z.string(), + z.null() + ]).optional(), + hasError: z.boolean().readonly().optional(), + data: z.object({}).optional() +}); + +export const zGenericSchemaDuplicateIssue1SystemString = z.object({ + item: z.union([ + z.string(), + z.null() + ]).optional(), + error: z.union([ + z.string(), + z.null() + ]).optional(), + hasError: z.boolean().readonly().optional() +}); + +export const zOneOfAllOfIssue = z.union([ + z.intersection(z.union([ + zConstValue, + zGenericSchemaDuplicateIssue1SystemBoolean + ]), z3eNum1Период), + zGenericSchemaDuplicateIssue1SystemString +]); + +export const zImportResponse = z.union([ + zModelFromZendesk, + zModelWithReadOnlyAndWriteOnly +]); + +export const zApiVVersionODataControllerCountResponse = zModelFromZendesk; + +export const zGetApiVbyApiVersionSimpleOperationResponse = z.number(); + +export const zPostCallWithOptionalParamResponse = z.union([ + z.number(), + z.void() +]); + +export const zCallWithNoContentResponseResponse = z.void(); + +export const zCallWithResponseAndNoContentResponseResponse = z.union([ + z.number(), + z.void() +]); + +export const zDummyAResponse = z400; + +export const zDummyBResponse = z.void(); + +export const zCallWithResponseResponse = zImport; + +export const zCallWithDuplicateResponsesResponse = z.union([ + zModelWithBoolean.merge(zModelWithInteger), + zModelWithString +]); + +export const zCallWithResponsesResponse = z.union([ + z.object({ + '@namespace.string': z.string().readonly().optional(), + '@namespace.integer': z.number().int().readonly().optional(), + value: z.array(zModelWithString).readonly().optional() + }), + zModelThatExtends, + zModelThatExtendsExtends +]); + +export const zTypesResponse = z.union([ + z.number(), + z.string(), + z.boolean(), + z.object({}) +]); + +export const zUploadFileResponse = z.boolean(); + +export const zFileResponseResponse = z.string(); + +export const zComplexTypesResponse = z.array(zModelWithString); + +export const zMultipartResponseResponse = z.object({ + file: z.string().optional(), + metadata: z.object({ + foo: z.string().optional(), + bar: z.string().optional() + }).optional() +}); + +export const zComplexParamsResponse = zModelWithString; + +export const zNonAsciiæøåÆøÅöôêÊ字符串Response = z.array(zNonAsciiStringæøåÆøÅöôêÊ字符串); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/types.gen.ts new file mode 100644 index 000000000..4858fe0d7 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/types.gen.ts @@ -0,0 +1,87 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type FooReadWriteReadable = BarReadReadable; + +export type FooReadWriteWritable = BarReadWritable & { + foo?: string; +}; + +export type FooReadReadable = BarReadReadable & { + readonly foo?: string; +}; + +export type FooReadWritable = BarReadWritable; + +export type FooWriteReadable = BarWriteReadable; + +export type FooWriteWritable = BarWriteWritable & { + foo?: string; +}; + +export type BarReadReadable = Baz | { + readonly bar?: string; +}; + +export type BarReadWritable = Baz; + +export type BarWriteReadable = Baz; + +export type BarWriteWritable = Baz | { + bar?: string; +}; + +export type Baz = { + baz?: string; +}; + +export type PostFooReadWriteData = { + body: FooReadWriteWritable; + path?: never; + query?: never; + url: '/foo-read-write'; +}; + +export type PostFooReadWriteResponses = { + /** + * OK + */ + 200: FooReadWriteReadable; +}; + +export type PostFooReadWriteResponse = PostFooReadWriteResponses[keyof PostFooReadWriteResponses]; + +export type PostFooReadData = { + body: FooReadWritable; + path?: never; + query?: never; + url: '/foo-read'; +}; + +export type PostFooReadResponses = { + /** + * OK + */ + 200: FooReadReadable; +}; + +export type PostFooReadResponse = PostFooReadResponses[keyof PostFooReadResponses]; + +export type PostFooWriteData = { + body: FooWriteWritable; + path?: never; + query?: never; + url: '/foo-write'; +}; + +export type PostFooWriteResponses = { + /** + * OK + */ + 200: FooWriteReadable; +}; + +export type PostFooWriteResponse = PostFooWriteResponses[keyof PostFooWriteResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/sdk.gen.ts new file mode 100644 index 000000000..033f5c32d --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/sdk.gen.ts @@ -0,0 +1,47 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { GetFooData, GetBarData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const getFoo = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + security: [ + { + in: 'query', + name: 'foo', + type: 'apiKey' + } + ], + url: '/foo', + ...options + }); +}; + +export const getBar = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + security: [ + { + in: 'cookie', + name: 'bar', + type: 'apiKey' + } + ], + url: '/bar', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/types.gen.ts new file mode 100644 index 000000000..a641918b4 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/types.gen.ts @@ -0,0 +1,33 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type GetBarData = { + body?: never; + path?: never; + query?: never; + url: '/bar'; +}; + +export type GetBarResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-false/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-false/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/security-false/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-false/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-false/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/security-false/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-false/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-false/sdk.gen.ts new file mode 100644 index 000000000..14ebd7036 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/security-false/sdk.gen.ts @@ -0,0 +1,26 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { GetFooData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const getFoo = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/foo', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-false/types.gen.ts new file mode 100644 index 000000000..884795c3f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/security-false/types.gen.ts @@ -0,0 +1,19 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/sdk.gen.ts new file mode 100644 index 000000000..bcb05a226 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/sdk.gen.ts @@ -0,0 +1,32 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { GetFooData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const getFoo = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + security: [ + { + scheme: 'bearer', + type: 'http' + } + ], + url: '/foo', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/types.gen.ts new file mode 100644 index 000000000..884795c3f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/types.gen.ts @@ -0,0 +1,19 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/sdk.gen.ts new file mode 100644 index 000000000..bcb05a226 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/sdk.gen.ts @@ -0,0 +1,32 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { GetFooData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const getFoo = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + security: [ + { + scheme: 'bearer', + type: 'http' + } + ], + url: '/foo', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/types.gen.ts new file mode 100644 index 000000000..884795c3f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/types.gen.ts @@ -0,0 +1,19 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/sdk.gen.ts new file mode 100644 index 000000000..bcb05a226 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/sdk.gen.ts @@ -0,0 +1,32 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { GetFooData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const getFoo = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + security: [ + { + scheme: 'bearer', + type: 'http' + } + ], + url: '/foo', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/types.gen.ts new file mode 100644 index 000000000..884795c3f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/types.gen.ts @@ -0,0 +1,19 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/servers/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/servers/client.gen.ts new file mode 100644 index 000000000..89e76c00f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/servers/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'https://foo.com/v1' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/servers/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/servers/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/servers/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/servers/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/servers/types.gen.ts new file mode 100644 index 000000000..fa745dd45 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/servers/types.gen.ts @@ -0,0 +1,21 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: string; +}; + +export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; + +export type ClientOptions = { + baseUrl: 'https://foo.com/v1' | `${string}://${string}/v1` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/transformers.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/transformers.gen.ts new file mode 100644 index 000000000..0b520225d --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/transformers.gen.ts @@ -0,0 +1,35 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { GetFooResponse } from './types.gen'; + +const quxSchemaResponseTransformer = (data: any) => { + if (data.baz) { + data.baz = new Date(data.baz); + } + return data; +}; + +const bazSchemaResponseTransformer = (data: any) => { + data = quxSchemaResponseTransformer(data); + data.bar = new Date(data.bar); + return data; +}; + +const barSchemaResponseTransformer = (data: any) => { + data.foo = data.foo.map((item: any) => { + return bazSchemaResponseTransformer(item); + }); + return data; +}; + +const fooSchemaResponseTransformer = (data: any) => { + data.foo = data.foo.map((item: any) => { + return barSchemaResponseTransformer(item); + }); + return data; +}; + +export const getFooResponseTransformer = async (data: any): Promise => { + data = fooSchemaResponseTransformer(data); + return data; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/types.gen.ts new file mode 100644 index 000000000..25ae9771c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/types.gen.ts @@ -0,0 +1,46 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + foo: Array; +}; + +export type Bar = { + foo: Array; + bar: 'foo' | 'bar' | 'baz'; +}; + +export type Baz = Qux & { + id: 'Baz'; +} & { + foo: number; + bar: Date; + baz: 'foo' | 'bar' | 'baz'; + qux: number; +}; + +export type Qux = { + foo: number; + bar: number; + baz?: Date; + id: string; +}; + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: Foo; +}; + +export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/transformers.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/transformers.gen.ts new file mode 100644 index 000000000..0f3a28be1 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/transformers.gen.ts @@ -0,0 +1,23 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { GetFooResponse } from './types.gen'; + +const fooSchemaResponseTransformer = (data: any) => { + if (data.foo) { + data.foo = new Date(data.foo); + } + if (data.bar) { + data.bar = new Date(data.bar); + } + if (data.requiredBaz) { + data.requiredBaz = new Date(data.requiredBaz); + } + return data; +}; + +export const getFooResponseTransformer = async (data: any): Promise => { + data = data.map((item: any) => { + return fooSchemaResponseTransformer(item); + }); + return data; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/types.gen.ts new file mode 100644 index 000000000..86e86d778 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/types.gen.ts @@ -0,0 +1,27 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + foo?: Date; + bar?: Date | null; + requiredBaz: Date | null; +}; + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: Array; +}; + +export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/transformers.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/transformers.gen.ts new file mode 100644 index 000000000..5ad0b923d --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/transformers.gen.ts @@ -0,0 +1,11 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { GetFooResponse } from './types.gen'; + +export const getFooResponseTransformer = async (data: any): Promise => { + data.foo = data.foo.map((item: any) => { + item.baz = new Date(item.baz); + return item; + }); + return data; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/types.gen.ts new file mode 100644 index 000000000..6820b0d90 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/types.gen.ts @@ -0,0 +1,25 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: { + foo: Array<{ + baz: Date; + }>; + }; +}; + +export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/type-invalid/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/type-invalid/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/type-invalid/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/type-invalid/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/type-invalid/types.gen.ts new file mode 100644 index 000000000..2589e80df --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/type-invalid/types.gen.ts @@ -0,0 +1,7 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = unknown; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/validators/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/validators/zod.gen.ts new file mode 100644 index 000000000..6ac6de592 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.0.x/validators/zod.gen.ts @@ -0,0 +1,23 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { z } from 'zod'; + +export const zBar: z.AnyZodObject = z.object({ + foo: z.lazy(() => { + return zFoo; + }).optional() +}); + +export const zFoo: z.ZodTypeAny = z.union([ + z.object({ + foo: z.string().regex(/^\d{3}-\d{2}-\d{4}$/).optional(), + bar: zBar.optional(), + baz: z.array(z.lazy(() => { + return zFoo; + })).optional(), + qux: z.number().optional().default(0) + }), + z.null() +]).default(null); + +export const zBaz = z.string().regex(/foo\nbar/).readonly().default('baz'); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-false/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-false/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-false/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-false/types.gen.ts new file mode 100644 index 000000000..6b84c8ade --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-false/types.gen.ts @@ -0,0 +1,17 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + foo: string; +}; + +export type Bar = Foo & { + [key: string]: never; +}; + +export type Baz = Foo & { + bar: string; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-true/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-true/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-true/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-true/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-true/types.gen.ts new file mode 100644 index 000000000..83d16749a --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-true/types.gen.ts @@ -0,0 +1,21 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + foo: string; + [key: string]: unknown | string; +}; + +export type Bar = Foo & { + [key: string]: unknown; +}; + +export type Baz = Foo & { + bar: string; + [key: string]: unknown | string; +}; + +export type Qux = {}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-undefined/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-undefined/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-undefined/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-undefined/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-undefined/types.gen.ts new file mode 100644 index 000000000..cb1ed0592 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-undefined/types.gen.ts @@ -0,0 +1,11 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + foo: { + [key: string]: unknown; + }; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/array-items-one-of-length-1/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/array-items-one-of-length-1/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/array-items-one-of-length-1/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/array-items-one-of-length-1/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/array-items-one-of-length-1/types.gen.ts new file mode 100644 index 000000000..b133cfb1a --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/array-items-one-of-length-1/types.gen.ts @@ -0,0 +1,11 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + foo?: Array; +}; + +export type Bar = string; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/sdk.gen.ts new file mode 100644 index 000000000..d305a220c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/sdk.gen.ts @@ -0,0 +1,31 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { PostFooData, PostFooResponse } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const postFoo = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + bodySerializer: null, + url: '/foo', + ...options, + headers: { + 'Content-Type': 'text/plain', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/types.gen.ts new file mode 100644 index 000000000..ff0becc55 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/types.gen.ts @@ -0,0 +1,21 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type PostFooData = { + body: string; + path?: never; + query?: never; + url: '/foo'; +}; + +export type PostFooResponses = { + /** + * OK + */ + 200: string; +}; + +export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/case-PascalCase/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/case-PascalCase/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/case-PascalCase/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/case-PascalCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/case-PascalCase/types.gen.ts new file mode 100644 index 000000000..45f3cd481 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/case-PascalCase/types.gen.ts @@ -0,0 +1,89 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * original name: 201 + */ +export type _201 = number; + +/** + * original name: Foo + */ +export type Foo = { + /** + * original name: fooBar + */ + fooBar: FooBar; + /** + * original name: BarBaz + */ + BarBaz: Foo; + /** + * original name: qux_quux + */ + qux_quux: { + /** + * original name: fooBar + */ + fooBar: FooBar2; + /** + * original name: BarBaz + */ + BarBaz: FooBar3; + /** + * original name: qux_quux + */ + qux_quux: boolean; + }; +}; + +/** + * original name: foo_bar + */ +export type FooBar = boolean; + +/** + * original name: fooBar + */ +export type FooBar2 = number; + +/** + * original name: FooBar + */ +export type FooBar3 = string; + +export type GetFooData = { + body: Foo; + path?: never; + query: { + /** + * original name: fooBar + */ + fooBar: string; + /** + * original name: BarBaz + */ + BarBaz: string; + /** + * original name: qux_quux + */ + qux_quux: string; + }; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: Foo; + /** + * OK + */ + 201: _201; +}; + +export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/case-camelCase/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/case-camelCase/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/case-camelCase/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/case-camelCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/case-camelCase/types.gen.ts new file mode 100644 index 000000000..2b4016129 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/case-camelCase/types.gen.ts @@ -0,0 +1,89 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * original name: 201 + */ +export type _201 = number; + +/** + * original name: Foo + */ +export type foo = { + /** + * original name: fooBar + */ + fooBar: fooBar; + /** + * original name: BarBaz + */ + BarBaz: foo; + /** + * original name: qux_quux + */ + qux_quux: { + /** + * original name: fooBar + */ + fooBar: fooBar2; + /** + * original name: BarBaz + */ + BarBaz: fooBar3; + /** + * original name: qux_quux + */ + qux_quux: boolean; + }; +}; + +/** + * original name: foo_bar + */ +export type fooBar = boolean; + +/** + * original name: fooBar + */ +export type fooBar2 = number; + +/** + * original name: FooBar + */ +export type fooBar3 = string; + +export type getFooData = { + body: foo; + path?: never; + query: { + /** + * original name: fooBar + */ + fooBar: string; + /** + * original name: BarBaz + */ + BarBaz: string; + /** + * original name: qux_quux + */ + qux_quux: string; + }; + url: '/foo'; +}; + +export type getFooResponses = { + /** + * OK + */ + 200: foo; + /** + * OK + */ + 201: _201; +}; + +export type getFooResponse = getFooResponses[keyof getFooResponses]; + +export type clientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/case-snake_case/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/case-snake_case/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/case-snake_case/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/case-snake_case/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/case-snake_case/types.gen.ts new file mode 100644 index 000000000..0e7c47f83 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/case-snake_case/types.gen.ts @@ -0,0 +1,89 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * original name: 201 + */ +export type _201 = number; + +/** + * original name: Foo + */ +export type foo = { + /** + * original name: fooBar + */ + fooBar: foo_bar; + /** + * original name: BarBaz + */ + BarBaz: foo; + /** + * original name: qux_quux + */ + qux_quux: { + /** + * original name: fooBar + */ + fooBar: foo_bar2; + /** + * original name: BarBaz + */ + BarBaz: foo_bar3; + /** + * original name: qux_quux + */ + qux_quux: boolean; + }; +}; + +/** + * original name: foo_bar + */ +export type foo_bar = boolean; + +/** + * original name: fooBar + */ +export type foo_bar2 = number; + +/** + * original name: FooBar + */ +export type foo_bar3 = string; + +export type get_foo_data = { + body: foo; + path?: never; + query: { + /** + * original name: fooBar + */ + fooBar: string; + /** + * original name: BarBaz + */ + BarBaz: string; + /** + * original name: qux_quux + */ + qux_quux: string; + }; + url: '/foo'; +}; + +export type get_foo_responses = { + /** + * OK + */ + 200: foo; + /** + * OK + */ + 201: _201; +}; + +export type get_foo_response = get_foo_responses[keyof get_foo_responses]; + +export type client_options = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/case/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/case/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/case/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/case/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/case/types.gen.ts new file mode 100644 index 000000000..0118c79fe --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/case/types.gen.ts @@ -0,0 +1,89 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * original name: 201 + */ +export type _201 = number; + +/** + * original name: Foo + */ +export type Foo = { + /** + * original name: fooBar + */ + fooBar: foo_bar; + /** + * original name: BarBaz + */ + BarBaz: Foo; + /** + * original name: qux_quux + */ + qux_quux: { + /** + * original name: fooBar + */ + fooBar: fooBar; + /** + * original name: BarBaz + */ + BarBaz: FooBar; + /** + * original name: qux_quux + */ + qux_quux: boolean; + }; +}; + +/** + * original name: foo_bar + */ +export type foo_bar = boolean; + +/** + * original name: fooBar + */ +export type fooBar = number; + +/** + * original name: FooBar + */ +export type FooBar = string; + +export type GetFoo_Data = { + body: Foo; + path?: never; + query: { + /** + * original name: fooBar + */ + fooBar: string; + /** + * original name: BarBaz + */ + BarBaz: string; + /** + * original name: qux_quux + */ + qux_quux: string; + }; + url: '/foo'; +}; + +export type GetFoo_Responses = { + /** + * OK + */ + 200: Foo; + /** + * OK + */ + 201: _201; +}; + +export type GetFoo_Response = GetFoo_Responses[keyof GetFoo_Responses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/client.gen.ts new file mode 100644 index 000000000..c4dedd629 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/types.gen.ts new file mode 100644 index 000000000..9cb3fcf99 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/client.gen.ts new file mode 100644 index 000000000..1d97df8bc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/types.gen.ts new file mode 100644 index 000000000..9cb3fcf99 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/client.gen.ts new file mode 100644 index 000000000..1d97df8bc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/types.gen.ts new file mode 100644 index 000000000..a0d27c8ae --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base'; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/client.gen.ts new file mode 100644 index 000000000..7b197288a --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'https://foo.com' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/types.gen.ts new file mode 100644 index 000000000..9cb3fcf99 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client.gen.ts new file mode 100644 index 000000000..64c0080e8 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.cjs b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.cjs new file mode 100644 index 000000000..ef952517e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.cjs @@ -0,0 +1,2 @@ +'use strict';var B=require('axios');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var B__default=/*#__PURE__*/_interopDefault(B);var w=async(t,e)=>{let r=typeof e=="function"?await e(t):e;if(r)return t.scheme==="bearer"?`Bearer ${r}`:t.scheme==="basic"?`Basic ${btoa(r)}`:r},z=(t,e,r)=>{typeof r=="string"||r instanceof Blob?t.append(e,r):t.append(e,JSON.stringify(r));},O=(t,e,r)=>{typeof r=="string"?t.append(e,r):t.append(e,JSON.stringify(r));},j={bodySerializer:t=>{let e=new FormData;return Object.entries(t).forEach(([r,i])=>{i!=null&&(Array.isArray(i)?i.forEach(a=>z(e,r,a)):z(e,r,i));}),e}},k={bodySerializer:t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString():r)},$={bodySerializer:t=>{let e=new URLSearchParams;return Object.entries(t).forEach(([r,i])=>{i!=null&&(Array.isArray(i)?i.forEach(a=>O(e,r,a)):O(e,r,i));}),e.toString()}},q=t=>{switch(t){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},v=t=>{switch(t){case "form":return ",";case "pipeDelimited":return "|";case "spaceDelimited":return "%20";default:return ","}},P=t=>{switch(t){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},h=({allowReserved:t,explode:e,name:r,style:i,value:a})=>{if(!e){let n=(t?a:a.map(s=>encodeURIComponent(s))).join(v(i));switch(i){case "label":return `.${n}`;case "matrix":return `;${r}=${n}`;case "simple":return n;default:return `${r}=${n}`}}let o=q(i),l=a.map(n=>i==="label"||i==="simple"?t?n:encodeURIComponent(n):f({allowReserved:t,name:r,value:n})).join(o);return i==="label"||i==="matrix"?o+l:l},f=({allowReserved:t,name:e,value:r})=>{if(r==null)return "";if(typeof r=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return `${e}=${t?r:encodeURIComponent(r)}`},g=({allowReserved:t,explode:e,name:r,style:i,value:a})=>{if(a instanceof Date)return `${r}=${a.toISOString()}`;if(i!=="deepObject"&&!e){let n=[];Object.entries(a).forEach(([u,d])=>{n=[...n,u,t?d:encodeURIComponent(d)];});let s=n.join(",");switch(i){case "form":return `${r}=${s}`;case "label":return `.${s}`;case "matrix":return `;${r}=${s}`;default:return s}}let o=P(i),l=Object.entries(a).map(([n,s])=>f({allowReserved:t,name:i==="deepObject"?`${r}[${n}]`:n,value:s})).join(o);return i==="label"||i==="matrix"?o+l:l};var T=/\{[^{}]+\}/g,E=({path:t,url:e})=>{let r=e,i=e.match(T);if(i)for(let a of i){let o=false,l=a.substring(1,a.length-1),n="simple";l.endsWith("*")&&(o=true,l=l.substring(0,l.length-1)),l.startsWith(".")?(l=l.substring(1),n="label"):l.startsWith(";")&&(l=l.substring(1),n="matrix");let s=t[l];if(s==null)continue;if(Array.isArray(s)){r=r.replace(a,h({explode:o,name:l,style:n,value:s}));continue}if(typeof s=="object"){r=r.replace(a,g({explode:o,name:l,style:n,value:s}));continue}if(n==="matrix"){r=r.replace(a,`;${f({name:l,value:s})}`);continue}let u=encodeURIComponent(n==="label"?`.${s}`:s);r=r.replace(a,u);}return r},U=({allowReserved:t,array:e,object:r}={})=>a=>{let o=[];if(a&&typeof a=="object")for(let l in a){let n=a[l];if(n!=null){if(Array.isArray(n)){o=[...o,h({allowReserved:t,explode:true,name:l,style:"form",value:n,...e})];continue}if(typeof n=="object"){o=[...o,g({allowReserved:t,explode:true,name:l,style:"deepObject",value:n,...r})];continue}o=[...o,f({allowReserved:t,name:l,value:n})];}}return o.join("&")},A=async({security:t,...e})=>{for(let r of t){let i=await w(r,e.auth);if(!i)continue;let a=r.name??"Authorization";switch(r.in){case "query":e.query||(e.query={}),e.query[a]=i;break;case "cookie":{let o=`${a}=${i}`;"Cookie"in e.headers&&e.headers.Cookie?e.headers.Cookie=`${e.headers.Cookie}; ${o}`:e.headers.Cookie=o;break}case "header":default:e.headers[a]=i;break}return}},b=t=>D({path:t.path,query:t.paramsSerializer?void 0:t.query,querySerializer:typeof t.querySerializer=="function"?t.querySerializer:U(t.querySerializer),url:t.url}),D=({path:t,query:e,querySerializer:r,url:i})=>{let o=i.startsWith("/")?i:`/${i}`;t&&(o=E({path:t,url:o}));let l=e?r(e):"";return l.startsWith("?")&&(l=l.substring(1)),l&&(o+=`?${l}`),o},C=(t,e)=>{let r={...t,...e};return r.headers=y(t.headers,e.headers),r},H=["common","delete","get","head","patch","post","put"],y=(...t)=>{let e={};for(let r of t){if(!r||typeof r!="object")continue;let i=Object.entries(r);for(let[a,o]of i)if(H.includes(a)&&typeof o=="object")e[a]={...e[a],...o};else if(o===null)delete e[a];else if(Array.isArray(o))for(let l of o)e[a]=[...e[a]??[],l];else o!==void 0&&(e[a]=typeof o=="object"?JSON.stringify(o):o);}return e},S=(t={})=>({...t});var I=(t={})=>{let e=C(S(),t),{auth:r,...i}=e,a=B__default.default.create(i),o=()=>({...e}),l=s=>(e=C(e,s),a.defaults={...a.defaults,...e,headers:y(a.defaults.headers,e.headers)},o()),n=async s=>{let u={...e,...s,axios:s.axios??e.axios??a,headers:y(e.headers,s.headers)};u.security&&await A({...u,security:u.security}),u.body&&u.bodySerializer&&(u.body=u.bodySerializer(u.body));let d=b(u);try{let m=u.axios,{auth:c,...R}=u,x=await m({...R,baseURL:u.baseURL,data:u.body,headers:u.headers,params:u.paramsSerializer?u.query:void 0,url:d}),{data:p}=x;return u.responseType==="json"&&(u.responseValidator&&await u.responseValidator(p),u.responseTransformer&&(p=await u.responseTransformer(p))),{...x,data:p??{}}}catch(m){let c=m;if(u.throwOnError)throw c;return c.error=c.response?.data??{},c}};return {buildUrl:b,delete:s=>n({...s,method:"DELETE"}),get:s=>n({...s,method:"GET"}),getConfig:o,head:s=>n({...s,method:"HEAD"}),instance:a,options:s=>n({...s,method:"OPTIONS"}),patch:s=>n({...s,method:"PATCH"}),post:s=>n({...s,method:"POST"}),put:s=>n({...s,method:"PUT"}),request:n,setConfig:l}};exports.createClient=I;exports.createConfig=S;exports.formDataBodySerializer=j;exports.jsonBodySerializer=k;exports.urlSearchParamsBodySerializer=$;//# sourceMappingURL=index.cjs.map +//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.d.cts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.d.cts new file mode 100644 index 000000000..99cecdf99 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.d.cts @@ -0,0 +1,207 @@ +import { CreateAxiosDefaults, AxiosStatic, AxiosResponse, AxiosError, AxiosInstance } from 'axios'; + +type AuthToken = string | undefined; +interface Auth { + /** + * Which part of the request do we use to send the auth? + * + * @default 'header' + */ + in?: 'header' | 'query' | 'cookie'; + /** + * Header or query parameter name. + * + * @default 'Authorization' + */ + name?: string; + scheme?: 'basic' | 'bearer'; + type: 'apiKey' | 'http'; +} +interface SerializerOptions { + /** + * @default true + */ + explode: boolean; + style: T; +} +type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; +type ObjectStyle = 'form' | 'deepObject'; + +type QuerySerializer = (query: Record) => string; +type BodySerializer = (body: any) => any; +interface QuerySerializerOptions { + allowReserved?: boolean; + array?: SerializerOptions; + object?: SerializerOptions; +} +declare const formDataBodySerializer: { + bodySerializer: | Array>>(body: T) => FormData; +}; +declare const jsonBodySerializer: { + bodySerializer: (body: T) => string; +}; +declare const urlSearchParamsBodySerializer: { + bodySerializer: | Array>>(body: T) => string; +}; + +interface Client$1 { + /** + * Returns the final request URL. + */ + buildUrl: BuildUrlFn; + connect: MethodFn; + delete: MethodFn; + get: MethodFn; + getConfig: () => Config; + head: MethodFn; + options: MethodFn; + patch: MethodFn; + post: MethodFn; + put: MethodFn; + request: RequestFn; + setConfig: (config: Config) => Config; + trace: MethodFn; +} +interface Config$1 { + /** + * Auth token or a function returning auth token. The resolved value will be + * added to the request payload as defined by its `security` array. + */ + auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; + /** + * A function for serializing request body parameter. By default, + * {@link JSON.stringify()} will be used. + */ + bodySerializer?: BodySerializer | null; + /** + * An object containing any HTTP headers that you want to pre-populate your + * `Headers` object with. + * + * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} + */ + headers?: RequestInit['headers'] | Record; + /** + * The request method. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} + */ + method?: 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE'; + /** + * A function for serializing request query parameters. By default, arrays + * will be exploded in form style, objects will be exploded in deepObject + * style, and reserved characters are percent-encoded. + * + * This method will have no effect if the native `paramsSerializer()` Axios + * API function is used. + * + * {@link https://swagger.io/docs/specification/serialization/#query View examples} + */ + querySerializer?: QuerySerializer | QuerySerializerOptions; + /** + * A function transforming response data before it's returned. This is useful + * for post-processing data, e.g. converting ISO strings into Date objects. + */ + responseTransformer?: (data: unknown) => Promise; + /** + * A function validating response data. This is useful if you want to ensure + * the response conforms to the desired shape, so it can be safely passed to + * the transformers and returned to the user. + */ + responseValidator?: (data: unknown) => Promise; +} + +interface Config extends Omit, Config$1 { + /** + * Axios implementation. You can use this option to provide a custom + * Axios instance. + * + * @default axios + */ + axios?: AxiosStatic; + /** + * Base URL for all requests made by this client. + */ + baseURL?: T['baseURL']; + /** + * An object containing any HTTP headers that you want to pre-populate your + * `Headers` object with. + * + * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} + */ + headers?: CreateAxiosDefaults['headers'] | Record; + /** + * Throw an error instead of returning it in the response? + * + * @default false + */ + throwOnError?: T['throwOnError']; +} +interface RequestOptions extends Config<{ + throwOnError: ThrowOnError; +}> { + /** + * Any body that you want to add to your request. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} + */ + body?: unknown; + path?: Record; + query?: Record; + /** + * Security mechanism(s) to use for the request. + */ + security?: ReadonlyArray; + url: Url; +} +type RequestResult = ThrowOnError extends true ? Promise> : Promise<(AxiosResponse & { + error: undefined; +}) | (AxiosError & { + data: undefined; + error: TError; +})>; +interface ClientOptions { + baseURL?: string; + throwOnError?: boolean; +} +type MethodFn = (options: Omit, 'method'>) => RequestResult; +type RequestFn = (options: Omit, 'method'> & Pick>, 'method'>) => RequestResult; +type BuildUrlFn = ; + query?: Record; + url: string; +}>(options: Pick & Omit, 'axios'>) => string; +type Client = Client$1 & { + instance: AxiosInstance; +}; +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +type CreateClientConfig = (override?: Config) => Config & T>; +interface TDataShape { + body?: unknown; + headers?: unknown; + path?: unknown; + query?: unknown; + url: string; +} +type OmitKeys = Pick>; +type Options = OmitKeys, 'body' | 'path' | 'query' | 'url'> & Omit; +type OptionsLegacyParser = TData extends { + body?: any; +} ? TData extends { + headers?: any; +} ? OmitKeys, 'body' | 'headers' | 'url'> & TData : OmitKeys, 'body' | 'url'> & TData & Pick, 'headers'> : TData extends { + headers?: any; +} ? OmitKeys, 'headers' | 'url'> & TData & Pick, 'body'> : OmitKeys, 'url'> & TData; + +declare const createClient: (config?: Config) => Client; + +declare const createConfig: (override?: Config & T>) => Config & T>; + +export { type Auth, type Client, type ClientOptions, type Config, type CreateClientConfig, type Options, type OptionsLegacyParser, type QuerySerializerOptions, type RequestOptions, type RequestResult, type TDataShape, createClient, createConfig, formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer }; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.d.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.d.ts new file mode 100644 index 000000000..99cecdf99 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.d.ts @@ -0,0 +1,207 @@ +import { CreateAxiosDefaults, AxiosStatic, AxiosResponse, AxiosError, AxiosInstance } from 'axios'; + +type AuthToken = string | undefined; +interface Auth { + /** + * Which part of the request do we use to send the auth? + * + * @default 'header' + */ + in?: 'header' | 'query' | 'cookie'; + /** + * Header or query parameter name. + * + * @default 'Authorization' + */ + name?: string; + scheme?: 'basic' | 'bearer'; + type: 'apiKey' | 'http'; +} +interface SerializerOptions { + /** + * @default true + */ + explode: boolean; + style: T; +} +type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; +type ObjectStyle = 'form' | 'deepObject'; + +type QuerySerializer = (query: Record) => string; +type BodySerializer = (body: any) => any; +interface QuerySerializerOptions { + allowReserved?: boolean; + array?: SerializerOptions; + object?: SerializerOptions; +} +declare const formDataBodySerializer: { + bodySerializer: | Array>>(body: T) => FormData; +}; +declare const jsonBodySerializer: { + bodySerializer: (body: T) => string; +}; +declare const urlSearchParamsBodySerializer: { + bodySerializer: | Array>>(body: T) => string; +}; + +interface Client$1 { + /** + * Returns the final request URL. + */ + buildUrl: BuildUrlFn; + connect: MethodFn; + delete: MethodFn; + get: MethodFn; + getConfig: () => Config; + head: MethodFn; + options: MethodFn; + patch: MethodFn; + post: MethodFn; + put: MethodFn; + request: RequestFn; + setConfig: (config: Config) => Config; + trace: MethodFn; +} +interface Config$1 { + /** + * Auth token or a function returning auth token. The resolved value will be + * added to the request payload as defined by its `security` array. + */ + auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; + /** + * A function for serializing request body parameter. By default, + * {@link JSON.stringify()} will be used. + */ + bodySerializer?: BodySerializer | null; + /** + * An object containing any HTTP headers that you want to pre-populate your + * `Headers` object with. + * + * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} + */ + headers?: RequestInit['headers'] | Record; + /** + * The request method. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} + */ + method?: 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE'; + /** + * A function for serializing request query parameters. By default, arrays + * will be exploded in form style, objects will be exploded in deepObject + * style, and reserved characters are percent-encoded. + * + * This method will have no effect if the native `paramsSerializer()` Axios + * API function is used. + * + * {@link https://swagger.io/docs/specification/serialization/#query View examples} + */ + querySerializer?: QuerySerializer | QuerySerializerOptions; + /** + * A function transforming response data before it's returned. This is useful + * for post-processing data, e.g. converting ISO strings into Date objects. + */ + responseTransformer?: (data: unknown) => Promise; + /** + * A function validating response data. This is useful if you want to ensure + * the response conforms to the desired shape, so it can be safely passed to + * the transformers and returned to the user. + */ + responseValidator?: (data: unknown) => Promise; +} + +interface Config extends Omit, Config$1 { + /** + * Axios implementation. You can use this option to provide a custom + * Axios instance. + * + * @default axios + */ + axios?: AxiosStatic; + /** + * Base URL for all requests made by this client. + */ + baseURL?: T['baseURL']; + /** + * An object containing any HTTP headers that you want to pre-populate your + * `Headers` object with. + * + * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} + */ + headers?: CreateAxiosDefaults['headers'] | Record; + /** + * Throw an error instead of returning it in the response? + * + * @default false + */ + throwOnError?: T['throwOnError']; +} +interface RequestOptions extends Config<{ + throwOnError: ThrowOnError; +}> { + /** + * Any body that you want to add to your request. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} + */ + body?: unknown; + path?: Record; + query?: Record; + /** + * Security mechanism(s) to use for the request. + */ + security?: ReadonlyArray; + url: Url; +} +type RequestResult = ThrowOnError extends true ? Promise> : Promise<(AxiosResponse & { + error: undefined; +}) | (AxiosError & { + data: undefined; + error: TError; +})>; +interface ClientOptions { + baseURL?: string; + throwOnError?: boolean; +} +type MethodFn = (options: Omit, 'method'>) => RequestResult; +type RequestFn = (options: Omit, 'method'> & Pick>, 'method'>) => RequestResult; +type BuildUrlFn = ; + query?: Record; + url: string; +}>(options: Pick & Omit, 'axios'>) => string; +type Client = Client$1 & { + instance: AxiosInstance; +}; +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +type CreateClientConfig = (override?: Config) => Config & T>; +interface TDataShape { + body?: unknown; + headers?: unknown; + path?: unknown; + query?: unknown; + url: string; +} +type OmitKeys = Pick>; +type Options = OmitKeys, 'body' | 'path' | 'query' | 'url'> & Omit; +type OptionsLegacyParser = TData extends { + body?: any; +} ? TData extends { + headers?: any; +} ? OmitKeys, 'body' | 'headers' | 'url'> & TData : OmitKeys, 'body' | 'url'> & TData & Pick, 'headers'> : TData extends { + headers?: any; +} ? OmitKeys, 'headers' | 'url'> & TData & Pick, 'body'> : OmitKeys, 'url'> & TData; + +declare const createClient: (config?: Config) => Client; + +declare const createConfig: (override?: Config & T>) => Config & T>; + +export { type Auth, type Client, type ClientOptions, type Config, type CreateClientConfig, type Options, type OptionsLegacyParser, type QuerySerializerOptions, type RequestOptions, type RequestResult, type TDataShape, createClient, createConfig, formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer }; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/sdk.gen.ts new file mode 100644 index 000000000..063d2d76e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/sdk.gen.ts @@ -0,0 +1,410 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from './client'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + responseType: 'blob', + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/types.gen.ts new file mode 100644 index 000000000..9cb3fcf99 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/client.gen.ts new file mode 100644 index 000000000..1d97df8bc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/sdk.gen.ts new file mode 100644 index 000000000..9e76f2fd8 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/sdk.gen.ts @@ -0,0 +1,410 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + responseType: 'blob', + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/types.gen.ts new file mode 100644 index 000000000..9cb3fcf99 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/client.gen.ts new file mode 100644 index 000000000..1d97df8bc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/sdk.gen.ts new file mode 100644 index 000000000..9e76f2fd8 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/sdk.gen.ts @@ -0,0 +1,410 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + responseType: 'blob', + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/types.gen.ts new file mode 100644 index 000000000..9cb3fcf99 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/client.gen.ts new file mode 100644 index 000000000..1d97df8bc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/sdk.gen.ts new file mode 100644 index 000000000..75b5630e6 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options: Options) => { + return options.client.patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options: Options) => { + return options.client.delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options: Options) => { + return options.client.head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options: Options) => { + return options.client.options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options: Options) => { + return options.client.patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return options.client.delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options: Options) => { + return options.client.post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options: Options) => { + return options.client.delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return options.client.post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return options.client.get({ + responseType: 'blob', + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options: Options) => { + return options.client.post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return options.client.put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/types.gen.ts new file mode 100644 index 000000000..9cb3fcf99 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/types.gen.ts new file mode 100644 index 000000000..c3e87ddf4 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base'; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/client.gen.ts new file mode 100644 index 000000000..a324bafac --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'https://foo.com' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client.gen.ts new file mode 100644 index 000000000..14f2d878c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.cjs b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.cjs new file mode 100644 index 000000000..2886023aa --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.cjs @@ -0,0 +1,2 @@ +'use strict';var A=async(t,r)=>{let e=typeof r=="function"?await r(t):r;if(e)return t.scheme==="bearer"?`Bearer ${e}`:t.scheme==="basic"?`Basic ${btoa(e)}`:e},z=(t,r,e)=>{typeof e=="string"||e instanceof Blob?t.append(r,e):t.append(r,JSON.stringify(e));},j=(t,r,e)=>{typeof e=="string"?t.append(r,e):t.append(r,JSON.stringify(e));},v={bodySerializer:t=>{let r=new FormData;return Object.entries(t).forEach(([e,a])=>{a!=null&&(Array.isArray(a)?a.forEach(i=>z(r,e,i)):z(r,e,a));}),r}},R={bodySerializer:t=>JSON.stringify(t,(r,e)=>typeof e=="bigint"?e.toString():e)},$={bodySerializer:t=>{let r=new URLSearchParams;return Object.entries(t).forEach(([e,a])=>{a!=null&&(Array.isArray(a)?a.forEach(i=>j(r,e,i)):j(r,e,a));}),r.toString()}},U=t=>{switch(t){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},_=t=>{switch(t){case "form":return ",";case "pipeDelimited":return "|";case "spaceDelimited":return "%20";default:return ","}},D=t=>{switch(t){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},O=({allowReserved:t,explode:r,name:e,style:a,value:i})=>{if(!r){let s=(t?i:i.map(l=>encodeURIComponent(l))).join(_(a));switch(a){case "label":return `.${s}`;case "matrix":return `;${e}=${s}`;case "simple":return s;default:return `${e}=${s}`}}let o=U(a),n=i.map(s=>a==="label"||a==="simple"?t?s:encodeURIComponent(s):y({allowReserved:t,name:e,value:s})).join(o);return a==="label"||a==="matrix"?o+n:n},y=({allowReserved:t,name:r,value:e})=>{if(e==null)return "";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return `${r}=${t?e:encodeURIComponent(e)}`},q=({allowReserved:t,explode:r,name:e,style:a,value:i})=>{if(i instanceof Date)return `${e}=${i.toISOString()}`;if(a!=="deepObject"&&!r){let s=[];Object.entries(i).forEach(([f,u])=>{s=[...s,f,t?u:encodeURIComponent(u)];});let l=s.join(",");switch(a){case "form":return `${e}=${l}`;case "label":return `.${l}`;case "matrix":return `;${e}=${l}`;default:return l}}let o=D(a),n=Object.entries(i).map(([s,l])=>y({allowReserved:t,name:a==="deepObject"?`${e}[${s}]`:s,value:l})).join(o);return a==="label"||a==="matrix"?o+n:n};var H=/\{[^{}]+\}/g,B=({path:t,url:r})=>{let e=r,a=r.match(H);if(a)for(let i of a){let o=false,n=i.substring(1,i.length-1),s="simple";n.endsWith("*")&&(o=true,n=n.substring(0,n.length-1)),n.startsWith(".")?(n=n.substring(1),s="label"):n.startsWith(";")&&(n=n.substring(1),s="matrix");let l=t[n];if(l==null)continue;if(Array.isArray(l)){e=e.replace(i,O({explode:o,name:n,style:s,value:l}));continue}if(typeof l=="object"){e=e.replace(i,q({explode:o,name:n,style:s,value:l}));continue}if(s==="matrix"){e=e.replace(i,`;${y({name:n,value:l})}`);continue}let f=encodeURIComponent(s==="label"?`.${l}`:l);e=e.replace(i,f);}return e},E=({allowReserved:t,array:r,object:e}={})=>i=>{let o=[];if(i&&typeof i=="object")for(let n in i){let s=i[n];if(s!=null){if(Array.isArray(s)){o=[...o,O({allowReserved:t,explode:true,name:n,style:"form",value:s,...r})];continue}if(typeof s=="object"){o=[...o,q({allowReserved:t,explode:true,name:n,style:"deepObject",value:s,...e})];continue}o=[...o,y({allowReserved:t,name:n,value:s})];}}return o.join("&")},P=t=>{if(!t)return "stream";let r=t.split(";")[0]?.trim();if(r){if(r.startsWith("application/json")||r.endsWith("+json"))return "json";if(r==="multipart/form-data")return "formData";if(["application/","audio/","image/","video/"].some(e=>r.startsWith(e)))return "blob";if(r.startsWith("text/"))return "text"}},I=async({security:t,...r})=>{for(let e of t){let a=await A(e,r.auth);if(!a)continue;let i=e.name??"Authorization";switch(e.in){case "query":r.query||(r.query={}),r.query[i]=a;break;case "cookie":r.headers.append("Cookie",`${i}=${a}`);break;case "header":default:r.headers.set(i,a);break}return}},S=t=>W({baseUrl:t.baseUrl,path:t.path,query:t.query,querySerializer:typeof t.querySerializer=="function"?t.querySerializer:E(t.querySerializer),url:t.url}),W=({baseUrl:t,path:r,query:e,querySerializer:a,url:i})=>{let o=i.startsWith("/")?i:`/${i}`,n=(t??"")+o;r&&(n=B({path:r,url:n}));let s=e?a(e):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(n+=`?${s}`),n},C=(t,r)=>{let e={...t,...r};return e.baseUrl?.endsWith("/")&&(e.baseUrl=e.baseUrl.substring(0,e.baseUrl.length-1)),e.headers=x(t.headers,r.headers),e},x=(...t)=>{let r=new Headers;for(let e of t){if(!e||typeof e!="object")continue;let a=e instanceof Headers?e.entries():Object.entries(e);for(let[i,o]of a)if(o===null)r.delete(i);else if(Array.isArray(o))for(let n of o)r.append(i,n);else o!==void 0&&r.set(i,typeof o=="object"?JSON.stringify(o):o);}return r},h=class{_fns;constructor(){this._fns=[];}clear(){this._fns=[];}exists(r){return this._fns.indexOf(r)!==-1}eject(r){let e=this._fns.indexOf(r);e!==-1&&(this._fns=[...this._fns.slice(0,e),...this._fns.slice(e+1)]);}use(r){this._fns=[...this._fns,r];}},T=()=>({error:new h,request:new h,response:new h}),N=E({allowReserved:false,array:{explode:true,style:"form"},object:{explode:true,style:"deepObject"}}),Q={"Content-Type":"application/json"},w=(t={})=>({...R,headers:Q,parseAs:"auto",querySerializer:N,...t});var J=(t={})=>{let r=C(w(),t),e=()=>({...r}),a=n=>(r=C(r,n),e()),i=T(),o=async n=>{let s={...r,...n,fetch:n.fetch??r.fetch??globalThis.fetch,headers:x(r.headers,n.headers)};s.security&&await I({...s,security:s.security}),s.body&&s.bodySerializer&&(s.body=s.bodySerializer(s.body)),(s.body===void 0||s.body==="")&&s.headers.delete("Content-Type");let l=S(s),f={redirect:"follow",...s},u=new Request(l,f);for(let p of i.request._fns)u=await p(u,s);let k=s.fetch,c=await k(u);for(let p of i.response._fns)c=await p(c,u,s);let m={request:u,response:c};if(c.ok){if(c.status===204||c.headers.get("Content-Length")==="0")return {data:{},...m};let p=(s.parseAs==="auto"?P(c.headers.get("Content-Type")):s.parseAs)??"json";if(p==="stream")return {data:c.body,...m};let b=await c[p]();return p==="json"&&(s.responseValidator&&await s.responseValidator(b),s.responseTransformer&&(b=await s.responseTransformer(b))),{data:b,...m}}let g=await c.text();try{g=JSON.parse(g);}catch{}let d=g;for(let p of i.error._fns)d=await p(g,c,u,s);if(d=d||{},s.throwOnError)throw d;return {error:d,...m}};return {buildUrl:S,connect:n=>o({...n,method:"CONNECT"}),delete:n=>o({...n,method:"DELETE"}),get:n=>o({...n,method:"GET"}),getConfig:e,head:n=>o({...n,method:"HEAD"}),interceptors:i,options:n=>o({...n,method:"OPTIONS"}),patch:n=>o({...n,method:"PATCH"}),post:n=>o({...n,method:"POST"}),put:n=>o({...n,method:"PUT"}),request:o,setConfig:a,trace:n=>o({...n,method:"TRACE"})}};exports.createClient=J;exports.createConfig=w;exports.formDataBodySerializer=v;exports.jsonBodySerializer=R;exports.urlSearchParamsBodySerializer=$;//# sourceMappingURL=index.cjs.map +//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.d.cts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.d.cts new file mode 100644 index 000000000..bd13d49a2 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.d.cts @@ -0,0 +1,238 @@ +type AuthToken = string | undefined; +interface Auth { + /** + * Which part of the request do we use to send the auth? + * + * @default 'header' + */ + in?: 'header' | 'query' | 'cookie'; + /** + * Header or query parameter name. + * + * @default 'Authorization' + */ + name?: string; + scheme?: 'basic' | 'bearer'; + type: 'apiKey' | 'http'; +} +interface SerializerOptions { + /** + * @default true + */ + explode: boolean; + style: T; +} +type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; +type ObjectStyle = 'form' | 'deepObject'; + +type QuerySerializer = (query: Record) => string; +type BodySerializer = (body: any) => any; +interface QuerySerializerOptions { + allowReserved?: boolean; + array?: SerializerOptions; + object?: SerializerOptions; +} +declare const formDataBodySerializer: { + bodySerializer: | Array>>(body: T) => FormData; +}; +declare const jsonBodySerializer: { + bodySerializer: (body: T) => string; +}; +declare const urlSearchParamsBodySerializer: { + bodySerializer: | Array>>(body: T) => string; +}; + +interface Client$1 { + /** + * Returns the final request URL. + */ + buildUrl: BuildUrlFn; + connect: MethodFn; + delete: MethodFn; + get: MethodFn; + getConfig: () => Config; + head: MethodFn; + options: MethodFn; + patch: MethodFn; + post: MethodFn; + put: MethodFn; + request: RequestFn; + setConfig: (config: Config) => Config; + trace: MethodFn; +} +interface Config$1 { + /** + * Auth token or a function returning auth token. The resolved value will be + * added to the request payload as defined by its `security` array. + */ + auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; + /** + * A function for serializing request body parameter. By default, + * {@link JSON.stringify()} will be used. + */ + bodySerializer?: BodySerializer | null; + /** + * An object containing any HTTP headers that you want to pre-populate your + * `Headers` object with. + * + * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} + */ + headers?: RequestInit['headers'] | Record; + /** + * The request method. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} + */ + method?: 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE'; + /** + * A function for serializing request query parameters. By default, arrays + * will be exploded in form style, objects will be exploded in deepObject + * style, and reserved characters are percent-encoded. + * + * This method will have no effect if the native `paramsSerializer()` Axios + * API function is used. + * + * {@link https://swagger.io/docs/specification/serialization/#query View examples} + */ + querySerializer?: QuerySerializer | QuerySerializerOptions; + /** + * A function transforming response data before it's returned. This is useful + * for post-processing data, e.g. converting ISO strings into Date objects. + */ + responseTransformer?: (data: unknown) => Promise; + /** + * A function validating response data. This is useful if you want to ensure + * the response conforms to the desired shape, so it can be safely passed to + * the transformers and returned to the user. + */ + responseValidator?: (data: unknown) => Promise; +} + +type ErrInterceptor = (error: Err, response: Res, request: Req, options: Options) => Err | Promise; +type ReqInterceptor = (request: Req, options: Options) => Req | Promise; +type ResInterceptor = (response: Res, request: Req, options: Options) => Res | Promise; +declare class Interceptors { + _fns: Interceptor[]; + constructor(); + clear(): void; + exists(fn: Interceptor): boolean; + eject(fn: Interceptor): void; + use(fn: Interceptor): void; +} +interface Middleware { + error: Pick>, 'eject' | 'use'>; + request: Pick>, 'eject' | 'use'>; + response: Pick>, 'eject' | 'use'>; +} +declare const createConfig: (override?: Config & T>) => Config & T>; + +interface Config extends Omit, Config$1 { + /** + * Base URL for all requests made by this client. + */ + baseUrl?: T['baseUrl']; + /** + * Fetch API implementation. You can use this option to provide a custom + * fetch instance. + * + * @default globalThis.fetch + */ + fetch?: (request: Request) => ReturnType; + /** + * Please don't use the Fetch client for Next.js applications. The `next` + * options won't have any effect. + * + * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead. + */ + next?: never; + /** + * Return the response data parsed in a specified format. By default, `auto` + * will infer the appropriate method from the `Content-Type` response header. + * You can override this behavior with any of the {@link Body} methods. + * Select `stream` if you don't want to parse response data at all. + * + * @default 'auto' + */ + parseAs?: Exclude | 'auto' | 'stream'; + /** + * Throw an error instead of returning it in the response? + * + * @default false + */ + throwOnError?: T['throwOnError']; +} +interface RequestOptions extends Config<{ + throwOnError: ThrowOnError; +}> { + /** + * Any body that you want to add to your request. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} + */ + body?: unknown; + path?: Record; + query?: Record; + /** + * Security mechanism(s) to use for the request. + */ + security?: ReadonlyArray; + url: Url; +} +type RequestResult = ThrowOnError extends true ? Promise<{ + data: TData; + request: Request; + response: Response; +}> : Promise<({ + data: TData; + error: undefined; +} | { + data: undefined; + error: TError; +}) & { + request: Request; + response: Response; +}>; +interface ClientOptions { + baseUrl?: string; + throwOnError?: boolean; +} +type MethodFn = (options: Omit, 'method'>) => RequestResult; +type RequestFn = (options: Omit, 'method'> & Pick>, 'method'>) => RequestResult; +type BuildUrlFn = ; + query?: Record; + url: string; +}>(options: Pick & Options) => string; +type Client = Client$1 & { + interceptors: Middleware; +}; +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +type CreateClientConfig = (override?: Config) => Config & T>; +interface TDataShape { + body?: unknown; + headers?: unknown; + path?: unknown; + query?: unknown; + url: string; +} +type OmitKeys = Pick>; +type Options = OmitKeys, 'body' | 'path' | 'query' | 'url'> & Omit; +type OptionsLegacyParser = TData extends { + body?: any; +} ? TData extends { + headers?: any; +} ? OmitKeys, 'body' | 'headers' | 'url'> & TData : OmitKeys, 'body' | 'url'> & TData & Pick, 'headers'> : TData extends { + headers?: any; +} ? OmitKeys, 'headers' | 'url'> & TData & Pick, 'body'> : OmitKeys, 'url'> & TData; + +declare const createClient: (config?: Config) => Client; + +export { type Auth, type Client, type ClientOptions, type Config, type CreateClientConfig, type Options, type OptionsLegacyParser, type QuerySerializerOptions, type RequestOptions, type RequestResult, type TDataShape, createClient, createConfig, formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer }; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.d.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.d.ts new file mode 100644 index 000000000..bd13d49a2 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.d.ts @@ -0,0 +1,238 @@ +type AuthToken = string | undefined; +interface Auth { + /** + * Which part of the request do we use to send the auth? + * + * @default 'header' + */ + in?: 'header' | 'query' | 'cookie'; + /** + * Header or query parameter name. + * + * @default 'Authorization' + */ + name?: string; + scheme?: 'basic' | 'bearer'; + type: 'apiKey' | 'http'; +} +interface SerializerOptions { + /** + * @default true + */ + explode: boolean; + style: T; +} +type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; +type ObjectStyle = 'form' | 'deepObject'; + +type QuerySerializer = (query: Record) => string; +type BodySerializer = (body: any) => any; +interface QuerySerializerOptions { + allowReserved?: boolean; + array?: SerializerOptions; + object?: SerializerOptions; +} +declare const formDataBodySerializer: { + bodySerializer: | Array>>(body: T) => FormData; +}; +declare const jsonBodySerializer: { + bodySerializer: (body: T) => string; +}; +declare const urlSearchParamsBodySerializer: { + bodySerializer: | Array>>(body: T) => string; +}; + +interface Client$1 { + /** + * Returns the final request URL. + */ + buildUrl: BuildUrlFn; + connect: MethodFn; + delete: MethodFn; + get: MethodFn; + getConfig: () => Config; + head: MethodFn; + options: MethodFn; + patch: MethodFn; + post: MethodFn; + put: MethodFn; + request: RequestFn; + setConfig: (config: Config) => Config; + trace: MethodFn; +} +interface Config$1 { + /** + * Auth token or a function returning auth token. The resolved value will be + * added to the request payload as defined by its `security` array. + */ + auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; + /** + * A function for serializing request body parameter. By default, + * {@link JSON.stringify()} will be used. + */ + bodySerializer?: BodySerializer | null; + /** + * An object containing any HTTP headers that you want to pre-populate your + * `Headers` object with. + * + * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} + */ + headers?: RequestInit['headers'] | Record; + /** + * The request method. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} + */ + method?: 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE'; + /** + * A function for serializing request query parameters. By default, arrays + * will be exploded in form style, objects will be exploded in deepObject + * style, and reserved characters are percent-encoded. + * + * This method will have no effect if the native `paramsSerializer()` Axios + * API function is used. + * + * {@link https://swagger.io/docs/specification/serialization/#query View examples} + */ + querySerializer?: QuerySerializer | QuerySerializerOptions; + /** + * A function transforming response data before it's returned. This is useful + * for post-processing data, e.g. converting ISO strings into Date objects. + */ + responseTransformer?: (data: unknown) => Promise; + /** + * A function validating response data. This is useful if you want to ensure + * the response conforms to the desired shape, so it can be safely passed to + * the transformers and returned to the user. + */ + responseValidator?: (data: unknown) => Promise; +} + +type ErrInterceptor = (error: Err, response: Res, request: Req, options: Options) => Err | Promise; +type ReqInterceptor = (request: Req, options: Options) => Req | Promise; +type ResInterceptor = (response: Res, request: Req, options: Options) => Res | Promise; +declare class Interceptors { + _fns: Interceptor[]; + constructor(); + clear(): void; + exists(fn: Interceptor): boolean; + eject(fn: Interceptor): void; + use(fn: Interceptor): void; +} +interface Middleware { + error: Pick>, 'eject' | 'use'>; + request: Pick>, 'eject' | 'use'>; + response: Pick>, 'eject' | 'use'>; +} +declare const createConfig: (override?: Config & T>) => Config & T>; + +interface Config extends Omit, Config$1 { + /** + * Base URL for all requests made by this client. + */ + baseUrl?: T['baseUrl']; + /** + * Fetch API implementation. You can use this option to provide a custom + * fetch instance. + * + * @default globalThis.fetch + */ + fetch?: (request: Request) => ReturnType; + /** + * Please don't use the Fetch client for Next.js applications. The `next` + * options won't have any effect. + * + * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead. + */ + next?: never; + /** + * Return the response data parsed in a specified format. By default, `auto` + * will infer the appropriate method from the `Content-Type` response header. + * You can override this behavior with any of the {@link Body} methods. + * Select `stream` if you don't want to parse response data at all. + * + * @default 'auto' + */ + parseAs?: Exclude | 'auto' | 'stream'; + /** + * Throw an error instead of returning it in the response? + * + * @default false + */ + throwOnError?: T['throwOnError']; +} +interface RequestOptions extends Config<{ + throwOnError: ThrowOnError; +}> { + /** + * Any body that you want to add to your request. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} + */ + body?: unknown; + path?: Record; + query?: Record; + /** + * Security mechanism(s) to use for the request. + */ + security?: ReadonlyArray; + url: Url; +} +type RequestResult = ThrowOnError extends true ? Promise<{ + data: TData; + request: Request; + response: Response; +}> : Promise<({ + data: TData; + error: undefined; +} | { + data: undefined; + error: TError; +}) & { + request: Request; + response: Response; +}>; +interface ClientOptions { + baseUrl?: string; + throwOnError?: boolean; +} +type MethodFn = (options: Omit, 'method'>) => RequestResult; +type RequestFn = (options: Omit, 'method'> & Pick>, 'method'>) => RequestResult; +type BuildUrlFn = ; + query?: Record; + url: string; +}>(options: Pick & Options) => string; +type Client = Client$1 & { + interceptors: Middleware; +}; +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +type CreateClientConfig = (override?: Config) => Config & T>; +interface TDataShape { + body?: unknown; + headers?: unknown; + path?: unknown; + query?: unknown; + url: string; +} +type OmitKeys = Pick>; +type Options = OmitKeys, 'body' | 'path' | 'query' | 'url'> & Omit; +type OptionsLegacyParser = TData extends { + body?: any; +} ? TData extends { + headers?: any; +} ? OmitKeys, 'body' | 'headers' | 'url'> & TData : OmitKeys, 'body' | 'url'> & TData & Pick, 'headers'> : TData extends { + headers?: any; +} ? OmitKeys, 'headers' | 'url'> & TData & Pick, 'body'> : OmitKeys, 'url'> & TData; + +declare const createClient: (config?: Config) => Client; + +export { type Auth, type Client, type ClientOptions, type Config, type CreateClientConfig, type Options, type OptionsLegacyParser, type QuerySerializerOptions, type RequestOptions, type RequestResult, type TDataShape, createClient, createConfig, formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer }; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/sdk.gen.ts new file mode 100644 index 000000000..5cc6beedc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from './client'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/sdk.gen.ts new file mode 100644 index 000000000..7f932711f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/sdk.gen.ts new file mode 100644 index 000000000..7f932711f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/sdk.gen.ts new file mode 100644 index 000000000..2799b3acc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/sdk.gen.ts @@ -0,0 +1,408 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options: Options) => { + return options.client.patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options: Options) => { + return options.client.delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options: Options) => { + return options.client.head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options: Options) => { + return options.client.options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options: Options) => { + return options.client.patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return options.client.delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options: Options) => { + return options.client.post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options: Options) => { + return options.client.delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return options.client.post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options: Options) => { + return options.client.post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return options.client.put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/client.gen.ts new file mode 100644 index 000000000..4668e8723 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-next'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/client.gen.ts new file mode 100644 index 000000000..f61bb2a26 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-next'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/client.gen.ts new file mode 100644 index 000000000..f61bb2a26 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-next'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/types.gen.ts new file mode 100644 index 000000000..c3e87ddf4 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base'; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/client.gen.ts new file mode 100644 index 000000000..df050ec2d --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-next'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'https://foo.com' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client.gen.ts new file mode 100644 index 000000000..14f2d878c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.cjs b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.cjs new file mode 100644 index 000000000..7deeaf11a --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.cjs @@ -0,0 +1,2 @@ +'use strict';var A=async(s,r)=>{let e=typeof r=="function"?await r(s):r;if(e)return s.scheme==="bearer"?`Bearer ${e}`:s.scheme==="basic"?`Basic ${btoa(e)}`:e},z=(s,r,e)=>{typeof e=="string"||e instanceof Blob?s.append(r,e):s.append(r,JSON.stringify(e));},j=(s,r,e)=>{typeof e=="string"?s.append(r,e):s.append(r,JSON.stringify(e));},v={bodySerializer:s=>{let r=new FormData;return Object.entries(s).forEach(([e,a])=>{a!=null&&(Array.isArray(a)?a.forEach(i=>z(r,e,i)):z(r,e,a));}),r}},b={bodySerializer:s=>JSON.stringify(s,(r,e)=>typeof e=="bigint"?e.toString():e)},T={bodySerializer:s=>{let r=new URLSearchParams;return Object.entries(s).forEach(([e,a])=>{a!=null&&(Array.isArray(a)?a.forEach(i=>j(r,e,i)):j(r,e,a));}),r.toString()}},k=s=>{switch(s){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},$=s=>{switch(s){case "form":return ",";case "pipeDelimited":return "|";case "spaceDelimited":return "%20";default:return ","}},U=s=>{switch(s){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},O=({allowReserved:s,explode:r,name:e,style:a,value:i})=>{if(!r){let t=(s?i:i.map(l=>encodeURIComponent(l))).join($(a));switch(a){case "label":return `.${t}`;case "matrix":return `;${e}=${t}`;case "simple":return t;default:return `${e}=${t}`}}let o=k(a),n=i.map(t=>a==="label"||a==="simple"?s?t:encodeURIComponent(t):d({allowReserved:s,name:e,value:t})).join(o);return a==="label"||a==="matrix"?o+n:n},d=({allowReserved:s,name:r,value:e})=>{if(e==null)return "";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return `${r}=${s?e:encodeURIComponent(e)}`},S=({allowReserved:s,explode:r,name:e,style:a,value:i})=>{if(i instanceof Date)return `${e}=${i.toISOString()}`;if(a!=="deepObject"&&!r){let t=[];Object.entries(i).forEach(([p,c])=>{t=[...t,p,s?c:encodeURIComponent(c)];});let l=t.join(",");switch(a){case "form":return `${e}=${l}`;case "label":return `.${l}`;case "matrix":return `;${e}=${l}`;default:return l}}let o=U(a),n=Object.entries(i).map(([t,l])=>d({allowReserved:s,name:a==="deepObject"?`${e}[${t}]`:t,value:l})).join(o);return a==="label"||a==="matrix"?o+n:n};var _=/\{[^{}]+\}/g,D=({path:s,url:r})=>{let e=r,a=r.match(_);if(a)for(let i of a){let o=false,n=i.substring(1,i.length-1),t="simple";n.endsWith("*")&&(o=true,n=n.substring(0,n.length-1)),n.startsWith(".")?(n=n.substring(1),t="label"):n.startsWith(";")&&(n=n.substring(1),t="matrix");let l=s[n];if(l==null)continue;if(Array.isArray(l)){e=e.replace(i,O({explode:o,name:n,style:t,value:l}));continue}if(typeof l=="object"){e=e.replace(i,S({explode:o,name:n,style:t,value:l}));continue}if(t==="matrix"){e=e.replace(i,`;${d({name:n,value:l})}`);continue}let p=encodeURIComponent(t==="label"?`.${l}`:l);e=e.replace(i,p);}return e},q=({allowReserved:s,array:r,object:e}={})=>i=>{let o=[];if(i&&typeof i=="object")for(let n in i){let t=i[n];if(t!=null){if(Array.isArray(t)){o=[...o,O({allowReserved:s,explode:true,name:n,style:"form",value:t,...r})];continue}if(typeof t=="object"){o=[...o,S({allowReserved:s,explode:true,name:n,style:"deepObject",value:t,...e})];continue}o=[...o,d({allowReserved:s,name:n,value:t})];}}return o.join("&")},E=s=>{if(!s)return "stream";let r=s.split(";")[0]?.trim();if(r){if(r.startsWith("application/json")||r.endsWith("+json"))return "json";if(r==="multipart/form-data")return "formData";if(["application/","audio/","image/","video/"].some(e=>r.startsWith(e)))return "blob";if(r.startsWith("text/"))return "text"}},P=async({security:s,...r})=>{for(let e of s){let a=await A(e,r.auth);if(!a)continue;let i=e.name??"Authorization";switch(e.in){case "query":r.query||(r.query={}),r.query[i]=a;break;case "cookie":r.headers.append("Cookie",`${i}=${a}`);break;case "header":default:r.headers.set(i,a);break}return}},C=s=>H({baseUrl:s.baseUrl,path:s.path,query:s.query,querySerializer:typeof s.querySerializer=="function"?s.querySerializer:q(s.querySerializer),url:s.url}),H=({baseUrl:s,path:r,query:e,querySerializer:a,url:i})=>{let o=i.startsWith("/")?i:`/${i}`,n=(s??"")+o;r&&(n=D({path:r,url:n}));let t=e?a(e):"";return t.startsWith("?")&&(t=t.substring(1)),t&&(n+=`?${t}`),n},R=(s,r)=>{let e={...s,...r};return e.baseUrl?.endsWith("/")&&(e.baseUrl=e.baseUrl.substring(0,e.baseUrl.length-1)),e.headers=x(s.headers,r.headers),e},x=(...s)=>{let r=new Headers;for(let e of s){if(!e||typeof e!="object")continue;let a=e instanceof Headers?e.entries():Object.entries(e);for(let[i,o]of a)if(o===null)r.delete(i);else if(Array.isArray(o))for(let n of o)r.append(i,n);else o!==void 0&&r.set(i,typeof o=="object"?JSON.stringify(o):o);}return r},y=class{_fns;constructor(){this._fns=[];}clear(){this._fns=[];}exists(r){return this._fns.indexOf(r)!==-1}eject(r){let e=this._fns.indexOf(r);e!==-1&&(this._fns=[...this._fns.slice(0,e),...this._fns.slice(e+1)]);}use(r){this._fns=[...this._fns,r];}},I=()=>({error:new y,request:new y,response:new y}),B=q({allowReserved:false,array:{explode:true,style:"form"},object:{explode:true,style:"deepObject"}}),W={"Content-Type":"application/json"},w=(s={})=>({...b,headers:W,parseAs:"auto",querySerializer:B,...s});var N=(s={})=>{let r=R(w(),s),e=()=>({...r}),a=n=>(r=R(r,n),e()),i=I(),o=async n=>{let t={...r,...n,fetch:n.fetch??r.fetch??globalThis.fetch,headers:x(r.headers,n.headers)};t.security&&await P({...t,security:t.security}),t.body&&t.bodySerializer&&(t.body=t.bodySerializer(t.body)),(t.body===void 0||t.body==="")&&t.headers.delete("Content-Type");for(let u of i.request._fns)await u(t);let l=C(t),p=t.fetch,c=await p(l,{...t,body:t.body});for(let u of i.response._fns)c=await u(c,t);let h={response:c};if(c.ok){if(c.status===204||c.headers.get("Content-Length")==="0")return {data:{},...h};let u=(t.parseAs==="auto"?E(c.headers.get("Content-Type")):t.parseAs)??"json";if(u==="stream")return {data:c.body,...h};let g=await c[u]();return u==="json"&&(t.responseValidator&&await t.responseValidator(g),t.responseTransformer&&(g=await t.responseTransformer(g))),{data:g,...h}}let m=await c.text();try{m=JSON.parse(m);}catch{}let f=m;for(let u of i.error._fns)f=await u(m,c,t);if(f=f||{},t.throwOnError)throw f;return {error:f,...h}};return {buildUrl:C,connect:n=>o({...n,method:"CONNECT"}),delete:n=>o({...n,method:"DELETE"}),get:n=>o({...n,method:"GET"}),getConfig:e,head:n=>o({...n,method:"HEAD"}),interceptors:i,options:n=>o({...n,method:"OPTIONS"}),patch:n=>o({...n,method:"PATCH"}),post:n=>o({...n,method:"POST"}),put:n=>o({...n,method:"PUT"}),request:o,setConfig:a,trace:n=>o({...n,method:"TRACE"})}};exports.createClient=N;exports.createConfig=w;exports.formDataBodySerializer=v;exports.jsonBodySerializer=b;exports.urlSearchParamsBodySerializer=T;//# sourceMappingURL=index.cjs.map +//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.d.cts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.d.cts new file mode 100644 index 000000000..eb31a3687 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.d.cts @@ -0,0 +1,229 @@ +type AuthToken = string | undefined; +interface Auth { + /** + * Which part of the request do we use to send the auth? + * + * @default 'header' + */ + in?: 'header' | 'query' | 'cookie'; + /** + * Header or query parameter name. + * + * @default 'Authorization' + */ + name?: string; + scheme?: 'basic' | 'bearer'; + type: 'apiKey' | 'http'; +} +interface SerializerOptions { + /** + * @default true + */ + explode: boolean; + style: T; +} +type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; +type ObjectStyle = 'form' | 'deepObject'; + +type QuerySerializer = (query: Record) => string; +type BodySerializer = (body: any) => any; +interface QuerySerializerOptions { + allowReserved?: boolean; + array?: SerializerOptions; + object?: SerializerOptions; +} +declare const formDataBodySerializer: { + bodySerializer: | Array>>(body: T) => FormData; +}; +declare const jsonBodySerializer: { + bodySerializer: (body: T) => string; +}; +declare const urlSearchParamsBodySerializer: { + bodySerializer: | Array>>(body: T) => string; +}; + +interface Client$1 { + /** + * Returns the final request URL. + */ + buildUrl: BuildUrlFn; + connect: MethodFn; + delete: MethodFn; + get: MethodFn; + getConfig: () => Config; + head: MethodFn; + options: MethodFn; + patch: MethodFn; + post: MethodFn; + put: MethodFn; + request: RequestFn; + setConfig: (config: Config) => Config; + trace: MethodFn; +} +interface Config$1 { + /** + * Auth token or a function returning auth token. The resolved value will be + * added to the request payload as defined by its `security` array. + */ + auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; + /** + * A function for serializing request body parameter. By default, + * {@link JSON.stringify()} will be used. + */ + bodySerializer?: BodySerializer | null; + /** + * An object containing any HTTP headers that you want to pre-populate your + * `Headers` object with. + * + * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} + */ + headers?: RequestInit['headers'] | Record; + /** + * The request method. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} + */ + method?: 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE'; + /** + * A function for serializing request query parameters. By default, arrays + * will be exploded in form style, objects will be exploded in deepObject + * style, and reserved characters are percent-encoded. + * + * This method will have no effect if the native `paramsSerializer()` Axios + * API function is used. + * + * {@link https://swagger.io/docs/specification/serialization/#query View examples} + */ + querySerializer?: QuerySerializer | QuerySerializerOptions; + /** + * A function transforming response data before it's returned. This is useful + * for post-processing data, e.g. converting ISO strings into Date objects. + */ + responseTransformer?: (data: unknown) => Promise; + /** + * A function validating response data. This is useful if you want to ensure + * the response conforms to the desired shape, so it can be safely passed to + * the transformers and returned to the user. + */ + responseValidator?: (data: unknown) => Promise; +} + +type ErrInterceptor = (error: Err, response: Res, options: Options) => Err | Promise; +type ReqInterceptor = (options: Options) => void | Promise; +type ResInterceptor = (response: Res, options: Options) => Res | Promise; +declare class Interceptors { + _fns: Interceptor[]; + constructor(); + clear(): void; + exists(fn: Interceptor): boolean; + eject(fn: Interceptor): void; + use(fn: Interceptor): void; +} +interface Middleware { + error: Pick>, 'eject' | 'use'>; + request: Pick>, 'eject' | 'use'>; + response: Pick>, 'eject' | 'use'>; +} +declare const createConfig: (override?: Config & T>) => Config & T>; + +interface Config extends Omit, Config$1 { + /** + * Base URL for all requests made by this client. + */ + baseUrl?: T['baseUrl']; + /** + * Fetch API implementation. You can use this option to provide a custom + * fetch instance. + * + * @default globalThis.fetch + */ + fetch?: typeof fetch; + /** + * Return the response data parsed in a specified format. By default, `auto` + * will infer the appropriate method from the `Content-Type` response header. + * You can override this behavior with any of the {@link Body} methods. + * Select `stream` if you don't want to parse response data at all. + * + * @default 'auto' + */ + parseAs?: Exclude | 'auto' | 'stream'; + /** + * Throw an error instead of returning it in the response? + * + * @default false + */ + throwOnError?: T['throwOnError']; +} +interface RequestOptions extends Config<{ + throwOnError: ThrowOnError; +}> { + /** + * Any body that you want to add to your request. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} + */ + body?: unknown; + path?: Record; + query?: Record; + /** + * Security mechanism(s) to use for the request. + */ + security?: ReadonlyArray; + url: Url; +} +type RequestResult = ThrowOnError extends true ? Promise<{ + data: TData; + response: Response; +}> : Promise<({ + data: TData; + error: undefined; +} | { + data: undefined; + error: TError; +}) & { + response: Response; +}>; +interface ClientOptions { + baseUrl?: string; + throwOnError?: boolean; +} +type MethodFn = (options: Omit, 'method'>) => RequestResult; +type RequestFn = (options: Omit, 'method'> & Pick>, 'method'>) => RequestResult; +type BuildUrlFn = ; + query?: Record; + url: string; +}>(options: Pick & Options) => string; +type Client = Client$1 & { + interceptors: Middleware; +}; +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +type CreateClientConfig = (override?: Config) => Config & T>; +interface TDataShape { + body?: unknown; + headers?: unknown; + path?: unknown; + query?: unknown; + url: string; +} +type OmitKeys = Pick>; +type Options = OmitKeys, 'body' | 'path' | 'query' | 'url'> & Omit; +type OptionsLegacyParser = TData extends { + body?: any; +} ? TData extends { + headers?: any; +} ? OmitKeys, 'body' | 'headers' | 'url'> & TData : OmitKeys, 'body' | 'url'> & TData & Pick, 'headers'> : TData extends { + headers?: any; +} ? OmitKeys, 'headers' | 'url'> & TData & Pick, 'body'> : OmitKeys, 'url'> & TData; + +declare const createClient: (config?: Config) => Client; + +export { type Auth, type Client, type ClientOptions, type Config, type CreateClientConfig, type Options, type OptionsLegacyParser, type QuerySerializerOptions, type RequestOptions, type RequestResult, type TDataShape, createClient, createConfig, formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer }; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.d.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.d.ts new file mode 100644 index 000000000..eb31a3687 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.d.ts @@ -0,0 +1,229 @@ +type AuthToken = string | undefined; +interface Auth { + /** + * Which part of the request do we use to send the auth? + * + * @default 'header' + */ + in?: 'header' | 'query' | 'cookie'; + /** + * Header or query parameter name. + * + * @default 'Authorization' + */ + name?: string; + scheme?: 'basic' | 'bearer'; + type: 'apiKey' | 'http'; +} +interface SerializerOptions { + /** + * @default true + */ + explode: boolean; + style: T; +} +type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; +type ObjectStyle = 'form' | 'deepObject'; + +type QuerySerializer = (query: Record) => string; +type BodySerializer = (body: any) => any; +interface QuerySerializerOptions { + allowReserved?: boolean; + array?: SerializerOptions; + object?: SerializerOptions; +} +declare const formDataBodySerializer: { + bodySerializer: | Array>>(body: T) => FormData; +}; +declare const jsonBodySerializer: { + bodySerializer: (body: T) => string; +}; +declare const urlSearchParamsBodySerializer: { + bodySerializer: | Array>>(body: T) => string; +}; + +interface Client$1 { + /** + * Returns the final request URL. + */ + buildUrl: BuildUrlFn; + connect: MethodFn; + delete: MethodFn; + get: MethodFn; + getConfig: () => Config; + head: MethodFn; + options: MethodFn; + patch: MethodFn; + post: MethodFn; + put: MethodFn; + request: RequestFn; + setConfig: (config: Config) => Config; + trace: MethodFn; +} +interface Config$1 { + /** + * Auth token or a function returning auth token. The resolved value will be + * added to the request payload as defined by its `security` array. + */ + auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; + /** + * A function for serializing request body parameter. By default, + * {@link JSON.stringify()} will be used. + */ + bodySerializer?: BodySerializer | null; + /** + * An object containing any HTTP headers that you want to pre-populate your + * `Headers` object with. + * + * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} + */ + headers?: RequestInit['headers'] | Record; + /** + * The request method. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} + */ + method?: 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE'; + /** + * A function for serializing request query parameters. By default, arrays + * will be exploded in form style, objects will be exploded in deepObject + * style, and reserved characters are percent-encoded. + * + * This method will have no effect if the native `paramsSerializer()` Axios + * API function is used. + * + * {@link https://swagger.io/docs/specification/serialization/#query View examples} + */ + querySerializer?: QuerySerializer | QuerySerializerOptions; + /** + * A function transforming response data before it's returned. This is useful + * for post-processing data, e.g. converting ISO strings into Date objects. + */ + responseTransformer?: (data: unknown) => Promise; + /** + * A function validating response data. This is useful if you want to ensure + * the response conforms to the desired shape, so it can be safely passed to + * the transformers and returned to the user. + */ + responseValidator?: (data: unknown) => Promise; +} + +type ErrInterceptor = (error: Err, response: Res, options: Options) => Err | Promise; +type ReqInterceptor = (options: Options) => void | Promise; +type ResInterceptor = (response: Res, options: Options) => Res | Promise; +declare class Interceptors { + _fns: Interceptor[]; + constructor(); + clear(): void; + exists(fn: Interceptor): boolean; + eject(fn: Interceptor): void; + use(fn: Interceptor): void; +} +interface Middleware { + error: Pick>, 'eject' | 'use'>; + request: Pick>, 'eject' | 'use'>; + response: Pick>, 'eject' | 'use'>; +} +declare const createConfig: (override?: Config & T>) => Config & T>; + +interface Config extends Omit, Config$1 { + /** + * Base URL for all requests made by this client. + */ + baseUrl?: T['baseUrl']; + /** + * Fetch API implementation. You can use this option to provide a custom + * fetch instance. + * + * @default globalThis.fetch + */ + fetch?: typeof fetch; + /** + * Return the response data parsed in a specified format. By default, `auto` + * will infer the appropriate method from the `Content-Type` response header. + * You can override this behavior with any of the {@link Body} methods. + * Select `stream` if you don't want to parse response data at all. + * + * @default 'auto' + */ + parseAs?: Exclude | 'auto' | 'stream'; + /** + * Throw an error instead of returning it in the response? + * + * @default false + */ + throwOnError?: T['throwOnError']; +} +interface RequestOptions extends Config<{ + throwOnError: ThrowOnError; +}> { + /** + * Any body that you want to add to your request. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} + */ + body?: unknown; + path?: Record; + query?: Record; + /** + * Security mechanism(s) to use for the request. + */ + security?: ReadonlyArray; + url: Url; +} +type RequestResult = ThrowOnError extends true ? Promise<{ + data: TData; + response: Response; +}> : Promise<({ + data: TData; + error: undefined; +} | { + data: undefined; + error: TError; +}) & { + response: Response; +}>; +interface ClientOptions { + baseUrl?: string; + throwOnError?: boolean; +} +type MethodFn = (options: Omit, 'method'>) => RequestResult; +type RequestFn = (options: Omit, 'method'> & Pick>, 'method'>) => RequestResult; +type BuildUrlFn = ; + query?: Record; + url: string; +}>(options: Pick & Options) => string; +type Client = Client$1 & { + interceptors: Middleware; +}; +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +type CreateClientConfig = (override?: Config) => Config & T>; +interface TDataShape { + body?: unknown; + headers?: unknown; + path?: unknown; + query?: unknown; + url: string; +} +type OmitKeys = Pick>; +type Options = OmitKeys, 'body' | 'path' | 'query' | 'url'> & Omit; +type OptionsLegacyParser = TData extends { + body?: any; +} ? TData extends { + headers?: any; +} ? OmitKeys, 'body' | 'headers' | 'url'> & TData : OmitKeys, 'body' | 'url'> & TData & Pick, 'headers'> : TData extends { + headers?: any; +} ? OmitKeys, 'headers' | 'url'> & TData & Pick, 'body'> : OmitKeys, 'url'> & TData; + +declare const createClient: (config?: Config) => Client; + +export { type Auth, type Client, type ClientOptions, type Config, type CreateClientConfig, type Options, type OptionsLegacyParser, type QuerySerializerOptions, type RequestOptions, type RequestResult, type TDataShape, createClient, createConfig, formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer }; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/sdk.gen.ts new file mode 100644 index 000000000..5cc6beedc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from './client'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/client.gen.ts new file mode 100644 index 000000000..f61bb2a26 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-next'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/sdk.gen.ts new file mode 100644 index 000000000..3b2915e8a --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-next'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/client.gen.ts new file mode 100644 index 000000000..f61bb2a26 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-next'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/sdk.gen.ts new file mode 100644 index 000000000..3b2915e8a --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-next'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/client.gen.ts new file mode 100644 index 000000000..f61bb2a26 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-next'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/sdk.gen.ts new file mode 100644 index 000000000..3a51df813 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/sdk.gen.ts @@ -0,0 +1,408 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-next'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options: Options) => { + return options.client.patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options: Options) => { + return options.client.delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options: Options) => { + return options.client.head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options: Options) => { + return options.client.options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options: Options) => { + return options.client.patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return options.client.delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options: Options) => { + return options.client.post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options: Options) => { + return options.client.delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return options.client.post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options: Options) => { + return options.client.post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return options.client.put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/client.gen.ts new file mode 100644 index 000000000..e4e7ddb56 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-nuxt'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/types.gen.ts new file mode 100644 index 000000000..9cb3fcf99 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/client.gen.ts new file mode 100644 index 000000000..107d15930 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-nuxt'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/types.gen.ts new file mode 100644 index 000000000..9cb3fcf99 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/client.gen.ts new file mode 100644 index 000000000..107d15930 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-nuxt'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/types.gen.ts new file mode 100644 index 000000000..a0d27c8ae --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base'; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/client.gen.ts new file mode 100644 index 000000000..05d3c1239 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-nuxt'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'https://foo.com' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/types.gen.ts new file mode 100644 index 000000000..9cb3fcf99 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client.gen.ts new file mode 100644 index 000000000..64c0080e8 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client/index.d.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client/index.d.ts new file mode 100644 index 000000000..d8a2a385e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client/index.d.ts @@ -0,0 +1,193 @@ +import { UseFetchOptions, AsyncDataOptions, useAsyncData, useFetch, useLazyAsyncData, useLazyFetch } from 'nuxt/app'; +import { Ref } from 'vue'; + +type AuthToken = string | undefined; +interface Auth { + /** + * Which part of the request do we use to send the auth? + * + * @default 'header' + */ + in?: 'header' | 'query' | 'cookie'; + /** + * Header or query parameter name. + * + * @default 'Authorization' + */ + name?: string; + scheme?: 'basic' | 'bearer'; + type: 'apiKey' | 'http'; +} +interface SerializerOptions { + /** + * @default true + */ + explode: boolean; + style: T; +} +type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; +type ObjectStyle = 'form' | 'deepObject'; + +type QuerySerializer$1 = (query: Record) => string; +type BodySerializer = (body: any) => any; +interface QuerySerializerOptions { + allowReserved?: boolean; + array?: SerializerOptions; + object?: SerializerOptions; +} +declare const formDataBodySerializer: { + bodySerializer: | Array>>(body: T) => FormData; +}; +declare const jsonBodySerializer: { + bodySerializer: (body: T) => string; +}; +declare const urlSearchParamsBodySerializer: { + bodySerializer: | Array>>(body: T) => string; +}; + +interface Client$1 { + /** + * Returns the final request URL. + */ + buildUrl: BuildUrlFn; + connect: MethodFn; + delete: MethodFn; + get: MethodFn; + getConfig: () => Config; + head: MethodFn; + options: MethodFn; + patch: MethodFn; + post: MethodFn; + put: MethodFn; + request: RequestFn; + setConfig: (config: Config) => Config; + trace: MethodFn; +} +interface Config$1 { + /** + * Auth token or a function returning auth token. The resolved value will be + * added to the request payload as defined by its `security` array. + */ + auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; + /** + * A function for serializing request body parameter. By default, + * {@link JSON.stringify()} will be used. + */ + bodySerializer?: BodySerializer | null; + /** + * An object containing any HTTP headers that you want to pre-populate your + * `Headers` object with. + * + * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} + */ + headers?: RequestInit['headers'] | Record; + /** + * The request method. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} + */ + method?: 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE'; + /** + * A function for serializing request query parameters. By default, arrays + * will be exploded in form style, objects will be exploded in deepObject + * style, and reserved characters are percent-encoded. + * + * This method will have no effect if the native `paramsSerializer()` Axios + * API function is used. + * + * {@link https://swagger.io/docs/specification/serialization/#query View examples} + */ + querySerializer?: QuerySerializer$1 | QuerySerializerOptions; + /** + * A function transforming response data before it's returned. This is useful + * for post-processing data, e.g. converting ISO strings into Date objects. + */ + responseTransformer?: (data: unknown) => Promise; + /** + * A function validating response data. This is useful if you want to ensure + * the response conforms to the desired shape, so it can be safely passed to + * the transformers and returned to the user. + */ + responseValidator?: (data: unknown) => Promise; +} + +type QuerySerializer = (query: Parameters[0]['query']) => string; +type WithRefs = { + [K in keyof TData]: NonNullable extends object ? WithRefs> | Ref> : NonNullable | Ref>; +}; +type KeysOf = Array; +interface Config extends Omit, 'baseURL' | 'body' | 'headers' | 'method' | 'query'>, WithRefs, 'query'>>, Omit { + /** + * Base URL for all requests made by this client. + */ + baseURL?: T['baseURL']; + /** + * A function for serializing request query parameters. By default, arrays + * will be exploded in form style, objects will be exploded in deepObject + * style, and reserved characters are percent-encoded. + * + * {@link https://swagger.io/docs/specification/serialization/#query View examples} + */ + querySerializer?: QuerySerializer | QuerySerializerOptions; +} +interface RequestOptions extends Config, WithRefs<{ + /** + * Any body that you want to add to your request. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} + */ + body?: unknown; + path?: FetchOptions['query']; + query?: FetchOptions['query']; +}> { + asyncDataOptions?: AsyncDataOptions, DefaultT>; + composable: TComposable; + key?: string; + /** + * Security mechanism(s) to use for the request. + */ + security?: ReadonlyArray; + url: Url; +} +type RequestResult = TComposable extends '$fetch' ? ReturnType> : TComposable extends 'useAsyncData' ? ReturnType> : TComposable extends 'useFetch' ? ReturnType> : TComposable extends 'useLazyAsyncData' ? ReturnType> : TComposable extends 'useLazyFetch' ? ReturnType> : never; +interface ClientOptions { + baseURL?: string; +} +type MethodFn = (options: Omit, 'method'>) => RequestResult; +type RequestFn = (options: Omit, 'method'> & Pick>, 'method'>) => RequestResult; +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +type CreateClientConfig = (override?: Config) => Config & T>; +interface TDataShape { + body?: unknown; + headers?: unknown; + path?: FetchOptions['query']; + query?: FetchOptions['query']; + url: string; +} +type BuildUrlOptions = Omit> = Pick, 'path' | 'query'> & Pick & Pick, 'baseURL' | 'querySerializer'>; +type BuildUrlFn = >(options: BuildUrlOptions) => string; +type Client = Client$1; +type OmitKeys = Pick>; +type Options = OmitKeys, 'body' | 'path' | 'query' | 'url'> & WithRefs>; +type OptionsLegacyParser = TData extends { + body?: any; +} ? TData extends { + headers?: any; +} ? OmitKeys & TData : OmitKeys & TData & Pick : TData extends { + headers?: any; +} ? OmitKeys & TData & Pick : OmitKeys & TData; +type FetchOptions = Omit, keyof AsyncDataOptions>; +type Composable = '$fetch' | 'useAsyncData' | 'useFetch' | 'useLazyAsyncData' | 'useLazyFetch'; + +declare const createClient: (config?: Config) => Client; + +declare const createConfig: (override?: Config & T>) => Config & T>; + +export { type Auth, type Client, type ClientOptions, type Composable, type Config, type CreateClientConfig, type Options, type OptionsLegacyParser, type QuerySerializerOptions, type RequestOptions, type RequestResult, type TDataShape, createClient, createConfig, formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer }; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client/index.js b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client/index.js new file mode 100644 index 000000000..fe534408a --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client/index.js @@ -0,0 +1,2 @@ +import {useLazyFetch,useFetch,useAsyncData,useLazyAsyncData}from'nuxt/app';import {toValue,reactive,ref,watch,isRef,unref}from'vue';var E=async(r,t)=>{let e=typeof t=="function"?await t(r):t;if(e)return r.scheme==="bearer"?`Bearer ${e}`:r.scheme==="basic"?`Basic ${btoa(e)}`:e},U=(r,t,e)=>{typeof e=="string"||e instanceof Blob?r.append(t,e):r.append(t,JSON.stringify(e));},k=(r,t,e)=>{typeof e=="string"?r.append(t,e):r.append(t,JSON.stringify(e));},F={bodySerializer:r=>{let t=new FormData;return Object.entries(r).forEach(([e,a])=>{a!=null&&(Array.isArray(a)?a.forEach(o=>U(t,e,o)):U(t,e,a));}),t}},R={bodySerializer:r=>JSON.stringify(r,(t,e)=>typeof e=="bigint"?e.toString():e)},I={bodySerializer:r=>{let t=new URLSearchParams;return Object.entries(r).forEach(([e,a])=>{a!=null&&(Array.isArray(a)?a.forEach(o=>k(t,e,o)):k(t,e,a));}),t.toString()}},N=r=>{switch(r){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},Q=r=>{switch(r){case "form":return ",";case "pipeDelimited":return "|";case "spaceDelimited":return "%20";default:return ","}},V=r=>{switch(r){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},S=({allowReserved:r,explode:t,name:e,style:a,value:o})=>{if(!t){let i=(r?o:o.map(u=>encodeURIComponent(u))).join(Q(a));switch(a){case "label":return `.${i}`;case "matrix":return `;${e}=${i}`;case "simple":return i;default:return `${e}=${i}`}}let n=N(a),s=o.map(i=>a==="label"||a==="simple"?r?i:encodeURIComponent(i):p({allowReserved:r,name:e,value:i})).join(n);return a==="label"||a==="matrix"?n+s:s},p=({allowReserved:r,name:t,value:e})=>{if(e==null)return "";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return `${t}=${r?e:encodeURIComponent(e)}`},z=({allowReserved:r,explode:t,name:e,style:a,value:o})=>{if(o instanceof Date)return `${e}=${o.toISOString()}`;if(a!=="deepObject"&&!t){let i=[];Object.entries(o).forEach(([l,d])=>{i=[...i,l,r?d:encodeURIComponent(d)];});let u=i.join(",");switch(a){case "form":return `${e}=${u}`;case "label":return `.${u}`;case "matrix":return `;${e}=${u}`;default:return u}}let n=V(a),s=Object.entries(o).map(([i,u])=>p({allowReserved:r,name:a==="deepObject"?`${e}[${i}]`:i,value:u})).join(n);return a==="label"||a==="matrix"?n+s:s};var W=/\{[^{}]+\}/g,J=({path:r,url:t})=>{let e=t,a=t.match(W);if(a)for(let o of a){let n=false,s=o.substring(1,o.length-1),i="simple";s.endsWith("*")&&(n=true,s=s.substring(0,s.length-1)),s.startsWith(".")?(s=s.substring(1),i="label"):s.startsWith(";")&&(s=s.substring(1),i="matrix");let u=toValue(toValue(r)[s]);if(u==null)continue;if(Array.isArray(u)){e=e.replace(o,S({explode:n,name:s,style:i,value:u}));continue}if(typeof u=="object"){e=e.replace(o,z({explode:n,name:s,style:i,value:u}));continue}if(i==="matrix"){e=e.replace(o,`;${p({name:s,value:u})}`);continue}let l=encodeURIComponent(i==="label"?`.${u}`:u);e=e.replace(o,l);}return e},v=({allowReserved:r,array:t,object:e}={})=>o=>{let n=[],s=toValue(o);if(s&&typeof s=="object")for(let i in s){let u=toValue(s[i]);if(u!=null){if(Array.isArray(u)){n=[...n,S({allowReserved:r,explode:true,name:i,style:"form",value:u,...t})];continue}if(typeof u=="object"){n=[...n,z({allowReserved:r,explode:true,name:i,style:"deepObject",value:u,...e})];continue}n=[...n,p({allowReserved:r,name:i,value:u})];}}return n.join("&")},B=async({security:r,...t})=>{for(let e of r){let a=await E(e,t.auth);if(!a)continue;let o=e.name??"Authorization";switch(e.in){case "query":t.query||(t.query={}),toValue(t.query)[o]=a;break;case "cookie":t.headers.append("Cookie",`${o}=${a}`);break;case "header":default:t.headers.set(o,a);break}return}},h=r=>M({baseUrl:r.baseURL,path:r.path,query:r.query,querySerializer:typeof r.querySerializer=="function"?r.querySerializer:v(r.querySerializer),url:r.url}),M=({baseUrl:r,path:t,query:e,querySerializer:a,url:o})=>{let n=o.startsWith("/")?o:`/${o}`,s=(r??"")+n;t&&(s=J({path:t,url:s}));let i=e?a(e):"";return i.startsWith("?")&&(i=i.substring(1)),i&&(s+=`?${i}`),s},A=(r,t)=>{let e={...r,...t};return e.baseURL?.endsWith("/")&&(e.baseURL=e.baseURL.substring(0,e.baseURL.length-1)),e.headers=O(r.headers,t.headers),e},O=(...r)=>{let t=new Headers;for(let e of r){if(!e||typeof e!="object")continue;let a=e;isRef(a)&&(a=unref(a));let o=a instanceof Headers?a.entries():Object.entries(a);for(let[n,s]of o)if(s===null)t.delete(n);else if(Array.isArray(s))for(let i of s)t.append(n,y(i));else if(s!==void 0){let i=y(s);t.set(n,typeof i=="object"?JSON.stringify(i):i);}}return t},q=(...r)=>r.reduce((t,e)=>{if(typeof e=="function")t.push(e);else if(Array.isArray(e))return t.concat(e);return t},[]),_=v({allowReserved:false,array:{explode:true,style:"form"},object:{explode:true,style:"deepObject"}}),K={"Content-Type":"application/json"},w=(r={})=>({...R,headers:K,querySerializer:_,...r}),y=r=>{if(r===null||typeof r!="object"||r instanceof Headers)return isRef(r)?unref(r):r;if(Array.isArray(r))return r.map(e=>y(e));if(isRef(r))return y(unref(r));let t={};for(let e in r)t[e]=y(r[e]);return t},g=r=>r.body&&r.bodySerializer?r.bodySerializer(r.body):r.body,P=(r,t)=>{let e=y(r);return e.body=g(e),t(h(r),e)};var re=(r={})=>{let t=A(w(),r),e=()=>({...t}),a=n=>(t=A(t,n),e()),o=({asyncDataOptions:n,composable:s,key:i,...u})=>{let l={...t,...u,$fetch:u.$fetch??t.$fetch??$fetch,headers:O(t.headers,u.headers),onRequest:q(t.onRequest,u.onRequest),onResponse:q(t.onResponse,u.onResponse)},{responseTransformer:d,responseValidator:C,security:j}=l;j&&(l.onRequest=[async({options:c})=>{await B({auth:l.auth,headers:c.headers,query:c.query,security:j});},...l.onRequest]),(d||C)&&(l.onResponse=[...l.onResponse,async({options:c,response:f})=>{c.responseType&&c.responseType!=="json"||f.ok&&(C&&await C(f._data),d&&(f._data=await d(f._data)));}]),(l.body===void 0||l.body==="")&&l.headers.delete("Content-Type");let $=l.$fetch;if(s==="$fetch")return P(l,$);if(s==="useFetch"||s==="useLazyFetch"){let c=reactive({body:l.body,bodySerializer:l.bodySerializer}),f=ref(g(l));return l.body=f,watch(c,D=>{f.value=g(D);}),s==="useLazyFetch"?useLazyFetch(()=>h(l),l):useFetch(()=>h(l),l)}let b=()=>P(l,$);if(s==="useAsyncData")return i?useAsyncData(i,b,n):useAsyncData(b,n);if(s==="useLazyAsyncData")return i?useLazyAsyncData(i,b,n):useLazyAsyncData(b,n)};return {buildUrl:h,connect:n=>o({...n,method:"CONNECT"}),delete:n=>o({...n,method:"DELETE"}),get:n=>o({...n,method:"GET"}),getConfig:e,head:n=>o({...n,method:"HEAD"}),options:n=>o({...n,method:"OPTIONS"}),patch:n=>o({...n,method:"PATCH"}),post:n=>o({...n,method:"POST"}),put:n=>o({...n,method:"PUT"}),request:o,setConfig:a,trace:n=>o({...n,method:"TRACE"})}};export{re as createClient,w as createConfig,F as formDataBodySerializer,R as jsonBodySerializer,I as urlSearchParamsBodySerializer};//# sourceMappingURL=index.js.map +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/sdk.gen.ts new file mode 100644 index 000000000..fb9e7463c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type Composable, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from './client'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options: Options) => { + return (options.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options: Options) => { + return (options.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options: Options) => { + return (options.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options: Options) => { + return (options.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/types.gen.ts new file mode 100644 index 000000000..9cb3fcf99 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/client.gen.ts new file mode 100644 index 000000000..107d15930 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-nuxt'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/sdk.gen.ts new file mode 100644 index 000000000..52b3d2f89 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type Composable, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-nuxt'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options: Options) => { + return (options.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options: Options) => { + return (options.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options: Options) => { + return (options.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options: Options) => { + return (options.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/types.gen.ts new file mode 100644 index 000000000..9cb3fcf99 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/client.gen.ts new file mode 100644 index 000000000..107d15930 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-nuxt'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/sdk.gen.ts new file mode 100644 index 000000000..52b3d2f89 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type Composable, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-nuxt'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options: Options) => { + return (options.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options: Options) => { + return (options.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options: Options) => { + return (options.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options: Options) => { + return (options.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/types.gen.ts new file mode 100644 index 000000000..9cb3fcf99 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/client.gen.ts new file mode 100644 index 000000000..107d15930 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-nuxt'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/sdk.gen.ts new file mode 100644 index 000000000..a9dcde0e7 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/sdk.gen.ts @@ -0,0 +1,408 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type Composable, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-nuxt'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options: Options) => { + return options.client.patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options: Options) => { + return options.client.delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options: Options) => { + return options.client.head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options: Options) => { + return options.client.options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options: Options) => { + return options.client.patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return options.client.delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options: Options) => { + return options.client.post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options: Options) => { + return options.client.delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return options.client.post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options: Options) => { + return options.client.post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return options.client.put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/types.gen.ts new file mode 100644 index 000000000..9cb3fcf99 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/client.gen.ts new file mode 100644 index 000000000..851ca2f65 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-custom'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/client.gen.ts new file mode 100644 index 000000000..c72285a7e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-custom'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/client.gen.ts new file mode 100644 index 000000000..c72285a7e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-custom'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/types.gen.ts new file mode 100644 index 000000000..c3e87ddf4 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base'; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/client.gen.ts new file mode 100644 index 000000000..d003f7736 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-custom'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'https://foo.com' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client.gen.ts new file mode 100644 index 000000000..14f2d878c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.cjs b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.cjs new file mode 100644 index 000000000..2886023aa --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.cjs @@ -0,0 +1,2 @@ +'use strict';var A=async(t,r)=>{let e=typeof r=="function"?await r(t):r;if(e)return t.scheme==="bearer"?`Bearer ${e}`:t.scheme==="basic"?`Basic ${btoa(e)}`:e},z=(t,r,e)=>{typeof e=="string"||e instanceof Blob?t.append(r,e):t.append(r,JSON.stringify(e));},j=(t,r,e)=>{typeof e=="string"?t.append(r,e):t.append(r,JSON.stringify(e));},v={bodySerializer:t=>{let r=new FormData;return Object.entries(t).forEach(([e,a])=>{a!=null&&(Array.isArray(a)?a.forEach(i=>z(r,e,i)):z(r,e,a));}),r}},R={bodySerializer:t=>JSON.stringify(t,(r,e)=>typeof e=="bigint"?e.toString():e)},$={bodySerializer:t=>{let r=new URLSearchParams;return Object.entries(t).forEach(([e,a])=>{a!=null&&(Array.isArray(a)?a.forEach(i=>j(r,e,i)):j(r,e,a));}),r.toString()}},U=t=>{switch(t){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},_=t=>{switch(t){case "form":return ",";case "pipeDelimited":return "|";case "spaceDelimited":return "%20";default:return ","}},D=t=>{switch(t){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},O=({allowReserved:t,explode:r,name:e,style:a,value:i})=>{if(!r){let s=(t?i:i.map(l=>encodeURIComponent(l))).join(_(a));switch(a){case "label":return `.${s}`;case "matrix":return `;${e}=${s}`;case "simple":return s;default:return `${e}=${s}`}}let o=U(a),n=i.map(s=>a==="label"||a==="simple"?t?s:encodeURIComponent(s):y({allowReserved:t,name:e,value:s})).join(o);return a==="label"||a==="matrix"?o+n:n},y=({allowReserved:t,name:r,value:e})=>{if(e==null)return "";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return `${r}=${t?e:encodeURIComponent(e)}`},q=({allowReserved:t,explode:r,name:e,style:a,value:i})=>{if(i instanceof Date)return `${e}=${i.toISOString()}`;if(a!=="deepObject"&&!r){let s=[];Object.entries(i).forEach(([f,u])=>{s=[...s,f,t?u:encodeURIComponent(u)];});let l=s.join(",");switch(a){case "form":return `${e}=${l}`;case "label":return `.${l}`;case "matrix":return `;${e}=${l}`;default:return l}}let o=D(a),n=Object.entries(i).map(([s,l])=>y({allowReserved:t,name:a==="deepObject"?`${e}[${s}]`:s,value:l})).join(o);return a==="label"||a==="matrix"?o+n:n};var H=/\{[^{}]+\}/g,B=({path:t,url:r})=>{let e=r,a=r.match(H);if(a)for(let i of a){let o=false,n=i.substring(1,i.length-1),s="simple";n.endsWith("*")&&(o=true,n=n.substring(0,n.length-1)),n.startsWith(".")?(n=n.substring(1),s="label"):n.startsWith(";")&&(n=n.substring(1),s="matrix");let l=t[n];if(l==null)continue;if(Array.isArray(l)){e=e.replace(i,O({explode:o,name:n,style:s,value:l}));continue}if(typeof l=="object"){e=e.replace(i,q({explode:o,name:n,style:s,value:l}));continue}if(s==="matrix"){e=e.replace(i,`;${y({name:n,value:l})}`);continue}let f=encodeURIComponent(s==="label"?`.${l}`:l);e=e.replace(i,f);}return e},E=({allowReserved:t,array:r,object:e}={})=>i=>{let o=[];if(i&&typeof i=="object")for(let n in i){let s=i[n];if(s!=null){if(Array.isArray(s)){o=[...o,O({allowReserved:t,explode:true,name:n,style:"form",value:s,...r})];continue}if(typeof s=="object"){o=[...o,q({allowReserved:t,explode:true,name:n,style:"deepObject",value:s,...e})];continue}o=[...o,y({allowReserved:t,name:n,value:s})];}}return o.join("&")},P=t=>{if(!t)return "stream";let r=t.split(";")[0]?.trim();if(r){if(r.startsWith("application/json")||r.endsWith("+json"))return "json";if(r==="multipart/form-data")return "formData";if(["application/","audio/","image/","video/"].some(e=>r.startsWith(e)))return "blob";if(r.startsWith("text/"))return "text"}},I=async({security:t,...r})=>{for(let e of t){let a=await A(e,r.auth);if(!a)continue;let i=e.name??"Authorization";switch(e.in){case "query":r.query||(r.query={}),r.query[i]=a;break;case "cookie":r.headers.append("Cookie",`${i}=${a}`);break;case "header":default:r.headers.set(i,a);break}return}},S=t=>W({baseUrl:t.baseUrl,path:t.path,query:t.query,querySerializer:typeof t.querySerializer=="function"?t.querySerializer:E(t.querySerializer),url:t.url}),W=({baseUrl:t,path:r,query:e,querySerializer:a,url:i})=>{let o=i.startsWith("/")?i:`/${i}`,n=(t??"")+o;r&&(n=B({path:r,url:n}));let s=e?a(e):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(n+=`?${s}`),n},C=(t,r)=>{let e={...t,...r};return e.baseUrl?.endsWith("/")&&(e.baseUrl=e.baseUrl.substring(0,e.baseUrl.length-1)),e.headers=x(t.headers,r.headers),e},x=(...t)=>{let r=new Headers;for(let e of t){if(!e||typeof e!="object")continue;let a=e instanceof Headers?e.entries():Object.entries(e);for(let[i,o]of a)if(o===null)r.delete(i);else if(Array.isArray(o))for(let n of o)r.append(i,n);else o!==void 0&&r.set(i,typeof o=="object"?JSON.stringify(o):o);}return r},h=class{_fns;constructor(){this._fns=[];}clear(){this._fns=[];}exists(r){return this._fns.indexOf(r)!==-1}eject(r){let e=this._fns.indexOf(r);e!==-1&&(this._fns=[...this._fns.slice(0,e),...this._fns.slice(e+1)]);}use(r){this._fns=[...this._fns,r];}},T=()=>({error:new h,request:new h,response:new h}),N=E({allowReserved:false,array:{explode:true,style:"form"},object:{explode:true,style:"deepObject"}}),Q={"Content-Type":"application/json"},w=(t={})=>({...R,headers:Q,parseAs:"auto",querySerializer:N,...t});var J=(t={})=>{let r=C(w(),t),e=()=>({...r}),a=n=>(r=C(r,n),e()),i=T(),o=async n=>{let s={...r,...n,fetch:n.fetch??r.fetch??globalThis.fetch,headers:x(r.headers,n.headers)};s.security&&await I({...s,security:s.security}),s.body&&s.bodySerializer&&(s.body=s.bodySerializer(s.body)),(s.body===void 0||s.body==="")&&s.headers.delete("Content-Type");let l=S(s),f={redirect:"follow",...s},u=new Request(l,f);for(let p of i.request._fns)u=await p(u,s);let k=s.fetch,c=await k(u);for(let p of i.response._fns)c=await p(c,u,s);let m={request:u,response:c};if(c.ok){if(c.status===204||c.headers.get("Content-Length")==="0")return {data:{},...m};let p=(s.parseAs==="auto"?P(c.headers.get("Content-Type")):s.parseAs)??"json";if(p==="stream")return {data:c.body,...m};let b=await c[p]();return p==="json"&&(s.responseValidator&&await s.responseValidator(b),s.responseTransformer&&(b=await s.responseTransformer(b))),{data:b,...m}}let g=await c.text();try{g=JSON.parse(g);}catch{}let d=g;for(let p of i.error._fns)d=await p(g,c,u,s);if(d=d||{},s.throwOnError)throw d;return {error:d,...m}};return {buildUrl:S,connect:n=>o({...n,method:"CONNECT"}),delete:n=>o({...n,method:"DELETE"}),get:n=>o({...n,method:"GET"}),getConfig:e,head:n=>o({...n,method:"HEAD"}),interceptors:i,options:n=>o({...n,method:"OPTIONS"}),patch:n=>o({...n,method:"PATCH"}),post:n=>o({...n,method:"POST"}),put:n=>o({...n,method:"PUT"}),request:o,setConfig:a,trace:n=>o({...n,method:"TRACE"})}};exports.createClient=J;exports.createConfig=w;exports.formDataBodySerializer=v;exports.jsonBodySerializer=R;exports.urlSearchParamsBodySerializer=$;//# sourceMappingURL=index.cjs.map +//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.d.cts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.d.cts new file mode 100644 index 000000000..ec7b7c7c0 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.d.cts @@ -0,0 +1,231 @@ +type AuthToken = string | undefined; +interface Auth { + /** + * Which part of the request do we use to send the auth? + * + * @default 'header' + */ + in?: 'header' | 'query' | 'cookie'; + /** + * Header or query parameter name. + * + * @default 'Authorization' + */ + name?: string; + scheme?: 'basic' | 'bearer'; + type: 'apiKey' | 'http'; +} +interface SerializerOptions { + /** + * @default true + */ + explode: boolean; + style: T; +} +type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; +type ObjectStyle = 'form' | 'deepObject'; + +type QuerySerializer = (query: Record) => string; +type BodySerializer = (body: any) => any; +interface QuerySerializerOptions { + allowReserved?: boolean; + array?: SerializerOptions; + object?: SerializerOptions; +} +declare const formDataBodySerializer: { + bodySerializer: | Array>>(body: T) => FormData; +}; +declare const jsonBodySerializer: { + bodySerializer: (body: T) => string; +}; +declare const urlSearchParamsBodySerializer: { + bodySerializer: | Array>>(body: T) => string; +}; + +interface Client$1 { + /** + * Returns the final request URL. + */ + buildUrl: BuildUrlFn; + connect: MethodFn; + delete: MethodFn; + get: MethodFn; + getConfig: () => Config; + head: MethodFn; + options: MethodFn; + patch: MethodFn; + post: MethodFn; + put: MethodFn; + request: RequestFn; + setConfig: (config: Config) => Config; + trace: MethodFn; +} +interface Config$1 { + /** + * Auth token or a function returning auth token. The resolved value will be + * added to the request payload as defined by its `security` array. + */ + auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; + /** + * A function for serializing request body parameter. By default, + * {@link JSON.stringify()} will be used. + */ + bodySerializer?: BodySerializer | null; + /** + * An object containing any HTTP headers that you want to pre-populate your + * `Headers` object with. + * + * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} + */ + headers?: RequestInit['headers'] | Record; + /** + * The request method. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} + */ + method?: 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE'; + /** + * A function for serializing request query parameters. By default, arrays + * will be exploded in form style, objects will be exploded in deepObject + * style, and reserved characters are percent-encoded. + * + * This method will have no effect if the native `paramsSerializer()` Axios + * API function is used. + * + * {@link https://swagger.io/docs/specification/serialization/#query View examples} + */ + querySerializer?: QuerySerializer | QuerySerializerOptions; + /** + * A function transforming response data before it's returned. This is useful + * for post-processing data, e.g. converting ISO strings into Date objects. + */ + responseTransformer?: (data: unknown) => Promise; + /** + * A function validating response data. This is useful if you want to ensure + * the response conforms to the desired shape, so it can be safely passed to + * the transformers and returned to the user. + */ + responseValidator?: (data: unknown) => Promise; +} + +type ErrInterceptor = (error: Err, response: Res, request: Req, options: Options) => Err | Promise; +type ReqInterceptor = (request: Req, options: Options) => Req | Promise; +type ResInterceptor = (response: Res, request: Req, options: Options) => Res | Promise; +declare class Interceptors { + _fns: Interceptor[]; + constructor(); + clear(): void; + exists(fn: Interceptor): boolean; + eject(fn: Interceptor): void; + use(fn: Interceptor): void; +} +interface Middleware { + error: Pick>, 'eject' | 'use'>; + request: Pick>, 'eject' | 'use'>; + response: Pick>, 'eject' | 'use'>; +} +declare const createConfig: (override?: Config & T>) => Config & T>; + +interface Config extends Omit, Config$1 { + /** + * Base URL for all requests made by this client. + */ + baseUrl?: T['baseUrl']; + /** + * Fetch API implementation. You can use this option to provide a custom + * fetch instance. + * + * @default globalThis.fetch + */ + fetch?: (request: Request) => ReturnType; + /** + * Return the response data parsed in a specified format. By default, `auto` + * will infer the appropriate method from the `Content-Type` response header. + * You can override this behavior with any of the {@link Body} methods. + * Select `stream` if you don't want to parse response data at all. + * + * @default 'auto' + */ + parseAs?: Exclude | 'auto' | 'stream'; + /** + * Throw an error instead of returning it in the response? + * + * @default false + */ + throwOnError?: T['throwOnError']; +} +interface RequestOptions extends Config<{ + throwOnError: ThrowOnError; +}> { + /** + * Any body that you want to add to your request. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} + */ + body?: unknown; + path?: Record; + query?: Record; + /** + * Security mechanism(s) to use for the request. + */ + security?: ReadonlyArray; + url: Url; +} +type RequestResult = ThrowOnError extends true ? Promise<{ + data: TData; + request: Request; + response: Response; +}> : Promise<({ + data: TData; + error: undefined; +} | { + data: undefined; + error: TError; +}) & { + request: Request; + response: Response; +}>; +interface ClientOptions { + baseUrl?: string; + throwOnError?: boolean; +} +type MethodFn = (options: Omit, 'method'>) => RequestResult; +type RequestFn = (options: Omit, 'method'> & Pick>, 'method'>) => RequestResult; +type BuildUrlFn = ; + query?: Record; + url: string; +}>(options: Pick & Options) => string; +type Client = Client$1 & { + interceptors: Middleware; +}; +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +type CreateClientConfig = (override?: Config) => Config & T>; +interface TDataShape { + body?: unknown; + headers?: unknown; + path?: unknown; + query?: unknown; + url: string; +} +type OmitKeys = Pick>; +type Options = OmitKeys, 'body' | 'path' | 'query' | 'url'> & Omit; +type OptionsLegacyParser = TData extends { + body?: any; +} ? TData extends { + headers?: any; +} ? OmitKeys, 'body' | 'headers' | 'url'> & TData : OmitKeys, 'body' | 'url'> & TData & Pick, 'headers'> : TData extends { + headers?: any; +} ? OmitKeys, 'headers' | 'url'> & TData & Pick, 'body'> : OmitKeys, 'url'> & TData; + +declare const createClient: (config?: Config) => Client; + +export { type Auth, type Client, type ClientOptions, type Config, type CreateClientConfig, type Options, type OptionsLegacyParser, type QuerySerializerOptions, type RequestOptions, type RequestResult, type TDataShape, createClient, createConfig, formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer }; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.d.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.d.ts new file mode 100644 index 000000000..ec7b7c7c0 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.d.ts @@ -0,0 +1,231 @@ +type AuthToken = string | undefined; +interface Auth { + /** + * Which part of the request do we use to send the auth? + * + * @default 'header' + */ + in?: 'header' | 'query' | 'cookie'; + /** + * Header or query parameter name. + * + * @default 'Authorization' + */ + name?: string; + scheme?: 'basic' | 'bearer'; + type: 'apiKey' | 'http'; +} +interface SerializerOptions { + /** + * @default true + */ + explode: boolean; + style: T; +} +type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; +type ObjectStyle = 'form' | 'deepObject'; + +type QuerySerializer = (query: Record) => string; +type BodySerializer = (body: any) => any; +interface QuerySerializerOptions { + allowReserved?: boolean; + array?: SerializerOptions; + object?: SerializerOptions; +} +declare const formDataBodySerializer: { + bodySerializer: | Array>>(body: T) => FormData; +}; +declare const jsonBodySerializer: { + bodySerializer: (body: T) => string; +}; +declare const urlSearchParamsBodySerializer: { + bodySerializer: | Array>>(body: T) => string; +}; + +interface Client$1 { + /** + * Returns the final request URL. + */ + buildUrl: BuildUrlFn; + connect: MethodFn; + delete: MethodFn; + get: MethodFn; + getConfig: () => Config; + head: MethodFn; + options: MethodFn; + patch: MethodFn; + post: MethodFn; + put: MethodFn; + request: RequestFn; + setConfig: (config: Config) => Config; + trace: MethodFn; +} +interface Config$1 { + /** + * Auth token or a function returning auth token. The resolved value will be + * added to the request payload as defined by its `security` array. + */ + auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; + /** + * A function for serializing request body parameter. By default, + * {@link JSON.stringify()} will be used. + */ + bodySerializer?: BodySerializer | null; + /** + * An object containing any HTTP headers that you want to pre-populate your + * `Headers` object with. + * + * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} + */ + headers?: RequestInit['headers'] | Record; + /** + * The request method. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} + */ + method?: 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE'; + /** + * A function for serializing request query parameters. By default, arrays + * will be exploded in form style, objects will be exploded in deepObject + * style, and reserved characters are percent-encoded. + * + * This method will have no effect if the native `paramsSerializer()` Axios + * API function is used. + * + * {@link https://swagger.io/docs/specification/serialization/#query View examples} + */ + querySerializer?: QuerySerializer | QuerySerializerOptions; + /** + * A function transforming response data before it's returned. This is useful + * for post-processing data, e.g. converting ISO strings into Date objects. + */ + responseTransformer?: (data: unknown) => Promise; + /** + * A function validating response data. This is useful if you want to ensure + * the response conforms to the desired shape, so it can be safely passed to + * the transformers and returned to the user. + */ + responseValidator?: (data: unknown) => Promise; +} + +type ErrInterceptor = (error: Err, response: Res, request: Req, options: Options) => Err | Promise; +type ReqInterceptor = (request: Req, options: Options) => Req | Promise; +type ResInterceptor = (response: Res, request: Req, options: Options) => Res | Promise; +declare class Interceptors { + _fns: Interceptor[]; + constructor(); + clear(): void; + exists(fn: Interceptor): boolean; + eject(fn: Interceptor): void; + use(fn: Interceptor): void; +} +interface Middleware { + error: Pick>, 'eject' | 'use'>; + request: Pick>, 'eject' | 'use'>; + response: Pick>, 'eject' | 'use'>; +} +declare const createConfig: (override?: Config & T>) => Config & T>; + +interface Config extends Omit, Config$1 { + /** + * Base URL for all requests made by this client. + */ + baseUrl?: T['baseUrl']; + /** + * Fetch API implementation. You can use this option to provide a custom + * fetch instance. + * + * @default globalThis.fetch + */ + fetch?: (request: Request) => ReturnType; + /** + * Return the response data parsed in a specified format. By default, `auto` + * will infer the appropriate method from the `Content-Type` response header. + * You can override this behavior with any of the {@link Body} methods. + * Select `stream` if you don't want to parse response data at all. + * + * @default 'auto' + */ + parseAs?: Exclude | 'auto' | 'stream'; + /** + * Throw an error instead of returning it in the response? + * + * @default false + */ + throwOnError?: T['throwOnError']; +} +interface RequestOptions extends Config<{ + throwOnError: ThrowOnError; +}> { + /** + * Any body that you want to add to your request. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} + */ + body?: unknown; + path?: Record; + query?: Record; + /** + * Security mechanism(s) to use for the request. + */ + security?: ReadonlyArray; + url: Url; +} +type RequestResult = ThrowOnError extends true ? Promise<{ + data: TData; + request: Request; + response: Response; +}> : Promise<({ + data: TData; + error: undefined; +} | { + data: undefined; + error: TError; +}) & { + request: Request; + response: Response; +}>; +interface ClientOptions { + baseUrl?: string; + throwOnError?: boolean; +} +type MethodFn = (options: Omit, 'method'>) => RequestResult; +type RequestFn = (options: Omit, 'method'> & Pick>, 'method'>) => RequestResult; +type BuildUrlFn = ; + query?: Record; + url: string; +}>(options: Pick & Options) => string; +type Client = Client$1 & { + interceptors: Middleware; +}; +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +type CreateClientConfig = (override?: Config) => Config & T>; +interface TDataShape { + body?: unknown; + headers?: unknown; + path?: unknown; + query?: unknown; + url: string; +} +type OmitKeys = Pick>; +type Options = OmitKeys, 'body' | 'path' | 'query' | 'url'> & Omit; +type OptionsLegacyParser = TData extends { + body?: any; +} ? TData extends { + headers?: any; +} ? OmitKeys, 'body' | 'headers' | 'url'> & TData : OmitKeys, 'body' | 'url'> & TData & Pick, 'headers'> : TData extends { + headers?: any; +} ? OmitKeys, 'headers' | 'url'> & TData & Pick, 'body'> : OmitKeys, 'url'> & TData; + +declare const createClient: (config?: Config) => Client; + +export { type Auth, type Client, type ClientOptions, type Config, type CreateClientConfig, type Options, type OptionsLegacyParser, type QuerySerializerOptions, type RequestOptions, type RequestResult, type TDataShape, createClient, createConfig, formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer }; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/sdk.gen.ts new file mode 100644 index 000000000..5cc6beedc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from './client'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/client.gen.ts new file mode 100644 index 000000000..c72285a7e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-custom'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/sdk.gen.ts new file mode 100644 index 000000000..29335ac4c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-custom'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/client.gen.ts new file mode 100644 index 000000000..c72285a7e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-custom'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/sdk.gen.ts new file mode 100644 index 000000000..29335ac4c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-custom'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/client.gen.ts new file mode 100644 index 000000000..c72285a7e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-custom'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/sdk.gen.ts new file mode 100644 index 000000000..9b020d8b5 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/sdk.gen.ts @@ -0,0 +1,408 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-custom'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options: Options) => { + return options.client.patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options: Options) => { + return options.client.delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options: Options) => { + return options.client.head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options: Options) => { + return options.client.options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options: Options) => { + return options.client.patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return options.client.delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options: Options) => { + return options.client.post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options: Options) => { + return options.client.delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return options.client.post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options: Options) => { + return options.client.post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return options.client.put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/client.gen.ts new file mode 100644 index 000000000..efa58fa3d --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '../../../../../custom/client'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/client.gen.ts new file mode 100644 index 000000000..2dae0db79 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '../../../../../custom/client'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/client.gen.ts new file mode 100644 index 000000000..2dae0db79 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '../../../../../custom/client'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/types.gen.ts new file mode 100644 index 000000000..c3e87ddf4 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base'; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/client.gen.ts new file mode 100644 index 000000000..41a499e41 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '../../../../../custom/client'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'https://foo.com' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client.gen.ts new file mode 100644 index 000000000..14f2d878c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/client.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/client.ts new file mode 100644 index 000000000..79e997eb7 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/client.ts @@ -0,0 +1,167 @@ +import type { Client, Config, RequestOptions } from './types'; +import { + buildUrl, + createConfig, + createInterceptors, + getParseAs, + mergeConfigs, + mergeHeaders, + setAuthParams, +} from './utils'; + +type ReqInit = Omit & { + body?: any; + headers: ReturnType; +}; + +export const createClient = (config: Config = {}): Client => { + let _config = mergeConfigs(createConfig(), config); + + const getConfig = (): Config => ({ ..._config }); + + const setConfig = (config: Config): Config => { + _config = mergeConfigs(_config, config); + return getConfig(); + }; + + const interceptors = createInterceptors< + Request, + Response, + unknown, + RequestOptions + >(); + + // @ts-expect-error + const request: Client['request'] = async (options) => { + const opts = { + ..._config, + ...options, + fetch: options.fetch ?? _config.fetch ?? globalThis.fetch, + headers: mergeHeaders(_config.headers, options.headers), + }; + + if (opts.security) { + await setAuthParams({ + ...opts, + security: opts.security, + }); + } + + if (opts.body && opts.bodySerializer) { + opts.body = opts.bodySerializer(opts.body); + } + + // remove Content-Type header if body is empty to avoid sending invalid requests + if (opts.body === undefined || opts.body === '') { + opts.headers.delete('Content-Type'); + } + + const url = buildUrl(opts); + const requestInit: ReqInit = { + redirect: 'follow', + ...opts, + }; + + let request = new Request(url, requestInit); + + for (const fn of interceptors.request._fns) { + request = await fn(request, opts); + } + + // fetch must be assigned here, otherwise it would throw the error: + // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation + const _fetch = opts.fetch!; + let response = await _fetch(request); + + for (const fn of interceptors.response._fns) { + response = await fn(response, request, opts); + } + + const result = { + request, + response, + }; + + if (response.ok) { + if ( + response.status === 204 || + response.headers.get('Content-Length') === '0' + ) { + return { + data: {}, + ...result, + }; + } + + const parseAs = + (opts.parseAs === 'auto' + ? getParseAs(response.headers.get('Content-Type')) + : opts.parseAs) ?? 'json'; + + if (parseAs === 'stream') { + return { + data: response.body, + ...result, + }; + } + + let data = await response[parseAs](); + if (parseAs === 'json') { + if (opts.responseValidator) { + await opts.responseValidator(data); + } + + if (opts.responseTransformer) { + data = await opts.responseTransformer(data); + } + } + + return { + data, + ...result, + }; + } + + let error = await response.text(); + + try { + error = JSON.parse(error); + } catch { + // noop + } + + let finalError = error; + + for (const fn of interceptors.error._fns) { + finalError = (await fn(error, response, request, opts)) as string; + } + + finalError = finalError || ({} as string); + + if (opts.throwOnError) { + throw finalError; + } + + return { + error: finalError, + ...result, + }; + }; + + return { + buildUrl, + connect: (options) => request({ ...options, method: 'CONNECT' }), + delete: (options) => request({ ...options, method: 'DELETE' }), + get: (options) => request({ ...options, method: 'GET' }), + getConfig, + head: (options) => request({ ...options, method: 'HEAD' }), + interceptors, + options: (options) => request({ ...options, method: 'OPTIONS' }), + patch: (options) => request({ ...options, method: 'PATCH' }), + post: (options) => request({ ...options, method: 'POST' }), + put: (options) => request({ ...options, method: 'PUT' }), + request, + setConfig, + trace: (options) => request({ ...options, method: 'TRACE' }), + }; +}; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/index.ts new file mode 100644 index 000000000..d871b459b --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/index.ts @@ -0,0 +1,19 @@ +export { createClient } from './client'; +export type { + Client, + ClientOptions, + Config, + CreateClientConfig, + Options, + OptionsLegacyParser, + RequestOptions, + RequestResult, + TDataShape, +} from './types'; +export { createConfig } from './utils'; +export type { Auth, QuerySerializerOptions } from '@hey-api/client-core'; +export { + formDataBodySerializer, + jsonBodySerializer, + urlSearchParamsBodySerializer, +} from '@hey-api/client-core'; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/plugin.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/plugin.ts new file mode 100644 index 000000000..87823d645 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/plugin.ts @@ -0,0 +1,28 @@ +import { + type Client, + clientDefaultConfig, + clientPluginHandler, + type Plugin, +} from '@hey-api/openapi-ts'; + +export interface Config extends Client.Config { + /** + * Plugin name. Must be unique. + */ + name: string; +} + +export const defaultConfig: Plugin.Config = { + ...clientDefaultConfig, + _handler: clientPluginHandler, + _handlerLegacy: () => {}, + name: __filename, +}; + +/** + * Type helper for `my-client` plugin, returns {@link Plugin.Config} object + */ +export const myClientPlugin: Plugin.DefineConfig = (config) => ({ + ...defaultConfig, + ...config, +}); diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/types.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/types.ts new file mode 100644 index 000000000..ae688bcf2 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/types.ts @@ -0,0 +1,159 @@ +import type { + Auth, + Client as CoreClient, + Config as CoreConfig, +} from '@hey-api/client-core'; + +import type { Middleware } from './utils'; + +export interface Config + extends Omit, + CoreConfig { + /** + * Base URL for all requests made by this client. + */ + baseUrl?: T['baseUrl']; + /** + * Fetch API implementation. You can use this option to provide a custom + * fetch instance. + * + * @default globalThis.fetch + */ + fetch?: (request: Request) => ReturnType; + /** + * Return the response data parsed in a specified format. By default, `auto` + * will infer the appropriate method from the `Content-Type` response header. + * You can override this behavior with any of the {@link Body} methods. + * Select `stream` if you don't want to parse response data at all. + * + * @default 'auto' + */ + parseAs?: Exclude | 'auto' | 'stream'; + /** + * Throw an error instead of returning it in the response? + * + * @default false + */ + throwOnError?: T['throwOnError']; +} + +export interface RequestOptions< + ThrowOnError extends boolean = boolean, + Url extends string = string, +> extends Config<{ + throwOnError: ThrowOnError; + }> { + /** + * Any body that you want to add to your request. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} + */ + body?: unknown; + path?: Record; + query?: Record; + /** + * Security mechanism(s) to use for the request. + */ + security?: ReadonlyArray; + url: Url; +} + +export type RequestResult< + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = boolean, +> = ThrowOnError extends true + ? Promise<{ + data: TData; + request: Request; + response: Response; + }> + : Promise< + ( + | { data: TData; error: undefined } + | { data: undefined; error: TError } + ) & { + request: Request; + response: Response; + } + >; + +export interface ClientOptions { + baseUrl?: string; + throwOnError?: boolean; +} + +type MethodFn = < + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = false, +>( + options: Omit, 'method'>, +) => RequestResult; + +type RequestFn = < + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = false, +>( + options: Omit, 'method'> & + Pick>, 'method'>, +) => RequestResult; + +type BuildUrlFn = < + TData extends { + body?: unknown; + path?: Record; + query?: Record; + url: string; + }, +>( + options: Pick & Options, +) => string; + +export type Client = CoreClient & { + interceptors: Middleware; +}; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = ( + override?: Config, +) => Config & T>; + +export interface TDataShape { + body?: unknown; + headers?: unknown; + path?: unknown; + query?: unknown; + url: string; +} + +type OmitKeys = Pick>; + +export type Options< + TData extends TDataShape = TDataShape, + ThrowOnError extends boolean = boolean, +> = OmitKeys, 'body' | 'path' | 'query' | 'url'> & + Omit; + +export type OptionsLegacyParser< + TData = unknown, + ThrowOnError extends boolean = boolean, +> = TData extends { body?: any } + ? TData extends { headers?: any } + ? OmitKeys, 'body' | 'headers' | 'url'> & TData + : OmitKeys, 'body' | 'url'> & + TData & + Pick, 'headers'> + : TData extends { headers?: any } + ? OmitKeys, 'headers' | 'url'> & + TData & + Pick, 'body'> + : OmitKeys, 'url'> & TData; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/utils.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/utils.ts new file mode 100644 index 000000000..eb145e4d0 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/utils.ts @@ -0,0 +1,406 @@ +import type { + QuerySerializer, + QuerySerializerOptions, +} from '@hey-api/client-core'; +import { + getAuthToken, + jsonBodySerializer, + serializeArrayParam, + serializeObjectParam, + serializePrimitiveParam, +} from '@hey-api/client-core'; + +import type { Client, ClientOptions, Config, RequestOptions } from './types'; + +interface PathSerializer { + path: Record; + url: string; +} + +const PATH_PARAM_RE = /\{[^{}]+\}/g; + +type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; +type MatrixStyle = 'label' | 'matrix' | 'simple'; +type ArraySeparatorStyle = ArrayStyle | MatrixStyle; + +const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => { + let url = _url; + const matches = _url.match(PATH_PARAM_RE); + if (matches) { + for (const match of matches) { + let explode = false; + let name = match.substring(1, match.length - 1); + let style: ArraySeparatorStyle = 'simple'; + + if (name.endsWith('*')) { + explode = true; + name = name.substring(0, name.length - 1); + } + + if (name.startsWith('.')) { + name = name.substring(1); + style = 'label'; + } else if (name.startsWith(';')) { + name = name.substring(1); + style = 'matrix'; + } + + const value = path[name]; + + if (value === undefined || value === null) { + continue; + } + + if (Array.isArray(value)) { + url = url.replace( + match, + serializeArrayParam({ explode, name, style, value }), + ); + continue; + } + + if (typeof value === 'object') { + url = url.replace( + match, + serializeObjectParam({ + explode, + name, + style, + value: value as Record, + }), + ); + continue; + } + + if (style === 'matrix') { + url = url.replace( + match, + `;${serializePrimitiveParam({ + name, + value: value as string, + })}`, + ); + continue; + } + + const replaceValue = encodeURIComponent( + style === 'label' ? `.${value as string}` : (value as string), + ); + url = url.replace(match, replaceValue); + } + } + return url; +}; + +export const createQuerySerializer = ({ + allowReserved, + array, + object, +}: QuerySerializerOptions = {}) => { + const querySerializer = (queryParams: T) => { + let search: string[] = []; + if (queryParams && typeof queryParams === 'object') { + for (const name in queryParams) { + const value = queryParams[name]; + + if (value === undefined || value === null) { + continue; + } + + if (Array.isArray(value)) { + search = [ + ...search, + serializeArrayParam({ + allowReserved, + explode: true, + name, + style: 'form', + value, + ...array, + }), + ]; + continue; + } + + if (typeof value === 'object') { + search = [ + ...search, + serializeObjectParam({ + allowReserved, + explode: true, + name, + style: 'deepObject', + value: value as Record, + ...object, + }), + ]; + continue; + } + + search = [ + ...search, + serializePrimitiveParam({ + allowReserved, + name, + value: value as string, + }), + ]; + } + } + return search.join('&'); + }; + return querySerializer; +}; + +/** + * Infers parseAs value from provided Content-Type header. + */ +export const getParseAs = ( + contentType: string | null, +): Exclude => { + if (!contentType) { + // If no Content-Type header is provided, the best we can do is return the raw response body, + // which is effectively the same as the 'stream' option. + return 'stream'; + } + + const cleanContent = contentType.split(';')[0]?.trim(); + + if (!cleanContent) { + return; + } + + if ( + cleanContent.startsWith('application/json') || + cleanContent.endsWith('+json') + ) { + return 'json'; + } + + if (cleanContent === 'multipart/form-data') { + return 'formData'; + } + + if ( + ['application/', 'audio/', 'image/', 'video/'].some((type) => + cleanContent.startsWith(type), + ) + ) { + return 'blob'; + } + + if (cleanContent.startsWith('text/')) { + return 'text'; + } +}; + +export const setAuthParams = async ({ + security, + ...options +}: Pick, 'security'> & + Pick & { + headers: Headers; + }) => { + for (const auth of security) { + const token = await getAuthToken(auth, options.auth); + + if (!token) { + continue; + } + + const name = auth.name ?? 'Authorization'; + + switch (auth.in) { + case 'query': + if (!options.query) { + options.query = {}; + } + options.query[name] = token; + break; + case 'cookie': + options.headers.append('Cookie', `${name}=${token}`); + break; + case 'header': + default: + options.headers.set(name, token); + break; + } + + return; + } +}; + +export const buildUrl: Client['buildUrl'] = (options) => { + const url = getUrl({ + baseUrl: options.baseUrl as string, + path: options.path, + query: options.query, + querySerializer: + typeof options.querySerializer === 'function' + ? options.querySerializer + : createQuerySerializer(options.querySerializer), + url: options.url, + }); + return url; +}; + +export const getUrl = ({ + baseUrl, + path, + query, + querySerializer, + url: _url, +}: { + baseUrl?: string; + path?: Record; + query?: Record; + querySerializer: QuerySerializer; + url: string; +}) => { + const pathUrl = _url.startsWith('/') ? _url : `/${_url}`; + let url = (baseUrl ?? '') + pathUrl; + if (path) { + url = defaultPathSerializer({ path, url }); + } + let search = query ? querySerializer(query) : ''; + if (search.startsWith('?')) { + search = search.substring(1); + } + if (search) { + url += `?${search}`; + } + return url; +}; + +export const mergeConfigs = (a: Config, b: Config): Config => { + const config = { ...a, ...b }; + if (config.baseUrl?.endsWith('/')) { + config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1); + } + config.headers = mergeHeaders(a.headers, b.headers); + return config; +}; + +export const mergeHeaders = ( + ...headers: Array['headers'] | undefined> +): Headers => { + const mergedHeaders = new Headers(); + for (const header of headers) { + if (!header || typeof header !== 'object') { + continue; + } + + const iterator = + header instanceof Headers ? header.entries() : Object.entries(header); + + for (const [key, value] of iterator) { + if (value === null) { + mergedHeaders.delete(key); + } else if (Array.isArray(value)) { + for (const v of value) { + mergedHeaders.append(key, v as string); + } + } else if (value !== undefined) { + // assume object headers are meant to be JSON stringified, i.e. their + // content value in OpenAPI specification is 'application/json' + mergedHeaders.set( + key, + typeof value === 'object' ? JSON.stringify(value) : (value as string), + ); + } + } + } + return mergedHeaders; +}; + +type ErrInterceptor = ( + error: Err, + response: Res, + request: Req, + options: Options, +) => Err | Promise; + +type ReqInterceptor = ( + request: Req, + options: Options, +) => Req | Promise; + +type ResInterceptor = ( + response: Res, + request: Req, + options: Options, +) => Res | Promise; + +class Interceptors { + _fns: Interceptor[]; + + constructor() { + this._fns = []; + } + + clear() { + this._fns = []; + } + + exists(fn: Interceptor) { + return this._fns.indexOf(fn) !== -1; + } + + eject(fn: Interceptor) { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Interceptor) { + this._fns = [...this._fns, fn]; + } +} + +// `createInterceptors()` response, meant for external use as it does not +// expose internals +export interface Middleware { + error: Pick< + Interceptors>, + 'eject' | 'use' + >; + request: Pick>, 'eject' | 'use'>; + response: Pick< + Interceptors>, + 'eject' | 'use' + >; +} + +// do not add `Middleware` as return type so we can use _fns internally +export const createInterceptors = () => ({ + error: new Interceptors>(), + request: new Interceptors>(), + response: new Interceptors>(), +}); + +const defaultQuerySerializer = createQuerySerializer({ + allowReserved: false, + array: { + explode: true, + style: 'form', + }, + object: { + explode: true, + style: 'deepObject', + }, +}); + +const defaultHeaders = { + 'Content-Type': 'application/json', +}; + +export const createConfig = ( + override: Config & T> = {}, +): Config & T> => ({ + ...jsonBodySerializer, + headers: defaultHeaders, + parseAs: 'auto', + querySerializer: defaultQuerySerializer, + ...override, +}); diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/sdk.gen.ts new file mode 100644 index 000000000..5cc6beedc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from './client'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/client.gen.ts new file mode 100644 index 000000000..2dae0db79 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '../../../../../custom/client'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/sdk.gen.ts new file mode 100644 index 000000000..ed8ab824b --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '../../../../../custom/client'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/client.gen.ts new file mode 100644 index 000000000..2dae0db79 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '../../../../../custom/client'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/sdk.gen.ts new file mode 100644 index 000000000..ed8ab824b --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '../../../../../custom/client'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/client.gen.ts new file mode 100644 index 000000000..2dae0db79 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '../../../../../custom/client'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/sdk.gen.ts new file mode 100644 index 000000000..70883547b --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/sdk.gen.ts @@ -0,0 +1,408 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '../../../../../custom/client'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options: Options) => { + return options.client.patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options: Options) => { + return options.client.delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options: Options) => { + return options.client.head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options: Options) => { + return options.client.options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options: Options) => { + return options.client.patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return options.client.delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options: Options) => { + return options.client.post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options: Options) => { + return options.client.delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return options.client.post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options: Options) => { + return options.client.get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options: Options) => { + return options.client.post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return options.client.put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return options.client.post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return options.client.put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/components-request-bodies/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/components-request-bodies/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/components-request-bodies/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/components-request-bodies/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/components-request-bodies/types.gen.ts new file mode 100644 index 000000000..769d4ee8c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/components-request-bodies/types.gen.ts @@ -0,0 +1,29 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Foo + */ +export type Foo = { + page?: number; +}; + +export type PostFooData = { + /** + * Foo + */ + body: Foo; + path?: never; + query?: never; + url: '/foo'; +}; + +export type PostFooResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/const/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/const/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/const/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/const/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/const/types.gen.ts new file mode 100644 index 000000000..cae8a70b3 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/const/types.gen.ts @@ -0,0 +1,21 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: 'First line.\n\nSecond line.\n\nPS: I love you.'; +}; + +export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/content-binary/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/content-binary/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/content-binary/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/content-binary/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/content-binary/types.gen.ts new file mode 100644 index 000000000..e8a09c992 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/content-binary/types.gen.ts @@ -0,0 +1,31 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + 200: string; +}; + +export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; + +export type GetBarData = { + body?: never; + path?: never; + query?: never; + url: '/bar'; +}; + +export type GetBarResponses = { + 200: Blob | File; +}; + +export type GetBarResponse = GetBarResponses[keyof GetBarResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-all-of/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-all-of/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-all-of/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-all-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-all-of/types.gen.ts new file mode 100644 index 000000000..d74f66a4a --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-all-of/types.gen.ts @@ -0,0 +1,49 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + id: string; +}; + +export type Bar = Foo & { + id: 'Bar'; +} & { + bar?: string; +}; + +export type Baz = Foo & { + id: 'Baz'; +} & { + baz?: string; +}; + +export type Qux = Foo & { + id: 'Qux'; +} & { + qux?: boolean; +}; + +export type FooMapped = { + id: string; +}; + +export type BarMapped = FooMapped & { + id: 'bar'; +} & { + bar?: string; +}; + +export type BazMapped = FooMapped & { + id: 'baz'; +} & { + baz?: string; +}; + +export type QuxMapped = FooMapped & { + id: 'QuxMapped'; +} & { + qux?: boolean; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-any-of/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-any-of/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-any-of/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-any-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-any-of/types.gen.ts new file mode 100644 index 000000000..cdd9c641f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-any-of/types.gen.ts @@ -0,0 +1,28 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = ({ + type?: 'Bar'; +} & Bar) | ({ + type?: 'Baz'; +} & Baz); + +export type Baz = Qux; + +export type Bar = Qux; + +export type Qux = { + id: string; + type: Quux; +}; + +export type Quux = 'Bar' | 'Baz'; + +export type Quuz = ({ + type?: 'bar'; +} & Bar) | ({ + type?: 'baz'; +} & Baz); + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-mapped-many/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-mapped-many/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-mapped-many/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-mapped-many/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-mapped-many/types.gen.ts new file mode 100644 index 000000000..bbbd8dfa9 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-mapped-many/types.gen.ts @@ -0,0 +1,19 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = ({ + foo?: 'one'; +} & Bar) | ({ + foo?: 'three'; +} & Baz); + +export type Bar = { + foo?: 'one' | 'two'; +}; + +export type Baz = { + foo?: 'three'; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-one-of/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-one-of/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-one-of/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-one-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-one-of/types.gen.ts new file mode 100644 index 000000000..cdd9c641f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-one-of/types.gen.ts @@ -0,0 +1,28 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = ({ + type?: 'Bar'; +} & Bar) | ({ + type?: 'Baz'; +} & Baz); + +export type Baz = Qux; + +export type Bar = Qux; + +export type Qux = { + id: string; + type: Quux; +}; + +export type Quux = 'Bar' | 'Baz'; + +export type Quuz = ({ + type?: 'bar'; +} & Bar) | ({ + type?: 'baz'; +} & Baz); + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/duplicate-null/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/duplicate-null/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/duplicate-null/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/duplicate-null/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/duplicate-null/types.gen.ts new file mode 100644 index 000000000..6c58ee588 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/duplicate-null/types.gen.ts @@ -0,0 +1,10 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * should not produce duplicate null + */ +export type WeirdEnum = '' | string | null; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-escape/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-escape/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-escape/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-escape/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-escape/types.gen.ts new file mode 100644 index 000000000..d3fff794b --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-escape/types.gen.ts @@ -0,0 +1,11 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + foo?: "foo'bar" | 'foo"bar'; +}; + +export type Bar = "foo'bar" | 'foo"bar'; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-javascript/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-javascript/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-javascript/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-javascript/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-javascript/types.gen.ts new file mode 100644 index 000000000..bf1c86991 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-javascript/types.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Type = 'foo' | 'bar'; + +export const Type = { + FOO: 'foo', + BAR: 'bar' +} as const; + +export type Foo = { + type?: 'foo' | 'bar'; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript-namespace/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript-namespace/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript-namespace/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript-namespace/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript-namespace/types.gen.ts new file mode 100644 index 000000000..ef7778bd5 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript-namespace/types.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export namespace Foo { + export enum Type { + FOO = 'foo', + BAR = 'bar' + } +} + +export type Foo = { + type?: 'foo' | 'bar'; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript/types.gen.ts new file mode 100644 index 000000000..86b67e018 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript/types.gen.ts @@ -0,0 +1,14 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export enum Type { + FOO = 'foo', + BAR = 'bar' +} + +export type Foo = { + type?: 'foo' | 'bar'; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline/types.gen.ts new file mode 100644 index 000000000..de2459b6b --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline/types.gen.ts @@ -0,0 +1,11 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Type = 'foo' | 'bar'; + +export type Foo = { + type?: 'foo' | 'bar'; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-PascalCase/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-PascalCase/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-PascalCase/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-PascalCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-PascalCase/types.gen.ts new file mode 100644 index 000000000..8c89a55c8 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-PascalCase/types.gen.ts @@ -0,0 +1,48 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _110 = '1-10' | '11-20'; + +export const _110 = { + 110: '1-10', + 1120: '11-20' +} as const; + +export type MyFoo = 'myFoo' | 'myBar'; + +export const MyFoo = { + MyFoo: 'myFoo', + MyBar: 'myBar' +} as const; + +export type MyFoo2 = 'MyFoo' | 'MyBar'; + +export const MyFoo2 = { + MyFoo: 'MyFoo', + MyBar: 'MyBar' +} as const; + +export type Foo = 'foo' | 'bar' | null | '' | true | false; + +export const Foo = { + Foo: 'foo', + Bar: 'bar', + Null: null, + '': '', + True: true, + False: false +} as const; + +export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; + +export const Numbers = { + 100: 100, + 200: 200, + 300: 300, + '-100': -100, + '-200': -200, + '-300': -300 +} as const; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts new file mode 100644 index 000000000..66f2f4dc0 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts @@ -0,0 +1,48 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _110 = '1-10' | '11-20'; + +export const _110 = { + '1_10': '1-10', + '11_20': '11-20' +} as const; + +export type MyFoo = 'myFoo' | 'myBar'; + +export const MyFoo = { + MY_FOO: 'myFoo', + MY_BAR: 'myBar' +} as const; + +export type MyFoo2 = 'MyFoo' | 'MyBar'; + +export const MyFoo2 = { + MY_FOO: 'MyFoo', + MY_BAR: 'MyBar' +} as const; + +export type Foo = 'foo' | 'bar' | null | '' | true | false; + +export const Foo = { + FOO: 'foo', + BAR: 'bar', + NULL: null, + '': '', + TRUE: true, + FALSE: false +} as const; + +export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; + +export const Numbers = { + 100: 100, + 200: 200, + 300: 300, + '-100': -100, + '-200': -200, + '-300': -300 +} as const; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-camelCase/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-camelCase/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-camelCase/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-camelCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-camelCase/types.gen.ts new file mode 100644 index 000000000..7f0f85ab5 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-camelCase/types.gen.ts @@ -0,0 +1,48 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _110 = '1-10' | '11-20'; + +export const _110 = { + 110: '1-10', + 1120: '11-20' +} as const; + +export type MyFoo = 'myFoo' | 'myBar'; + +export const MyFoo = { + myFoo: 'myFoo', + myBar: 'myBar' +} as const; + +export type MyFoo2 = 'MyFoo' | 'MyBar'; + +export const MyFoo2 = { + myFoo: 'MyFoo', + myBar: 'MyBar' +} as const; + +export type Foo = 'foo' | 'bar' | null | '' | true | false; + +export const Foo = { + foo: 'foo', + bar: 'bar', + null: null, + '': '', + true: true, + false: false +} as const; + +export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; + +export const Numbers = { + 100: 100, + 200: 200, + 300: 300, + '-100': -100, + '-200': -200, + '-300': -300 +} as const; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-preserve/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-preserve/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-preserve/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-preserve/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-preserve/types.gen.ts new file mode 100644 index 000000000..2a631eac8 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-preserve/types.gen.ts @@ -0,0 +1,48 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _110 = '1-10' | '11-20'; + +export const _110 = { + '1-10': '1-10', + '11-20': '11-20' +} as const; + +export type MyFoo = 'myFoo' | 'myBar'; + +export const MyFoo = { + myFoo: 'myFoo', + myBar: 'myBar' +} as const; + +export type MyFoo2 = 'MyFoo' | 'MyBar'; + +export const MyFoo2 = { + MyFoo: 'MyFoo', + MyBar: 'MyBar' +} as const; + +export type Foo = 'foo' | 'bar' | null | '' | true | false; + +export const Foo = { + foo: 'foo', + bar: 'bar', + null: null, + '': '', + true: true, + false: false +} as const; + +export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; + +export const Numbers = { + 100: 100, + 200: 200, + 300: 300, + '-100': -100, + '-200': -200, + '-300': -300 +} as const; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-snake_case/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-snake_case/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-snake_case/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-snake_case/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-snake_case/types.gen.ts new file mode 100644 index 000000000..81146d8df --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-snake_case/types.gen.ts @@ -0,0 +1,48 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _110 = '1-10' | '11-20'; + +export const _110 = { + '1_10': '1-10', + '11_20': '11-20' +} as const; + +export type MyFoo = 'myFoo' | 'myBar'; + +export const MyFoo = { + my_foo: 'myFoo', + my_bar: 'myBar' +} as const; + +export type MyFoo2 = 'MyFoo' | 'MyBar'; + +export const MyFoo2 = { + my_foo: 'MyFoo', + my_bar: 'MyBar' +} as const; + +export type Foo = 'foo' | 'bar' | null | '' | true | false; + +export const Foo = { + foo: 'foo', + bar: 'bar', + null: null, + '': '', + true: true, + false: false +} as const; + +export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; + +export const Numbers = { + 100: 100, + 200: 200, + 300: 300, + '-100': -100, + '-200': -200, + '-300': -300 +} as const; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-PascalCase/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-PascalCase/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-PascalCase/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-PascalCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-PascalCase/types.gen.ts new file mode 100644 index 000000000..2f43e6815 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-PascalCase/types.gen.ts @@ -0,0 +1,31 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export enum _110 { + _110 = '1-10', + _1120 = '11-20' +} + +export enum MyFoo { + MyFoo = 'myFoo', + MyBar = 'myBar' +} + +export enum MyFoo2 { + MyFoo = 'MyFoo', + MyBar = 'MyBar' +} + +export type Foo = 'foo' | 'bar' | null | '' | true | false; + +export enum Numbers { + _100 = 100, + _200 = 200, + _300 = 300, + '_-100' = -100, + '_-200' = -200, + '_-300' = -300 +} + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts new file mode 100644 index 000000000..541fd2094 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts @@ -0,0 +1,31 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export enum _110 { + '1_10' = '1-10', + '11_20' = '11-20' +} + +export enum MyFoo { + MY_FOO = 'myFoo', + MY_BAR = 'myBar' +} + +export enum MyFoo2 { + MY_FOO = 'MyFoo', + MY_BAR = 'MyBar' +} + +export type Foo = 'foo' | 'bar' | null | '' | true | false; + +export enum Numbers { + _100 = 100, + _200 = 200, + _300 = 300, + '_-100' = -100, + '_-200' = -200, + '_-300' = -300 +} + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-camelCase/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-camelCase/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-camelCase/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-camelCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-camelCase/types.gen.ts new file mode 100644 index 000000000..49796afc5 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-camelCase/types.gen.ts @@ -0,0 +1,31 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export enum _110 { + _110 = '1-10', + _1120 = '11-20' +} + +export enum MyFoo { + myFoo = 'myFoo', + myBar = 'myBar' +} + +export enum MyFoo2 { + myFoo = 'MyFoo', + myBar = 'MyBar' +} + +export type Foo = 'foo' | 'bar' | null | '' | true | false; + +export enum Numbers { + _100 = 100, + _200 = 200, + _300 = 300, + '_-100' = -100, + '_-200' = -200, + '_-300' = -300 +} + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-preserve/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-preserve/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-preserve/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-preserve/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-preserve/types.gen.ts new file mode 100644 index 000000000..9ee13c15d --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-preserve/types.gen.ts @@ -0,0 +1,31 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export enum _110 { + '1-10' = '1-10', + '11-20' = '11-20' +} + +export enum MyFoo { + myFoo = 'myFoo', + myBar = 'myBar' +} + +export enum MyFoo2 { + MyFoo = 'MyFoo', + MyBar = 'MyBar' +} + +export type Foo = 'foo' | 'bar' | null | '' | true | false; + +export enum Numbers { + _100 = 100, + _200 = 200, + _300 = 300, + '_-100' = -100, + '_-200' = -200, + '_-300' = -300 +} + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-snake_case/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-snake_case/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-snake_case/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-snake_case/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-snake_case/types.gen.ts new file mode 100644 index 000000000..3a07bbbc6 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-snake_case/types.gen.ts @@ -0,0 +1,31 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export enum _110 { + '1_10' = '1-10', + '11_20' = '11-20' +} + +export enum MyFoo { + my_foo = 'myFoo', + my_bar = 'myBar' +} + +export enum MyFoo2 { + my_foo = 'MyFoo', + my_bar = 'MyBar' +} + +export type Foo = 'foo' | 'bar' | null | '' | true | false; + +export enum Numbers { + _100 = 100, + _200 = 200, + _300 = 300, + '_-100' = -100, + '_-200' = -200, + '_-300' = -300 +} + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values/types.gen.ts new file mode 100644 index 000000000..334fc7e35 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values/types.gen.ts @@ -0,0 +1,15 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _110 = '1-10' | '11-20'; + +export type MyFoo = 'myFoo' | 'myBar'; + +export type MyFoo2 = 'MyFoo' | 'MyBar'; + +export type Foo = 'foo' | 'bar' | null | '' | true | false; + +export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-null/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-null/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-null/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-null/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-null/types.gen.ts new file mode 100644 index 000000000..48d0f83a2 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-null/types.gen.ts @@ -0,0 +1,11 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = 'foo' | 'bar' | null; + +export type Bar = 'foo' | 'bar'; + +export type Baz = 'foo' | 'bar'; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-null/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-null/zod.gen.ts new file mode 100644 index 000000000..ef3e1daa7 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/enum-null/zod.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { z } from 'zod'; + +export const zFoo = z.enum([ + 'foo', + 'bar' +]); + +export const zBar = z.enum([ + 'foo', + 'bar' +]); + +export const zBaz = z.enum([ + 'foo', + 'bar' +]); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/exclude-deprecated/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/exclude-deprecated/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/exclude-deprecated/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/exclude-deprecated/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/exclude-deprecated/types.gen.ts new file mode 100644 index 000000000..f09b2f30d --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/exclude-deprecated/types.gen.ts @@ -0,0 +1,21 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = string; + +export type PostFooData = { + body: Foo; + path?: never; + query?: never; + url: '/foo'; +}; + +export type PostFooResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/@tanstack/react-query.gen.ts new file mode 100644 index 000000000..d2d72e484 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/@tanstack/react-query.gen.ts @@ -0,0 +1,99 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, create } from '../sdk.gen'; +import { queryOptions, type UseMutationOptions, type DefaultError } from '@tanstack/react-query'; +import type { CreateData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const createQueryKey2 = (options?: Options) => createQueryKey('create', options); + +export const createOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await create({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: createQueryKey2(options) + }); +}; + +export const createMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await create({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const createQueryKey2 = (options?: Options) => createQueryKey('create', options); + +export const createOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await create({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: createQueryKey2(options) + }); +}; + +export const createMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await create({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/sdk.gen.ts new file mode 100644 index 000000000..8f8c0777a --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/sdk.gen.ts @@ -0,0 +1,40 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { CreateData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const create = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/foo', + ...options + }); +}; + +export const create = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/foo', + ...options + }); +}; + +export const create = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/foo', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/types.gen.ts new file mode 100644 index 000000000..38b0bfb2b --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/types.gen.ts @@ -0,0 +1,47 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type CreateData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type CreateResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type CreateData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type CreateResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type CreateData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type CreateResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-all-of/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-all-of/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-all-of/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-all-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-all-of/types.gen.ts new file mode 100644 index 000000000..05d02f8ae --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-all-of/types.gen.ts @@ -0,0 +1,15 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + bar: string; +} & { + baz: string; +} & { + foo: string; + bar?: string; + baz?: string; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-any-of/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-any-of/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-any-of/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-any-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-any-of/types.gen.ts new file mode 100644 index 000000000..f50aef2b5 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-any-of/types.gen.ts @@ -0,0 +1,15 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = ({ + bar: string; +} | { + baz: string; +}) & { + foo: string; + bar?: string; + baz?: string; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-one-of/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-one-of/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-one-of/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-one-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-one-of/types.gen.ts new file mode 100644 index 000000000..f50aef2b5 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-one-of/types.gen.ts @@ -0,0 +1,15 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = ({ + bar: string; +} | { + baz: string; +}) & { + foo: string; + bar?: string; + baz?: string; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/operation-204/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/operation-204/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/operation-204/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/operation-204/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/operation-204/types.gen.ts new file mode 100644 index 000000000..0250e75aa --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/operation-204/types.gen.ts @@ -0,0 +1,25 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type PostFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type PostFooResponses = { + /** + * OK + */ + 200: string; + /** + * Created + */ + 204: void; +}; + +export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/@tanstack/react-query.gen.ts new file mode 100644 index 000000000..3dc6cc795 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/@tanstack/react-query.gen.ts @@ -0,0 +1,123 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, postFoo } from '../sdk.gen'; +import { queryOptions, infiniteQueryOptions, type InfiniteData, type DefaultError, type UseMutationOptions } from '@tanstack/react-query'; +import type { PostFooData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const postFooQueryKey = (options: Options) => createQueryKey('postFoo', options); + +export const postFooOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postFoo({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postFooQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const postFooInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postFoo', options, true); + +export const postFooInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await postFoo({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postFooInfiniteQueryKey(options) + }); +}; + +export const postFooMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/sdk.gen.ts new file mode 100644 index 000000000..29f6cea10 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/sdk.gen.ts @@ -0,0 +1,30 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { PostFooData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const postFoo = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/foo', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/types.gen.ts new file mode 100644 index 000000000..deb98bc46 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/types.gen.ts @@ -0,0 +1,23 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + page?: number | null; +}; + +export type PostFooData = { + body: Foo; + path?: never; + query?: never; + url: '/foo'; +}; + +export type PostFooResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/client.gen.ts new file mode 100644 index 000000000..c4dedd629 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/sdk.gen.ts new file mode 100644 index 000000000..fd567117c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/sdk.gen.ts @@ -0,0 +1,32 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-axios'; +import type { PostFooData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const postFoo = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/foo', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/types.gen.ts new file mode 100644 index 000000000..e1ed1030b --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/types.gen.ts @@ -0,0 +1,21 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type PostFooData = { + body?: never; + path?: never; + query?: { + foo?: Array; + }; + url: '/foo'; +}; + +export type PostFooResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ClientOptions = { + baseURL: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/sdk.gen.ts new file mode 100644 index 000000000..b34dd5ddb --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/sdk.gen.ts @@ -0,0 +1,32 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { PostFooData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const postFoo = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + querySerializer: { + array: { + explode: false, + style: 'form' + } + }, + url: '/foo', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/types.gen.ts new file mode 100644 index 000000000..d69993ad2 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/types.gen.ts @@ -0,0 +1,21 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type PostFooData = { + body?: never; + path?: never; + query?: { + foo?: Array; + }; + url: '/foo'; +}; + +export type PostFooResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-tuple/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-tuple/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-tuple/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-tuple/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-tuple/types.gen.ts new file mode 100644 index 000000000..a37b6958b --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-tuple/types.gen.ts @@ -0,0 +1,26 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type PostFooData = { + body?: never; + path?: never; + query?: { + tuple?: [ + number, + number, + number, + number + ]; + }; + url: '/foo'; +}; + +export type PostFooResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/schemas/default/schemas.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/schemas/default/schemas.gen.ts new file mode 100644 index 000000000..5e7432861 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/schemas/default/schemas.gen.ts @@ -0,0 +1,1981 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export const _400Schema = { + description: 'Model with number-only name', + type: 'string' +} as const; + +export const camelCaseCommentWithBreaksSchema = { + description: `Testing multiline comments in string: First line +Second line + +Fourth line`, + type: 'integer' +} as const; + +export const CommentWithBreaksSchema = { + description: `Testing multiline comments in string: First line +Second line + +Fourth line`, + type: 'integer' +} as const; + +export const CommentWithBackticksSchema = { + description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work', + type: 'integer' +} as const; + +export const CommentWithBackticksAndQuotesSchema = { + description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`, + type: 'integer' +} as const; + +export const CommentWithSlashesSchema = { + description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work', + type: 'integer' +} as const; + +export const CommentWithExpressionPlaceholdersSchema = { + description: 'Testing expression placeholders in string: ${expression} should work', + type: 'integer' +} as const; + +export const CommentWithQuotesSchema = { + description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`, + type: 'integer' +} as const; + +export const CommentWithReservedCharactersSchema = { + description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work', + type: 'integer' +} as const; + +export const SimpleIntegerSchema = { + description: 'This is a simple number', + type: 'integer' +} as const; + +export const SimpleBooleanSchema = { + description: 'This is a simple boolean', + type: 'boolean' +} as const; + +export const SimpleStringSchema = { + description: 'This is a simple string', + type: 'string' +} as const; + +export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = { + description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)', + type: 'string' +} as const; + +export const SimpleFileSchema = { + description: 'This is a simple file', + format: 'binary', + type: 'string' +} as const; + +export const SimpleReferenceSchema = { + description: 'This is a simple reference', + '$ref': '#/components/schemas/ModelWithString' +} as const; + +export const SimpleStringWithPatternSchema = { + description: 'This is a simple string', + maxLength: 64, + pattern: '^[a-zA-Z0-9_]*$', + type: ['string', 'null'] +} as const; + +export const EnumWithStringsSchema = { + description: 'This is a simple enum with strings', + enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串'] +} as const; + +export const EnumWithReplacedCharactersSchema = { + enum: ["'Single Quote'", '"Double Quotes"', 'øæåôöØÆÅÔÖ字符串', 3.1, ''], + type: 'string' +} as const; + +export const EnumWithNumbersSchema = { + description: 'This is a simple enum with numbers', + enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3], + default: 200 +} as const; + +export const EnumFromDescriptionSchema = { + description: 'Success=1,Warning=2,Error=3', + type: 'number' +} as const; + +export const EnumWithExtensionsSchema = { + description: 'This is a simple enum with numbers', + enum: [200, 400, 500], + 'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'], + 'x-enum-descriptions': ['Used when the status of something is successful', 'Used when the status of something has a warning', 'Used when the status of something has an error'] +} as const; + +export const EnumWithXEnumNamesSchema = { + enum: [0, 1, 2], + 'x-enumNames': ['zero', 'one', 'two'] +} as const; + +export const ArrayWithNumbersSchema = { + description: 'This is a simple array with numbers', + type: 'array', + items: { + type: 'integer' + } +} as const; + +export const ArrayWithBooleansSchema = { + description: 'This is a simple array with booleans', + type: 'array', + items: { + type: 'boolean' + } +} as const; + +export const ArrayWithStringsSchema = { + description: 'This is a simple array with strings', + type: 'array', + items: { + type: 'string' + }, + default: ['test'] +} as const; + +export const ArrayWithReferencesSchema = { + description: 'This is a simple array with references', + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithString' + } +} as const; + +export const ArrayWithArraySchema = { + description: 'This is a simple array containing an array', + type: 'array', + items: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithString' + } + } +} as const; + +export const ArrayWithPropertiesSchema = { + description: 'This is a simple array with properties', + type: 'array', + items: { + type: 'object', + properties: { + '16x16': { + '$ref': '#/components/schemas/camelCaseCommentWithBreaks' + }, + bar: { + type: 'string' + } + } + } +} as const; + +export const ArrayWithAnyOfPropertiesSchema = { + description: 'This is a simple array with any of properties', + type: 'array', + items: { + anyOf: [ + { + type: 'object', + properties: { + foo: { + type: 'string', + default: 'test' + } + } + }, + { + type: 'object', + properties: { + bar: { + type: 'string' + } + } + } + ] + } +} as const; + +export const AnyOfAnyAndNullSchema = { + type: 'object', + properties: { + data: { + anyOf: [ + {}, + { + type: 'null' + } + ] + } + } +} as const; + +export const AnyOfArraysSchema = { + description: 'This is a simple array with any of properties', + type: 'object', + properties: { + results: { + items: { + anyOf: [ + { + type: 'object', + properties: { + foo: { + type: 'string' + } + } + }, + { + type: 'object', + properties: { + bar: { + type: 'string' + } + } + } + ] + }, + type: 'array' + } + } +} as const; + +export const DictionaryWithStringSchema = { + description: 'This is a string dictionary', + type: 'object', + additionalProperties: { + type: 'string' + } +} as const; + +export const DictionaryWithPropertiesAndAdditionalPropertiesSchema = { + type: 'object', + properties: { + foo: { + type: 'number' + }, + bar: { + type: 'boolean' + } + }, + additionalProperties: { + type: 'string' + } +} as const; + +export const DictionaryWithReferenceSchema = { + description: 'This is a string reference', + type: 'object', + additionalProperties: { + '$ref': '#/components/schemas/ModelWithString' + } +} as const; + +export const DictionaryWithArraySchema = { + description: 'This is a complex dictionary', + type: 'object', + additionalProperties: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithString' + } + } +} as const; + +export const DictionaryWithDictionarySchema = { + description: 'This is a string dictionary', + type: 'object', + additionalProperties: { + type: 'object', + additionalProperties: { + type: 'string' + } + } +} as const; + +export const DictionaryWithPropertiesSchema = { + description: 'This is a complex dictionary', + type: 'object', + additionalProperties: { + type: 'object', + properties: { + foo: { + type: 'string' + }, + bar: { + type: 'string' + } + } + } +} as const; + +export const ModelWithIntegerSchema = { + description: 'This is a model with one number property', + type: 'object', + properties: { + prop: { + description: 'This is a simple number property', + type: 'integer' + } + } +} as const; + +export const ModelWithBooleanSchema = { + description: 'This is a model with one boolean property', + type: 'object', + properties: { + prop: { + description: 'This is a simple boolean property', + type: 'boolean' + } + } +} as const; + +export const ModelWithStringSchema = { + description: 'This is a model with one string property', + type: 'object', + properties: { + prop: { + description: 'This is a simple string property', + type: 'string' + } + } +} as const; + +export const ModelWithStringErrorSchema = { + description: 'This is a model with one string property', + type: 'object', + properties: { + prop: { + description: 'This is a simple string property', + type: 'string' + } + } +} as const; + +export const Model_From_ZendeskSchema = { + description: `\`Comment\` or \`VoiceComment\`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets)`, + type: 'string' +} as const; + +export const ModelWithNullableStringSchema = { + description: 'This is a model with one string property', + type: 'object', + required: ['nullableRequiredProp1', 'nullableRequiredProp2'], + properties: { + nullableProp1: { + description: 'This is a simple string property', + type: ['string', 'null'] + }, + nullableRequiredProp1: { + description: 'This is a simple string property', + type: ['string', 'null'] + }, + nullableProp2: { + description: 'This is a simple string property', + type: ['string', 'null'] + }, + nullableRequiredProp2: { + description: 'This is a simple string property', + type: ['string', 'null'] + }, + 'foo_bar-enum': { + description: 'This is a simple enum with strings', + enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + } + } +} as const; + +export const ModelWithEnumSchema = { + description: 'This is a model with one enum', + type: 'object', + properties: { + 'foo_bar-enum': { + description: 'This is a simple enum with strings', + enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + }, + statusCode: { + description: 'These are the HTTP error code enums', + enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar'] + }, + bool: { + description: 'Simple boolean enum', + type: 'boolean', + enum: [true] + } + } +} as const; + +export const ModelWithEnumWithHyphenSchema = { + description: 'This is a model with one enum with escaped name', + type: 'object', + properties: { + 'foo-bar-baz-qux': { + type: 'string', + enum: ['3.0'], + title: 'Foo-Bar-Baz-Qux', + default: '3.0' + } + } +} as const; + +export const ModelWithEnumFromDescriptionSchema = { + description: 'This is a model with one enum', + type: 'object', + properties: { + test: { + type: 'integer', + description: 'Success=1,Warning=2,Error=3' + } + } +} as const; + +export const ModelWithNestedEnumsSchema = { + description: 'This is a model with nested enums', + type: 'object', + properties: { + dictionaryWithEnum: { + type: 'object', + additionalProperties: { + enum: ['Success', 'Warning', 'Error'] + } + }, + dictionaryWithEnumFromDescription: { + type: 'object', + additionalProperties: { + type: 'integer', + description: 'Success=1,Warning=2,Error=3' + } + }, + arrayWithEnum: { + type: 'array', + items: { + enum: ['Success', 'Warning', 'Error'] + } + }, + arrayWithDescription: { + type: 'array', + items: { + type: 'integer', + description: 'Success=1,Warning=2,Error=3' + } + }, + 'foo_bar-enum': { + description: 'This is a simple enum with strings', + enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + } + } +} as const; + +export const ModelWithReferenceSchema = { + description: 'This is a model with one property containing a reference', + type: 'object', + properties: { + prop: { + '$ref': '#/components/schemas/ModelWithProperties' + } + } +} as const; + +export const ModelWithArrayReadOnlyAndWriteOnlySchema = { + description: 'This is a model with one property containing an array', + type: 'object', + properties: { + prop: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnly' + } + }, + propWithFile: { + type: 'array', + items: { + format: 'binary', + type: 'string' + } + }, + propWithNumber: { + type: 'array', + items: { + type: 'number' + } + } + } +} as const; + +export const ModelWithArraySchema = { + description: 'This is a model with one property containing an array', + type: 'object', + properties: { + prop: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithString' + } + }, + propWithFile: { + type: 'array', + items: { + format: 'binary', + type: 'string' + } + }, + propWithNumber: { + type: 'array', + items: { + type: 'number' + } + } + } +} as const; + +export const ModelWithDictionarySchema = { + description: 'This is a model with one property containing a dictionary', + type: 'object', + properties: { + prop: { + type: 'object', + additionalProperties: { + type: 'string' + } + } + } +} as const; + +export const DeprecatedModelSchema = { + deprecated: true, + description: 'This is a deprecated model with a deprecated property', + type: 'object', + properties: { + prop: { + deprecated: true, + description: 'This is a deprecated property', + type: 'string' + } + } +} as const; + +export const ModelWithCircularReferenceSchema = { + description: 'This is a model with one property containing a circular reference', + type: 'object', + properties: { + prop: { + '$ref': '#/components/schemas/ModelWithCircularReference' + } + } +} as const; + +export const CompositionWithOneOfSchema = { + description: "This is a model with one property with a 'one of' relationship", + type: 'object', + properties: { + propA: { + type: 'object', + oneOf: [ + { + '$ref': '#/components/schemas/ModelWithString' + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const CompositionWithOneOfAnonymousSchema = { + description: "This is a model with one property with a 'one of' relationship where the options are not $ref", + type: 'object', + properties: { + propA: { + type: 'object', + oneOf: [ + { + description: 'Anonymous object type', + type: 'object', + properties: { + propA: { + type: 'string' + } + } + }, + { + description: 'Anonymous string type', + type: 'string' + }, + { + description: 'Anonymous integer type', + type: 'integer' + } + ] + } + } +} as const; + +export const ModelCircleSchema = { + description: 'Circle', + type: 'object', + required: ['kind'], + properties: { + kind: { + type: 'string' + }, + radius: { + type: 'number' + } + } +} as const; + +export const ModelSquareSchema = { + description: 'Square', + type: 'object', + required: ['kind'], + properties: { + kind: { + type: 'string' + }, + sideLength: { + type: 'number' + } + } +} as const; + +export const CompositionWithOneOfDiscriminatorSchema = { + description: "This is a model with one property with a 'one of' relationship where the options are not $ref", + type: 'object', + oneOf: [ + { + '$ref': '#/components/schemas/ModelCircle' + }, + { + '$ref': '#/components/schemas/ModelSquare' + } + ], + discriminator: { + propertyName: 'kind', + mapping: { + circle: '#/components/schemas/ModelCircle', + square: '#/components/schemas/ModelSquare' + } + } +} as const; + +export const CompositionWithAnyOfSchema = { + description: "This is a model with one property with a 'any of' relationship", + type: 'object', + properties: { + propA: { + type: 'object', + anyOf: [ + { + '$ref': '#/components/schemas/ModelWithString' + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const CompositionWithAnyOfAnonymousSchema = { + description: "This is a model with one property with a 'any of' relationship where the options are not $ref", + type: 'object', + properties: { + propA: { + type: 'object', + anyOf: [ + { + description: 'Anonymous object type', + type: 'object', + properties: { + propA: { + type: 'string' + } + } + }, + { + description: 'Anonymous string type', + type: 'string' + }, + { + description: 'Anonymous integer type', + type: 'integer' + } + ] + } + } +} as const; + +export const CompositionWithNestedAnyAndTypeNullSchema = { + description: "This is a model with nested 'any of' property with a type null", + type: 'object', + properties: { + propA: { + type: 'object', + anyOf: [ + { + items: { + anyOf: [ + { + '$ref': '#/components/schemas/ModelWithDictionary' + }, + { + type: 'null' + } + ] + }, + type: 'array' + }, + { + items: { + anyOf: [ + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + type: 'null' + } + ] + }, + type: 'array' + } + ] + } + } +} as const; + +export const _3e_num_1ПериодSchema = { + enum: ['Bird', 'Dog'], + type: 'string' +} as const; + +export const ConstValueSchema = { + type: 'string', + const: 'ConstValue' +} as const; + +export const CompositionWithNestedAnyOfAndNullSchema = { + description: "This is a model with one property with a 'any of' relationship where the options are not $ref", + type: 'object', + properties: { + propA: { + anyOf: [ + { + items: { + anyOf: [ + { + '$ref': '#/components/schemas/3e-num_1Период' + }, + { + '$ref': '#/components/schemas/ConstValue' + } + ] + }, + type: 'array' + }, + { + type: 'null' + } + ], + title: 'Scopes' + } + } +} as const; + +export const CompositionWithOneOfAndNullableSchema = { + description: "This is a model with one property with a 'one of' relationship", + type: 'object', + properties: { + propA: { + type: ['object', 'null'], + oneOf: [ + { + type: 'object', + properties: { + boolean: { + type: 'boolean' + } + } + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const CompositionWithOneOfAndSimpleDictionarySchema = { + description: 'This is a model that contains a simple dictionary within composition', + type: 'object', + properties: { + propA: { + oneOf: [ + { + type: 'boolean' + }, + { + type: 'object', + additionalProperties: { + type: 'number' + } + } + ] + } + } +} as const; + +export const CompositionWithOneOfAndSimpleArrayDictionarySchema = { + description: 'This is a model that contains a dictionary of simple arrays within composition', + type: 'object', + properties: { + propA: { + oneOf: [ + { + type: 'boolean' + }, + { + type: 'object', + additionalProperties: { + type: 'array', + items: { + type: 'boolean' + } + } + } + ] + } + } +} as const; + +export const CompositionWithOneOfAndComplexArrayDictionarySchema = { + description: 'This is a model that contains a dictionary of complex arrays (composited) within composition', + type: 'object', + properties: { + propA: { + oneOf: [ + { + type: 'boolean' + }, + { + type: 'object', + additionalProperties: { + type: 'array', + items: { + oneOf: [ + { + type: 'number' + }, + { + type: 'string' + } + ] + } + } + } + ] + } + } +} as const; + +export const CompositionWithAllOfAndNullableSchema = { + description: "This is a model with one property with a 'all of' relationship", + type: 'object', + properties: { + propA: { + type: ['object', 'null'], + allOf: [ + { + type: 'object', + properties: { + boolean: { + type: 'boolean' + } + } + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const CompositionWithAnyOfAndNullableSchema = { + description: "This is a model with one property with a 'any of' relationship", + type: 'object', + properties: { + propA: { + type: ['object', 'null'], + anyOf: [ + { + type: 'object', + properties: { + boolean: { + type: 'boolean' + } + } + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const CompositionBaseModelSchema = { + description: 'This is a base model with two simple optional properties', + type: 'object', + properties: { + firstName: { + type: 'string' + }, + lastname: { + type: 'string' + } + } +} as const; + +export const CompositionExtendedModelSchema = { + description: 'This is a model that extends the base model', + type: 'object', + allOf: [ + { + '$ref': '#/components/schemas/CompositionBaseModel' + } + ], + properties: { + age: { + type: 'number' + } + }, + required: ['firstName', 'lastname', 'age'] +} as const; + +export const ModelWithPropertiesSchema = { + description: 'This is a model with one nested property', + type: 'object', + required: ['required', 'requiredAndReadOnly', 'requiredAndNullable'], + properties: { + required: { + type: 'string' + }, + requiredAndReadOnly: { + type: 'string', + readOnly: true + }, + requiredAndNullable: { + type: ['string', 'null'] + }, + string: { + type: 'string' + }, + number: { + type: 'number' + }, + boolean: { + type: 'boolean' + }, + reference: { + '$ref': '#/components/schemas/ModelWithString' + }, + 'property with space': { + type: 'string' + }, + default: { + type: 'string' + }, + try: { + type: 'string' + }, + '@namespace.string': { + type: 'string', + readOnly: true + }, + '@namespace.integer': { + type: 'integer', + readOnly: true + } + } +} as const; + +export const ModelWithNestedPropertiesSchema = { + description: 'This is a model with one nested property', + type: 'object', + required: ['first'], + properties: { + first: { + type: ['object', 'null'], + required: ['second'], + readOnly: true, + properties: { + second: { + type: ['object', 'null'], + required: ['third'], + readOnly: true, + properties: { + third: { + type: ['string', 'null'], + required: true, + readOnly: true + } + } + } + } + } + } +} as const; + +export const ModelWithDuplicatePropertiesSchema = { + description: 'This is a model with duplicated properties', + type: 'object', + properties: { + prop: { + '$ref': '#/components/schemas/ModelWithString' + } + } +} as const; + +export const ModelWithOrderedPropertiesSchema = { + description: 'This is a model with ordered properties', + type: 'object', + properties: { + zebra: { + type: 'string' + }, + apple: { + type: 'string' + }, + hawaii: { + type: 'string' + } + } +} as const; + +export const ModelWithDuplicateImportsSchema = { + description: 'This is a model with duplicated imports', + type: 'object', + properties: { + propA: { + '$ref': '#/components/schemas/ModelWithString' + }, + propB: { + '$ref': '#/components/schemas/ModelWithString' + }, + propC: { + '$ref': '#/components/schemas/ModelWithString' + } + } +} as const; + +export const ModelThatExtendsSchema = { + description: 'This is a model that extends another model', + type: 'object', + allOf: [ + { + '$ref': '#/components/schemas/ModelWithString' + }, + { + type: 'object', + properties: { + propExtendsA: { + type: 'string' + }, + propExtendsB: { + '$ref': '#/components/schemas/ModelWithString' + } + } + } + ] +} as const; + +export const ModelThatExtendsExtendsSchema = { + description: 'This is a model that extends another model', + type: 'object', + allOf: [ + { + '$ref': '#/components/schemas/ModelWithString' + }, + { + '$ref': '#/components/schemas/ModelThatExtends' + }, + { + type: 'object', + properties: { + propExtendsC: { + type: 'string' + }, + propExtendsD: { + '$ref': '#/components/schemas/ModelWithString' + } + } + } + ] +} as const; + +export const ModelWithPatternSchema = { + description: 'This is a model that contains a some patterns', + type: 'object', + required: ['key', 'name'], + properties: { + key: { + maxLength: 64, + pattern: '^[a-zA-Z0-9_]*$', + type: 'string' + }, + name: { + maxLength: 255, + type: 'string' + }, + enabled: { + type: 'boolean', + readOnly: true + }, + modified: { + type: 'string', + format: 'date-time', + readOnly: true + }, + id: { + type: 'string', + pattern: '^\\d{2}-\\d{3}-\\d{4}$' + }, + text: { + type: 'string', + pattern: '^\\w+$' + }, + patternWithSingleQuotes: { + type: 'string', + pattern: "^[a-zA-Z0-9']*$" + }, + patternWithNewline: { + type: 'string', + pattern: 'aaa\\nbbb' + }, + patternWithBacktick: { + type: 'string', + pattern: 'aaa`bbb' + } + } +} as const; + +export const FileSchema = { + required: ['mime'], + type: 'object', + properties: { + id: { + title: 'Id', + type: 'string', + readOnly: true, + minLength: 1 + }, + updated_at: { + title: 'Updated at', + type: 'string', + format: 'date-time', + readOnly: true + }, + created_at: { + title: 'Created at', + type: 'string', + format: 'date-time', + readOnly: true + }, + mime: { + title: 'Mime', + type: 'string', + maxLength: 24, + minLength: 1 + }, + file: { + title: 'File', + type: 'string', + readOnly: true, + format: 'uri' + } + } +} as const; + +export const defaultSchema = { + type: 'object', + properties: { + name: { + type: 'string' + } + } +} as const; + +export const PageableSchema = { + type: 'object', + properties: { + page: { + minimum: 0, + type: 'integer', + format: 'int32', + default: 0 + }, + size: { + minimum: 1, + type: 'integer', + format: 'int32' + }, + sort: { + type: 'array', + items: { + type: 'string' + } + } + } +} as const; + +export const FreeFormObjectWithoutAdditionalPropertiesSchema = { + description: 'This is a free-form object without additionalProperties.', + type: 'object' +} as const; + +export const FreeFormObjectWithAdditionalPropertiesEqTrueSchema = { + description: 'This is a free-form object with additionalProperties: true.', + type: 'object', + additionalProperties: true +} as const; + +export const FreeFormObjectWithAdditionalPropertiesEqEmptyObjectSchema = { + description: 'This is a free-form object with additionalProperties: {}.', + type: 'object', + additionalProperties: {} +} as const; + +export const ModelWithConstSchema = { + type: 'object', + properties: { + String: { + const: 'String' + }, + number: { + const: 0 + }, + null: { + const: null + }, + withType: { + type: 'string', + const: 'Some string' + } + } +} as const; + +export const ModelWithAdditionalPropertiesEqTrueSchema = { + description: 'This is a model with one property and additionalProperties: true', + type: 'object', + properties: { + prop: { + description: 'This is a simple string property', + type: 'string' + } + }, + additionalProperties: true +} as const; + +export const NestedAnyOfArraysNullableSchema = { + properties: { + nullableArray: { + anyOf: [ + { + items: { + anyOf: [ + { + type: 'string' + }, + { + type: 'boolean' + } + ] + }, + type: 'array' + }, + { + type: 'null' + } + ] + } + }, + type: 'object' +} as const; + +export const CompositionWithOneOfAndPropertiesSchema = { + type: 'object', + oneOf: [ + { + type: 'object', + required: ['foo'], + properties: { + foo: { + '$ref': '#/components/parameters/SimpleParameter' + } + }, + additionalProperties: false + }, + { + type: 'object', + required: ['bar'], + properties: { + bar: { + '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' + } + }, + additionalProperties: false + } + ], + required: ['baz', 'qux'], + properties: { + baz: { + type: ['integer', 'null'], + format: 'uint16', + minimum: 0 + }, + qux: { + type: 'integer', + format: 'uint8', + minimum: 0 + } + } +} as const; + +export const NullableObjectSchema = { + type: ['object', 'null'], + description: 'An object that can be null', + properties: { + foo: { + type: 'string' + } + }, + default: null +} as const; + +export const CharactersInDescriptionSchema = { + type: 'string', + description: 'Some % character' +} as const; + +export const ModelWithNullableObjectSchema = { + type: 'object', + properties: { + data: { + '$ref': '#/components/schemas/NullableObject' + } + } +} as const; + +export const ModelWithOneOfEnumSchema = { + oneOf: [ + { + type: 'object', + required: ['foo'], + properties: { + foo: { + type: 'string', + enum: ['Bar'] + } + } + }, + { + type: 'object', + required: ['foo'], + properties: { + foo: { + type: 'string', + enum: ['Baz'] + } + } + }, + { + type: 'object', + required: ['foo'], + properties: { + foo: { + type: 'string', + enum: ['Qux'] + } + } + }, + { + type: 'object', + required: ['content', 'foo'], + properties: { + content: { + type: 'string', + format: 'date-time' + }, + foo: { + type: 'string', + enum: ['Quux'] + } + } + }, + { + type: 'object', + required: ['content', 'foo'], + properties: { + content: { + type: 'array', + prefixItems: [ + { + type: 'string', + format: 'date-time' + }, + { + type: 'string' + } + ], + maxItems: 2, + minItems: 2 + }, + foo: { + type: 'string', + enum: ['Corge'] + } + } + } + ] +} as const; + +export const ModelWithNestedArrayEnumsDataFooSchema = { + enum: ['foo', 'bar'], + type: 'string' +} as const; + +export const ModelWithNestedArrayEnumsDataBarSchema = { + enum: ['baz', 'qux'], + type: 'string' +} as const; + +export const ModelWithNestedArrayEnumsDataSchema = { + type: 'object', + properties: { + foo: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' + } + }, + bar: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataBar' + } + } + } +} as const; + +export const ModelWithNestedArrayEnumsSchema = { + type: 'object', + properties: { + array_strings: { + type: 'array', + items: { + type: 'string' + } + }, + data: { + allOf: [ + { + '$ref': '#/components/schemas/ModelWithNestedArrayEnumsData' + } + ] + } + } +} as const; + +export const ModelWithNestedCompositionEnumsSchema = { + type: 'object', + properties: { + foo: { + allOf: [ + { + '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' + } + ] + } + } +} as const; + +export const ModelWithReadOnlyAndWriteOnlySchema = { + type: 'object', + required: ['foo', 'bar', 'baz'], + properties: { + foo: { + type: 'string' + }, + bar: { + readOnly: true, + type: 'string' + }, + baz: { + type: 'string', + writeOnly: true + } + } +} as const; + +export const ModelWithConstantSizeArraySchema = { + type: 'array', + items: { + type: 'number' + }, + minItems: 2, + maxItems: 2 +} as const; + +export const ModelWithAnyOfConstantSizeArraySchema = { + type: 'array', + items: { + oneOf: [ + { + type: 'number' + }, + { + type: 'string' + } + ] + }, + minItems: 3, + maxItems: 3 +} as const; + +export const ModelWithPrefixItemsConstantSizeArraySchema = { + type: 'array', + prefixItems: [ + { + '$ref': '#/components/schemas/ModelWithInteger' + }, + { + oneOf: [ + { + type: 'number' + }, + { + type: 'string' + } + ] + }, + { + type: 'string' + } + ] +} as const; + +export const ModelWithAnyOfConstantSizeArrayNullableSchema = { + type: ['array'], + items: { + oneOf: [ + { + type: ['number', 'null'] + }, + { + type: 'string' + } + ] + }, + minItems: 3, + maxItems: 3 +} as const; + +export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsSchema = { + type: 'array', + items: { + oneOf: [ + { + type: 'number' + }, + { + '$ref': '#/components/schemas/import' + } + ] + }, + minItems: 2, + maxItems: 2 +} as const; + +export const ModelWithAnyOfConstantSizeArrayAndIntersectSchema = { + type: 'array', + items: { + allOf: [ + { + type: 'number' + }, + { + type: 'string' + } + ] + }, + minItems: 2, + maxItems: 2 +} as const; + +export const ModelWithNumericEnumUnionSchema = { + type: 'object', + properties: { + value: { + type: 'number', + description: 'Период', + enum: [-10, -1, 0, 1, 3, 6, 12] + } + } +} as const; + +export const ModelWithBackticksInDescriptionSchema = { + description: 'Some description with `back ticks`', + type: 'object', + properties: { + template: { + type: 'string', + description: `The template \`that\` should be used for parsing and importing the contents of the CSV file. + +

There is one placeholder currently supported:

  • \${x} - refers to the n-th column in the CSV file, e.g. \${1}, \${2}, ...)

Example of a correct JSON template:

+
+[
+  {
+    "resourceType": "Asset",
+    "identifier": {
+      "name": "\${1}",
+      "domain": {
+        "name": "\${2}",
+        "community": {
+          "name": "Some Community"
+        }
+      }
+    },
+    "attributes" : {
+      "00000000-0000-0000-0000-000000003115" : [ {
+        "value" : "\${3}" 
+      } ],
+      "00000000-0000-0000-0000-000000000222" : [ {
+        "value" : "\${4}"
+      } ]
+    }
+  }
+]
+
` + } + } +} as const; + +export const ModelWithOneOfAndPropertiesSchema = { + type: 'object', + oneOf: [ + { + '$ref': '#/components/parameters/SimpleParameter' + }, + { + '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' + } + ], + required: ['baz', 'qux'], + properties: { + baz: { + type: ['integer', 'null'], + format: 'uint16', + minimum: 0 + }, + qux: { + type: 'integer', + format: 'uint8', + minimum: 0 + } + } +} as const; + +export const ParameterSimpleParameterUnusedSchema = { + description: 'Model used to test deduplication strategy (unused)', + type: 'string' +} as const; + +export const PostServiceWithEmptyTagResponseSchema = { + description: 'Model used to test deduplication strategy', + type: 'string' +} as const; + +export const PostServiceWithEmptyTagResponse2Schema = { + description: 'Model used to test deduplication strategy', + type: 'string' +} as const; + +export const DeleteFooDataSchema = { + description: 'Model used to test deduplication strategy', + type: 'string' +} as const; + +export const DeleteFooData2Schema = { + description: 'Model used to test deduplication strategy', + type: 'string' +} as const; + +export const importSchema = { + description: 'Model with restricted keyword name', + type: 'string' +} as const; + +export const SchemaWithFormRestrictedKeysSchema = { + type: 'object', + properties: { + description: { + type: 'string' + }, + 'x-enum-descriptions': { + type: 'string' + }, + 'x-enum-varnames': { + type: 'string' + }, + 'x-enumNames': { + type: 'string' + }, + title: { + type: 'string' + }, + object: { + type: 'object', + properties: { + description: { + type: 'string' + }, + 'x-enum-descriptions': { + type: 'string' + }, + 'x-enum-varnames': { + type: 'string' + }, + 'x-enumNames': { + type: 'string' + }, + title: { + type: 'string' + } + } + }, + array: { + type: 'array', + items: { + type: 'object', + properties: { + description: { + type: 'string' + }, + 'x-enum-descriptions': { + type: 'string' + }, + 'x-enum-varnames': { + type: 'string' + }, + 'x-enumNames': { + type: 'string' + }, + title: { + type: 'string' + } + } + } + } + } +} as const; + +export const io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptionsSchema = { + description: 'This schema was giving PascalCase transformations a hard time', + properties: { + preconditions: { + allOf: [ + { + '$ref': '#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions' + } + ], + description: 'Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.' + } + }, + type: 'object' +} as const; + +export const io_k8s_apimachinery_pkg_apis_meta_v1_PreconditionsSchema = { + description: 'This schema was giving PascalCase transformations a hard time', + properties: { + resourceVersion: { + description: 'Specifies the target ResourceVersion', + type: 'string' + }, + uid: { + description: 'Specifies the target UID.', + type: 'string' + } + }, + type: 'object' +} as const; + +export const AdditionalPropertiesUnknownIssueSchema = { + type: 'object', + properties: {}, + additionalProperties: { + anyOf: [ + { + type: 'string' + }, + { + type: 'number' + } + ] + } +} as const; + +export const AdditionalPropertiesUnknownIssue2Schema = { + type: 'object', + additionalProperties: { + anyOf: [ + { + type: 'string' + }, + { + type: 'number' + } + ] + } +} as const; + +export const AdditionalPropertiesUnknownIssue3Schema = { + type: 'object', + allOf: [ + { + type: 'string' + }, + { + type: 'object', + required: ['entries'], + properties: { + entries: { + type: 'object', + additionalProperties: { + '$ref': '#/components/schemas/AdditionalPropertiesUnknownIssue' + } + } + } + } + ] +} as const; + +export const AdditionalPropertiesIntegerIssueSchema = { + type: 'object', + required: ['value'], + properties: { + value: { + type: 'integer' + } + }, + additionalProperties: { + type: 'integer' + } +} as const; + +export const OneOfAllOfIssueSchema = { + oneOf: [ + { + allOf: [ + { + oneOf: [ + { + '$ref': '#/components/schemas/ConstValue' + }, + { + '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]' + } + ] + }, + { + '$ref': '#/components/schemas/3e-num_1Период' + } + ] + }, + { + '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]' + } + ] +} as const; + +export const Generic_Schema_Duplicate_Issue_1_System_Boolean_Schema = { + type: 'object', + properties: { + item: { + type: 'boolean' + }, + error: { + type: ['string', 'null'] + }, + hasError: { + type: 'boolean', + readOnly: true + }, + data: { + type: 'object', + properties: {}, + additionalProperties: false + } + }, + additionalProperties: false +} as const; + +export const Generic_Schema_Duplicate_Issue_1_System_String_Schema = { + type: 'object', + properties: { + item: { + type: ['string', 'null'] + }, + error: { + type: ['string', 'null'] + }, + hasError: { + type: 'boolean', + readOnly: true + } + }, + additionalProperties: false +} as const; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/sdk.gen.ts new file mode 100644 index 000000000..7f932711f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts new file mode 100644 index 000000000..caa002cde --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts @@ -0,0 +1,19 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base', + throwOnError: true +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts new file mode 100644 index 000000000..4300b2379 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts new file mode 100644 index 000000000..b3e776847 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts @@ -0,0 +1,32 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { PostFooData, PostFooResponse } from './types.gen'; +import { postFooResponseTransformer } from './transformers.gen'; +import { zPostFooResponse } from './zod.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const postFoo = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + responseTransformer: postFooResponseTransformer, + responseValidator: async (data) => { + return await zPostFooResponse.parseAsync(data); + }, + url: '/foo', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts new file mode 100644 index 000000000..419690a91 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts @@ -0,0 +1,13 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { PostFooResponse } from './types.gen'; + +const fooSchemaResponseTransformer = (data: any) => { + data.foo = BigInt(data.foo.toString()); + return data; +}; + +export const postFooResponseTransformer = async (data: any): Promise => { + data = fooSchemaResponseTransformer(data); + return data; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/types.gen.ts new file mode 100644 index 000000000..a796d8382 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/types.gen.ts @@ -0,0 +1,32 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + bar?: number; + foo: bigint; + id: string; +}; + +export type Bar = { + foo: number; + [key: string]: number; +}; + +export type PostFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type PostFooResponses = { + /** + * OK + */ + 200: Foo; +}; + +export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/zod.gen.ts new file mode 100644 index 000000000..328fe6811 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/zod.gen.ts @@ -0,0 +1,15 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { z } from 'zod'; + +export const zFoo = z.object({ + bar: z.number().int().optional(), + foo: z.coerce.bigint(), + id: z.string() +}); + +export const zBar = z.object({ + foo: z.number().int() +}); + +export const zPostFooResponse = zFoo; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts new file mode 100644 index 000000000..ed1facdfd --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts @@ -0,0 +1,95 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type ReadableFooReadWrite = ReadableBarRead; + +export type WritableFooReadWrite = WritableBarRead & { + foo?: string; +}; + +export type ReadableFooRead = ReadableBarRead & { + readonly foo?: string; +}; + +export type WritableFooRead = WritableBarRead; + +export type ReadableFooWrite = ReadableBarWrite; + +export type WritableFooWrite = WritableBarWrite & { + foo?: string; +}; + +export type ReadableBarRead = Baz | ReadableQuxAllWrite | ReadableQuxAllRead | { + readonly bar?: string; +}; + +export type WritableBarRead = Baz | WritableQuxAllWrite | WritableQuxAllRead; + +export type ReadableBarWrite = Baz | ReadableQuxAllWrite | ReadableQuxAllRead; + +export type WritableBarWrite = Baz | WritableQuxAllWrite | WritableQuxAllRead | { + bar?: string; +}; + +export type Baz = { + baz?: string; +}; + +export type WritableQuxAllWrite = { + baz?: string; +}; + +export type ReadableQuxAllRead = { + readonly baz?: string; +}; + +export type PostFooReadWriteData = { + body: WritableFooReadWrite; + path?: never; + query?: never; + url: '/foo-read-write'; +}; + +export type PostFooReadWriteResponses = { + /** + * OK + */ + 200: ReadableFooReadWrite; +}; + +export type PostFooReadWriteResponse = PostFooReadWriteResponses[keyof PostFooReadWriteResponses]; + +export type PostFooReadData = { + body: WritableFooRead; + path?: never; + query?: never; + url: '/foo-read'; +}; + +export type PostFooReadResponses = { + /** + * OK + */ + 200: ReadableFooRead; +}; + +export type PostFooReadResponse = PostFooReadResponses[keyof PostFooReadResponses]; + +export type PostFooWriteData = { + body: WritableFooWrite; + path?: never; + query?: never; + url: '/foo-write'; +}; + +export type PostFooWriteResponses = { + /** + * OK + */ + 200: ReadableFooWrite; +}; + +export type PostFooWriteResponse = PostFooWriteResponses[keyof PostFooWriteResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts new file mode 100644 index 000000000..eefb71005 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts @@ -0,0 +1,85 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type FooReadWrite = BarRead & { + foo?: string; +}; + +export type FooRead = BarRead & { + readonly foo?: string; +}; + +export type FooWrite = BarWrite & { + foo?: string; +}; + +export type BarRead = Baz | QuxAllWrite | QuxAllRead | { + readonly bar?: string; +}; + +export type BarWrite = Baz | QuxAllWrite | QuxAllRead | { + bar?: string; +}; + +export type Baz = { + baz?: string; +}; + +export type QuxAllWrite = { + baz?: string; +}; + +export type QuxAllRead = { + readonly baz?: string; +}; + +export type PostFooReadWriteData = { + body: FooReadWrite; + path?: never; + query?: never; + url: '/foo-read-write'; +}; + +export type PostFooReadWriteResponses = { + /** + * OK + */ + 200: FooReadWrite; +}; + +export type PostFooReadWriteResponse = PostFooReadWriteResponses[keyof PostFooReadWriteResponses]; + +export type PostFooReadData = { + body: FooRead; + path?: never; + query?: never; + url: '/foo-read'; +}; + +export type PostFooReadResponses = { + /** + * OK + */ + 200: FooRead; +}; + +export type PostFooReadResponse = PostFooReadResponses[keyof PostFooReadResponses]; + +export type PostFooWriteData = { + body: FooWrite; + path?: never; + query?: never; + url: '/foo-write'; +}; + +export type PostFooWriteResponses = { + /** + * OK + */ + 200: FooWrite; +}; + +export type PostFooWriteResponse = PostFooWriteResponses[keyof PostFooWriteResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts new file mode 100644 index 000000000..33e101093 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts @@ -0,0 +1,1128 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, DefaultService, SimpleService, ParametersService, DescriptionsService, DeprecatedService, RequestBodyService, FormDataService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, UploadService, FileResponseService, ComplexService, MultipartService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/angular-query-experimental'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.export({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.import({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.import({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DeprecatedService.deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DeprecatedService.deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await FormDataService.postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await FormDataService.postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NoContentService.callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await CollectionFormatService.collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await TypesService.types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await UploadService.uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await UploadService.uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await FileResponseService.fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ComplexService.complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipartService.multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipartService.multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await MultipartService.multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ComplexService.complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts new file mode 100644 index 000000000..e94d5103c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts @@ -0,0 +1,506 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export class DefaultService { + public static export(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static patchApiVbyApiVersionNoTag(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static import(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static fooWow(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static getApiVbyApiVersionSimpleOperation(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); + } + +} + +export class SimpleService { + public static apiVVersionODataControllerCount(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); + } + + public static deleteCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static getCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static headCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static optionsCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static patchCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static postCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static putCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); + } + +} + +export class ParametersService { + public static deleteFoo(options: Options) { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); + } + + public static callWithParameters(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static callWithWeirdParameterNames(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static getCallWithOptionalParam(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static postCallWithOptionalParam(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class DescriptionsService { + public static callWithDescriptions(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); + } + +} + +export class DeprecatedService { + /** + * @deprecated + */ + public static deprecatedCall(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); + } + +} + +export class RequestBodyService { + public static postApiVbyApiVersionRequestBody(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class FormDataService { + public static postApiVbyApiVersionFormData(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); + } + +} + +export class DefaultsService { + public static callWithDefaultParameters(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callWithDefaultOptionalParameters(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callToTestOrderOfParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + +} + +export class DuplicateService { + public static duplicateName(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName2(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName3(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName4(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + +} + +export class NoContentService { + public static callWithNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); + } + + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + +} + +export class ResponseService { + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + + public static callWithResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithDuplicateResponses(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithResponses(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); + } + +} + +export class MultipleTags1Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags2Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags3Service { + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class CollectionFormatService { + public static collectionFormat(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); + } + +} + +export class TypesService { + public static types(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); + } + +} + +export class UploadService { + public static uploadFile(options: Options) { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); + } + +} + +export class FileResponseService { + public static fileResponse(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); + } + +} + +export class ComplexService { + public static complexTypes(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); + } + + public static complexParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); + } + +} + +export class MultipartService { + public static multipartResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); + } + + public static multipartRequest(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); + } + +} + +export class HeaderService { + public static callWithResultFromHeader(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); + } + +} + +export class ErrorService { + public static testErrorCode(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); + } + + /** + * Login User + */ + public static putWithFormUrlEncoded(options: Options) { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts new file mode 100644 index 000000000..6c51e6e80 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts @@ -0,0 +1,1129 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/angular-query-experimental'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import type { AxiosError } from 'axios'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await export_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await import_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await import_({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts new file mode 100644 index 000000000..1d97df8bc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts new file mode 100644 index 000000000..9e76f2fd8 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts @@ -0,0 +1,410 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + responseType: 'blob', + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts new file mode 100644 index 000000000..9cb3fcf99 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts new file mode 100644 index 000000000..8b834b887 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts @@ -0,0 +1,1128 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/angular-query-experimental'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await export_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await import_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await import_({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts new file mode 100644 index 000000000..7f932711f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts new file mode 100644 index 000000000..05426b6bd --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts @@ -0,0 +1,1128 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, DefaultService, SimpleService, ParametersService, DescriptionsService, DeprecatedService, RequestBodyService, FormDataService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, UploadService, FileResponseService, ComplexService, MultipartService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; +import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/react-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.export({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.import({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.import({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DeprecatedService.deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DeprecatedService.deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await FormDataService.postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await FormDataService.postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NoContentService.callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await CollectionFormatService.collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await TypesService.types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await UploadService.uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await UploadService.uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await FileResponseService.fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ComplexService.complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipartService.multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipartService.multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await MultipartService.multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ComplexService.complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts new file mode 100644 index 000000000..e94d5103c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts @@ -0,0 +1,506 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export class DefaultService { + public static export(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static patchApiVbyApiVersionNoTag(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static import(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static fooWow(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static getApiVbyApiVersionSimpleOperation(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); + } + +} + +export class SimpleService { + public static apiVVersionODataControllerCount(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); + } + + public static deleteCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static getCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static headCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static optionsCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static patchCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static postCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static putCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); + } + +} + +export class ParametersService { + public static deleteFoo(options: Options) { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); + } + + public static callWithParameters(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static callWithWeirdParameterNames(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static getCallWithOptionalParam(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static postCallWithOptionalParam(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class DescriptionsService { + public static callWithDescriptions(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); + } + +} + +export class DeprecatedService { + /** + * @deprecated + */ + public static deprecatedCall(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); + } + +} + +export class RequestBodyService { + public static postApiVbyApiVersionRequestBody(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class FormDataService { + public static postApiVbyApiVersionFormData(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); + } + +} + +export class DefaultsService { + public static callWithDefaultParameters(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callWithDefaultOptionalParameters(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callToTestOrderOfParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + +} + +export class DuplicateService { + public static duplicateName(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName2(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName3(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName4(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + +} + +export class NoContentService { + public static callWithNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); + } + + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + +} + +export class ResponseService { + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + + public static callWithResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithDuplicateResponses(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithResponses(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); + } + +} + +export class MultipleTags1Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags2Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags3Service { + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class CollectionFormatService { + public static collectionFormat(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); + } + +} + +export class TypesService { + public static types(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); + } + +} + +export class UploadService { + public static uploadFile(options: Options) { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); + } + +} + +export class FileResponseService { + public static fileResponse(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); + } + +} + +export class ComplexService { + public static complexTypes(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); + } + + public static complexParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); + } + +} + +export class MultipartService { + public static multipartResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); + } + + public static multipartRequest(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); + } + +} + +export class HeaderService { + public static callWithResultFromHeader(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); + } + +} + +export class ErrorService { + public static testErrorCode(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); + } + + /** + * Login User + */ + public static putWithFormUrlEncoded(options: Options) { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts new file mode 100644 index 000000000..43c7a6a12 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts @@ -0,0 +1,1129 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; +import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/react-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import type { AxiosError } from 'axios'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await export_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await import_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await import_({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/client.gen.ts new file mode 100644 index 000000000..1d97df8bc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/sdk.gen.ts new file mode 100644 index 000000000..9e76f2fd8 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/sdk.gen.ts @@ -0,0 +1,410 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + responseType: 'blob', + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/types.gen.ts new file mode 100644 index 000000000..9cb3fcf99 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts new file mode 100644 index 000000000..0cd713c64 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts @@ -0,0 +1,1128 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; +import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/react-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await export_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await import_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await import_({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts new file mode 100644 index 000000000..7f932711f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts new file mode 100644 index 000000000..ba5915d9f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts @@ -0,0 +1,1128 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, DefaultService, SimpleService, ParametersService, DescriptionsService, DeprecatedService, RequestBodyService, FormDataService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, UploadService, FileResponseService, ComplexService, MultipartService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/solid-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.export({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.import({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.import({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DeprecatedService.deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DeprecatedService.deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await FormDataService.postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await FormDataService.postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NoContentService.callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await CollectionFormatService.collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await TypesService.types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await UploadService.uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await UploadService.uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await FileResponseService.fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ComplexService.complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipartService.multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipartService.multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await MultipartService.multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ComplexService.complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts new file mode 100644 index 000000000..e94d5103c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts @@ -0,0 +1,506 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export class DefaultService { + public static export(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static patchApiVbyApiVersionNoTag(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static import(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static fooWow(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static getApiVbyApiVersionSimpleOperation(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); + } + +} + +export class SimpleService { + public static apiVVersionODataControllerCount(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); + } + + public static deleteCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static getCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static headCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static optionsCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static patchCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static postCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static putCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); + } + +} + +export class ParametersService { + public static deleteFoo(options: Options) { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); + } + + public static callWithParameters(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static callWithWeirdParameterNames(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static getCallWithOptionalParam(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static postCallWithOptionalParam(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class DescriptionsService { + public static callWithDescriptions(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); + } + +} + +export class DeprecatedService { + /** + * @deprecated + */ + public static deprecatedCall(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); + } + +} + +export class RequestBodyService { + public static postApiVbyApiVersionRequestBody(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class FormDataService { + public static postApiVbyApiVersionFormData(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); + } + +} + +export class DefaultsService { + public static callWithDefaultParameters(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callWithDefaultOptionalParameters(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callToTestOrderOfParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + +} + +export class DuplicateService { + public static duplicateName(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName2(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName3(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName4(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + +} + +export class NoContentService { + public static callWithNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); + } + + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + +} + +export class ResponseService { + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + + public static callWithResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithDuplicateResponses(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithResponses(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); + } + +} + +export class MultipleTags1Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags2Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags3Service { + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class CollectionFormatService { + public static collectionFormat(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); + } + +} + +export class TypesService { + public static types(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); + } + +} + +export class UploadService { + public static uploadFile(options: Options) { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); + } + +} + +export class FileResponseService { + public static fileResponse(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); + } + +} + +export class ComplexService { + public static complexTypes(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); + } + + public static complexParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); + } + +} + +export class MultipartService { + public static multipartResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); + } + + public static multipartRequest(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); + } + +} + +export class HeaderService { + public static callWithResultFromHeader(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); + } + +} + +export class ErrorService { + public static testErrorCode(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); + } + + /** + * Login User + */ + public static putWithFormUrlEncoded(options: Options) { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts new file mode 100644 index 000000000..0855483e8 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts @@ -0,0 +1,1129 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/solid-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import type { AxiosError } from 'axios'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await export_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await import_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await import_({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/client.gen.ts new file mode 100644 index 000000000..1d97df8bc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts new file mode 100644 index 000000000..9e76f2fd8 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts @@ -0,0 +1,410 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + responseType: 'blob', + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/types.gen.ts new file mode 100644 index 000000000..9cb3fcf99 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts new file mode 100644 index 000000000..51709ca90 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts @@ -0,0 +1,1128 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/solid-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await export_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await import_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await import_({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts new file mode 100644 index 000000000..7f932711f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts new file mode 100644 index 000000000..cae8ef1f5 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts @@ -0,0 +1,1128 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, DefaultService, SimpleService, ParametersService, DescriptionsService, DeprecatedService, RequestBodyService, FormDataService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, UploadService, FileResponseService, ComplexService, MultipartService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/svelte-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.export({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.import({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.import({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DeprecatedService.deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DeprecatedService.deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await FormDataService.postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await FormDataService.postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NoContentService.callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await CollectionFormatService.collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await TypesService.types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await UploadService.uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await UploadService.uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await FileResponseService.fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ComplexService.complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipartService.multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipartService.multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await MultipartService.multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ComplexService.complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts new file mode 100644 index 000000000..e94d5103c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts @@ -0,0 +1,506 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export class DefaultService { + public static export(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static patchApiVbyApiVersionNoTag(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static import(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static fooWow(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static getApiVbyApiVersionSimpleOperation(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); + } + +} + +export class SimpleService { + public static apiVVersionODataControllerCount(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); + } + + public static deleteCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static getCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static headCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static optionsCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static patchCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static postCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static putCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); + } + +} + +export class ParametersService { + public static deleteFoo(options: Options) { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); + } + + public static callWithParameters(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static callWithWeirdParameterNames(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static getCallWithOptionalParam(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static postCallWithOptionalParam(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class DescriptionsService { + public static callWithDescriptions(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); + } + +} + +export class DeprecatedService { + /** + * @deprecated + */ + public static deprecatedCall(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); + } + +} + +export class RequestBodyService { + public static postApiVbyApiVersionRequestBody(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class FormDataService { + public static postApiVbyApiVersionFormData(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); + } + +} + +export class DefaultsService { + public static callWithDefaultParameters(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callWithDefaultOptionalParameters(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callToTestOrderOfParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + +} + +export class DuplicateService { + public static duplicateName(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName2(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName3(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName4(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + +} + +export class NoContentService { + public static callWithNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); + } + + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + +} + +export class ResponseService { + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + + public static callWithResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithDuplicateResponses(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithResponses(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); + } + +} + +export class MultipleTags1Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags2Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags3Service { + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class CollectionFormatService { + public static collectionFormat(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); + } + +} + +export class TypesService { + public static types(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); + } + +} + +export class UploadService { + public static uploadFile(options: Options) { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); + } + +} + +export class FileResponseService { + public static fileResponse(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); + } + +} + +export class ComplexService { + public static complexTypes(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); + } + + public static complexParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); + } + +} + +export class MultipartService { + public static multipartResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); + } + + public static multipartRequest(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); + } + +} + +export class HeaderService { + public static callWithResultFromHeader(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); + } + +} + +export class ErrorService { + public static testErrorCode(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); + } + + /** + * Login User + */ + public static putWithFormUrlEncoded(options: Options) { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts new file mode 100644 index 000000000..9ba592ed0 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts @@ -0,0 +1,1129 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/svelte-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import type { AxiosError } from 'axios'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await export_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await import_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await import_({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions, Options> => { + const mutationOptions: MutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/client.gen.ts new file mode 100644 index 000000000..1d97df8bc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts new file mode 100644 index 000000000..9e76f2fd8 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts @@ -0,0 +1,410 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + responseType: 'blob', + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/types.gen.ts new file mode 100644 index 000000000..9cb3fcf99 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts new file mode 100644 index 000000000..7527d5f7d --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts @@ -0,0 +1,1128 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; +import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/svelte-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await export_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await import_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await import_({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { + const mutationOptions: MutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts new file mode 100644 index 000000000..7f932711f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts new file mode 100644 index 000000000..cf95804c4 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts @@ -0,0 +1,1128 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, DefaultService, SimpleService, ParametersService, DescriptionsService, DeprecatedService, RequestBodyService, FormDataService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, UploadService, FileResponseService, ComplexService, MultipartService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; +import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/vue-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.export({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.import({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.import({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultService.fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultService.getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await SimpleService.putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DescriptionsService.callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DeprecatedService.deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DeprecatedService.deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ParametersService.postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await FormDataService.postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await FormDataService.postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DefaultsService.callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await DuplicateService.duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NoContentService.callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipleTags1Service.dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ResponseService.callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await CollectionFormatService.collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await TypesService.types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await UploadService.uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await UploadService.uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await FileResponseService.fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ComplexService.complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipartService.multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await MultipartService.multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await MultipartService.multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ComplexService.complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await HeaderService.callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await ErrorService.testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await NonAsciiÆøåÆøÅöôêÊService.putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts new file mode 100644 index 000000000..e94d5103c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts @@ -0,0 +1,506 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export class DefaultService { + public static export(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static patchApiVbyApiVersionNoTag(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static import(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static fooWow(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); + } + + public static getApiVbyApiVersionSimpleOperation(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); + } + +} + +export class SimpleService { + public static apiVVersionODataControllerCount(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); + } + + public static deleteCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static getCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static headCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static optionsCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static patchCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static postCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); + } + + public static putCallWithoutParametersAndResponse(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); + } + +} + +export class ParametersService { + public static deleteFoo(options: Options) { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); + } + + public static callWithParameters(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static callWithWeirdParameterNames(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static getCallWithOptionalParam(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + + public static postCallWithOptionalParam(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class DescriptionsService { + public static callWithDescriptions(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); + } + +} + +export class DeprecatedService { + /** + * @deprecated + */ + public static deprecatedCall(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); + } + +} + +export class RequestBodyService { + public static postApiVbyApiVersionRequestBody(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); + } + +} + +export class FormDataService { + public static postApiVbyApiVersionFormData(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); + } + +} + +export class DefaultsService { + public static callWithDefaultParameters(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callWithDefaultOptionalParameters(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + + public static callToTestOrderOfParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); + } + +} + +export class DuplicateService { + public static duplicateName(options?: Options) { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName2(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName3(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + + public static duplicateName4(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); + } + +} + +export class NoContentService { + public static callWithNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); + } + + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + +} + +export class ResponseService { + public static callWithResponseAndNoContentResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); + } + + public static callWithResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithDuplicateResponses(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); + } + + public static callWithResponses(options?: Options) { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); + } + +} + +export class MultipleTags1Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags2Service { + public static dummyA(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); + } + + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class MultipleTags3Service { + public static dummyB(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); + } + +} + +export class CollectionFormatService { + public static collectionFormat(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); + } + +} + +export class TypesService { + public static types(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); + } + +} + +export class UploadService { + public static uploadFile(options: Options) { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); + } + +} + +export class FileResponseService { + public static fileResponse(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); + } + +} + +export class ComplexService { + public static complexTypes(options: Options) { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); + } + + public static complexParams(options: Options) { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); + } + +} + +export class MultipartService { + public static multipartResponse(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); + } + + public static multipartRequest(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); + } + +} + +export class HeaderService { + public static callWithResultFromHeader(options?: Options) { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); + } + +} + +export class ErrorService { + public static testErrorCode(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); + } + + /** + * Login User + */ + public static putWithFormUrlEncoded(options: Options) { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts new file mode 100644 index 000000000..12019c68f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts @@ -0,0 +1,1129 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; +import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/vue-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import type { AxiosError } from 'axios'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await export_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await import_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await import_({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, InfiniteData, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/client.gen.ts new file mode 100644 index 000000000..1d97df8bc --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseURL: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts new file mode 100644 index 000000000..9e76f2fd8 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts @@ -0,0 +1,410 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + responseType: 'blob', + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/types.gen.ts new file mode 100644 index 000000000..9cb3fcf99 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseURL: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts new file mode 100644 index 000000000..70669eb30 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts @@ -0,0 +1,1128 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; +import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/vue-query'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; +import { client as _heyApiClient } from '../client.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [ + params + ]; +}; + +export const exportQueryKey = (options?: Options) => createQueryKey('export', options); + +export const exportOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await export_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: exportQueryKey(options) + }); +}; + +export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchApiVbyApiVersionNoTag({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const importQueryKey = (options: Options) => createQueryKey('import', options); + +export const importOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await import_({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: importQueryKey(options) + }); +}; + +export const importMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await import_({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await fooWow({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); + +export const apiVVersionODataControllerCountOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await apiVVersionODataControllerCount({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: apiVVersionODataControllerCountQueryKey(options) + }); +}; + +export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); + +export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getApiVbyApiVersionSimpleOperation({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) + }); +}; + +export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); + +export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await patchCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); + +export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithoutParametersAndResponseQueryKey(options) + }); +}; + +export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putCallWithoutParametersAndResponse({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deleteFooMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deleteFoo({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); + +export const callWithDescriptionsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDescriptions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDescriptionsQueryKey(options) + }); +}; + +export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDescriptions({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); + +export const deprecatedCallOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await deprecatedCall({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: deprecatedCallQueryKey(options) + }); +}; + +export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await deprecatedCall({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); + +export const callWithParametersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersQueryKey(options) + }); +}; + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = queryKey[0]; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); + +export const callWithParametersInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await callWithParameters({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithParametersInfiniteQueryKey(options) + }); +}; + +export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); + +export const callWithWeirdParameterNamesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithWeirdParameterNamesQueryKey(options) + }); +}; + +export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithWeirdParameterNames({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); + +export const getCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamQueryKey(options) + }); +}; + +export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); + +export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + page: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await getCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: getCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); + +export const postCallWithOptionalParamOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamQueryKey(options) + }); +}; + +export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); + +export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { + return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + body: { + offset: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await postCallWithOptionalParam({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: postCallWithOptionalParamInfiniteQueryKey(options) + }); +}; + +export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postCallWithOptionalParam({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); + +export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) + }); +}; + +export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionRequestBody({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); + +export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: postApiVbyApiVersionFormDataQueryKey(options) + }); +}; + +export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await postApiVbyApiVersionFormData({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); + +export const callWithDefaultParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); + +export const callWithDefaultOptionalParametersOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDefaultOptionalParametersQueryKey(options) + }); +}; + +export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDefaultOptionalParameters({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callToTestOrderOfParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); + +export const duplicateName2Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName2({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName2QueryKey(options) + }); +}; + +export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); + +export const duplicateName3Options = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await duplicateName3({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: duplicateName3QueryKey(options) + }); +}; + +export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName3({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await duplicateName4({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); + +export const callWithNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithNoContentResponseQueryKey(options) + }); +}; + +export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); + +export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponseAndNoContentResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseAndNoContentResponseQueryKey(options) + }); +}; + +export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); + +export const dummyAOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyA({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyAQueryKey(options) + }); +}; + +export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); + +export const dummyBOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await dummyB({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: dummyBQueryKey(options) + }); +}; + +export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); + +export const callWithResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResponseQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); + +export const callWithDuplicateResponsesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithDuplicateResponsesQueryKey(options) + }); +}; + +export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithDuplicateResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResponses({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); + +export const collectionFormatOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await collectionFormat({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: collectionFormatQueryKey(options) + }); +}; + +export const typesQueryKey = (options: Options) => createQueryKey('types', options); + +export const typesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await types({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: typesQueryKey(options) + }); +}; + +export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); + +export const uploadFileOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await uploadFile({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: uploadFileQueryKey(options) + }); +}; + +export const uploadFileMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await uploadFile({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); + +export const fileResponseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await fileResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: fileResponseQueryKey(options) + }); +}; + +export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); + +export const complexTypesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await complexTypes({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: complexTypesQueryKey(options) + }); +}; + +export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); + +export const multipartResponseOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartResponse({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartResponseQueryKey(options) + }); +}; + +export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); + +export const multipartRequestOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await multipartRequest({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: multipartRequestQueryKey(options) + }); +}; + +export const multipartRequestMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await multipartRequest({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const complexParamsMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await complexParams({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); + +export const callWithResultFromHeaderOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: callWithResultFromHeaderQueryKey(options) + }); +}; + +export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await callWithResultFromHeader({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); + +export const testErrorCodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await testErrorCode({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: testErrorCodeQueryKey(options) + }); +}; + +export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await testErrorCode({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); + +export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (localOptions) => { + const { data } = await putWithFormUrlEncoded({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts new file mode 100644 index 000000000..7f932711f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/fastify.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/fastify.gen.ts new file mode 100644 index 000000000..03f6f3f43 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/fastify.gen.ts @@ -0,0 +1,130 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ImportData, ImportResponses, ApiVVersionODataControllerCountResponses, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponses, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponses, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, CallWithNoContentResponseResponses, CallWithResponseAndNoContentResponseResponses, DummyAResponses, DummyBResponses, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponses, CallWithResponsesErrors, CallWithResponsesResponses, CollectionFormatData, TypesData, TypesResponses, UploadFileData, UploadFileResponses, FileResponseData, FileResponseResponses, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponses, MultipartResponseResponses, MultipartRequestData, ComplexParamsData, ComplexParamsResponses, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Responses, PutWithFormUrlEncodedData } from './types.gen'; +import type { RouteHandler } from 'fastify'; + +export type RouteHandlers = { + import: RouteHandler<{ + Body: ImportData['body']; + Reply: Omit; + }>; + apiVVersionODataControllerCount: RouteHandler<{ + Reply: ApiVVersionODataControllerCountResponses; + }>; + getApiVbyApiVersionSimpleOperation: RouteHandler<{ + Params: GetApiVbyApiVersionSimpleOperationData['path']; + Reply: GetApiVbyApiVersionSimpleOperationResponses; + }>; + deleteFoo: RouteHandler<{ + Headers: DeleteFooData3['headers']; + Params: DeleteFooData3['path']; + }>; + callWithDescriptions: RouteHandler<{ + Querystring?: CallWithDescriptionsData['query']; + }>; + deprecatedCall: RouteHandler<{ + Headers: DeprecatedCallData['headers']; + }>; + callWithParameters: RouteHandler<{ + Body: CallWithParametersData['body']; + Headers: CallWithParametersData['headers']; + Params: CallWithParametersData['path']; + Querystring: CallWithParametersData['query']; + }>; + callWithWeirdParameterNames: RouteHandler<{ + Body: CallWithWeirdParameterNamesData['body']; + Headers: CallWithWeirdParameterNamesData['headers']; + Params: CallWithWeirdParameterNamesData['path']; + Querystring: CallWithWeirdParameterNamesData['query']; + }>; + getCallWithOptionalParam: RouteHandler<{ + Body: GetCallWithOptionalParamData['body']; + Querystring?: GetCallWithOptionalParamData['query']; + }>; + postCallWithOptionalParam: RouteHandler<{ + Body: PostCallWithOptionalParamData['body']; + Querystring: PostCallWithOptionalParamData['query']; + Reply: PostCallWithOptionalParamResponses; + }>; + postApiVbyApiVersionRequestBody: RouteHandler<{ + Body: PostApiVbyApiVersionRequestBodyData['body']; + Querystring?: PostApiVbyApiVersionRequestBodyData['query']; + }>; + postApiVbyApiVersionFormData: RouteHandler<{ + Body: PostApiVbyApiVersionFormDataData['body']; + Querystring?: PostApiVbyApiVersionFormDataData['query']; + }>; + callWithDefaultParameters: RouteHandler<{ + Querystring?: CallWithDefaultParametersData['query']; + }>; + callWithDefaultOptionalParameters: RouteHandler<{ + Querystring?: CallWithDefaultOptionalParametersData['query']; + }>; + callToTestOrderOfParams: RouteHandler<{ + Querystring: CallToTestOrderOfParamsData['query']; + }>; + callWithNoContentResponse: RouteHandler<{ + Reply: CallWithNoContentResponseResponses; + }>; + callWithResponseAndNoContentResponse: RouteHandler<{ + Reply: CallWithResponseAndNoContentResponseResponses; + }>; + dummyA: RouteHandler<{ + Reply: DummyAResponses; + }>; + dummyB: RouteHandler<{ + Reply: DummyBResponses; + }>; + callWithDuplicateResponses: RouteHandler<{ + Reply: Omit & CallWithDuplicateResponsesResponses; + }>; + callWithResponses: RouteHandler<{ + Reply: Omit & CallWithResponsesResponses; + }>; + collectionFormat: RouteHandler<{ + Querystring: CollectionFormatData['query']; + }>; + types: RouteHandler<{ + Params?: TypesData['path']; + Querystring: TypesData['query']; + Reply: TypesResponses; + }>; + uploadFile: RouteHandler<{ + Body: UploadFileData['body']; + Params: UploadFileData['path']; + Reply: UploadFileResponses; + }>; + fileResponse: RouteHandler<{ + Params: FileResponseData['path']; + Reply: FileResponseResponses; + }>; + complexTypes: RouteHandler<{ + Querystring: ComplexTypesData['query']; + Reply: ComplexTypesErrors & ComplexTypesResponses; + }>; + multipartResponse: RouteHandler<{ + Reply: MultipartResponseResponses; + }>; + multipartRequest: RouteHandler<{ + Body: MultipartRequestData['body']; + }>; + complexParams: RouteHandler<{ + Body: ComplexParamsData['body']; + Params: ComplexParamsData['path']; + Reply: ComplexParamsResponses; + }>; + callWithResultFromHeader: RouteHandler<{ + Reply: CallWithResultFromHeaderErrors & CallWithResultFromHeaderResponses; + }>; + testErrorCode: RouteHandler<{ + Querystring: TestErrorCodeData['query']; + Reply: TestErrorCodeErrors & TestErrorCodeResponses; + }>; + nonAsciiæøåÆøÅöôêÊ字符串: RouteHandler<{ + Querystring: NonAsciiæøåÆøÅöôêÊ字符串Data['query']; + Reply: NonAsciiæøåÆøÅöôêÊ字符串Responses; + }>; + putWithFormUrlEncoded: RouteHandler<{ + Body: PutWithFormUrlEncodedData['body']; + }>; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/zod/default/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/zod/default/zod.gen.ts new file mode 100644 index 000000000..d94d75cf2 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/zod/default/zod.gen.ts @@ -0,0 +1,754 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { z } from 'zod'; + +export const z400 = z.string(); + +export const zCamelCaseCommentWithBreaks = z.number().int(); + +export const zCommentWithBreaks = z.number().int(); + +export const zCommentWithBackticks = z.number().int(); + +export const zCommentWithBackticksAndQuotes = z.number().int(); + +export const zCommentWithSlashes = z.number().int(); + +export const zCommentWithExpressionPlaceholders = z.number().int(); + +export const zCommentWithQuotes = z.number().int(); + +export const zCommentWithReservedCharacters = z.number().int(); + +export const zSimpleInteger = z.number().int(); + +export const zSimpleBoolean = z.boolean(); + +export const zSimpleString = z.string(); + +export const zNonAsciiStringæøåÆøÅöôêÊ字符串 = z.string(); + +export const zSimpleFile = z.string(); + +export const zModelWithString = z.object({ + prop: z.string().optional() +}); + +export const zSimpleReference = zModelWithString; + +export const zSimpleStringWithPattern = z.union([ + z.string().max(64).regex(/^[a-zA-Z0-9_]*$/), + z.null() +]); + +export const zEnumWithStrings = z.enum([ + 'Success', + 'Warning', + 'Error', + "'Single Quote'", + '"Double Quotes"', + 'Non-ascii: øæåôöØÆÅÔÖ字符串' +]); + +export const zEnumWithReplacedCharacters = z.enum([ + "'Single Quote'", + '"Double Quotes"', + 'øæåôöØÆÅÔÖ字符串', + '' +]); + +export const zEnumWithNumbers = z.unknown(); + +export const zEnumFromDescription = z.number(); + +export const zEnumWithExtensions = z.unknown(); + +export const zEnumWithXEnumNames = z.unknown(); + +export const zArrayWithNumbers = z.array(z.number().int()); + +export const zArrayWithBooleans = z.array(z.boolean()); + +export const zArrayWithStrings = z.array(z.string()).default(['test']); + +export const zArrayWithReferences = z.array(zModelWithString); + +export const zArrayWithArray = z.array(z.array(zModelWithString)); + +export const zArrayWithProperties = z.array(z.object({ + '16x16': zCamelCaseCommentWithBreaks.optional(), + bar: z.string().optional() +})); + +export const zArrayWithAnyOfProperties = z.array(z.unknown()); + +export const zAnyOfAnyAndNull = z.object({ + data: z.union([ + z.unknown(), + z.null() + ]).optional() +}); + +export const zAnyOfArrays = z.object({ + results: z.array(z.unknown()).optional() +}); + +export const zDictionaryWithString = z.object({}); + +export const zDictionaryWithPropertiesAndAdditionalProperties = z.object({ + foo: z.number().optional(), + bar: z.boolean().optional() +}); + +export const zDictionaryWithReference = z.object({}); + +export const zDictionaryWithArray = z.object({}); + +export const zDictionaryWithDictionary = z.object({}); + +export const zDictionaryWithProperties = z.object({}); + +export const zModelWithInteger = z.object({ + prop: z.number().int().optional() +}); + +export const zModelWithBoolean = z.object({ + prop: z.boolean().optional() +}); + +export const zModelWithStringError = z.object({ + prop: z.string().optional() +}); + +export const zModelFromZendesk = z.string(); + +export const zModelWithNullableString = z.object({ + nullableProp1: z.union([ + z.string(), + z.null() + ]).optional(), + nullableRequiredProp1: z.union([ + z.string(), + z.null() + ]), + nullableProp2: z.union([ + z.string(), + z.null() + ]).optional(), + nullableRequiredProp2: z.union([ + z.string(), + z.null() + ]), + 'foo_bar-enum': z.enum([ + 'Success', + 'Warning', + 'Error', + 'ØÆÅ字符串' + ]).optional() +}); + +export const zModelWithEnum = z.object({ + 'foo_bar-enum': z.enum([ + 'Success', + 'Warning', + 'Error', + 'ØÆÅ字符串' + ]).optional(), + statusCode: z.enum([ + '100', + '200 FOO', + '300 FOO_BAR', + '400 foo-bar', + '500 foo.bar', + '600 foo&bar' + ]).optional(), + bool: z.unknown().optional() +}); + +export const zModelWithEnumWithHyphen = z.object({ + 'foo-bar-baz-qux': z.enum([ + '3.0' + ]).optional() +}); + +export const zModelWithEnumFromDescription = z.object({ + test: z.number().int().optional() +}); + +export const zModelWithNestedEnums = z.object({ + dictionaryWithEnum: z.object({}).optional(), + dictionaryWithEnumFromDescription: z.object({}).optional(), + arrayWithEnum: z.array(z.enum([ + 'Success', + 'Warning', + 'Error' + ])).optional(), + arrayWithDescription: z.array(z.number().int()).optional(), + 'foo_bar-enum': z.enum([ + 'Success', + 'Warning', + 'Error', + 'ØÆÅ字符串' + ]).optional() +}); + +export const zModelWithProperties = z.object({ + required: z.string(), + requiredAndReadOnly: z.string().readonly(), + requiredAndNullable: z.union([ + z.string(), + z.null() + ]), + string: z.string().optional(), + number: z.number().optional(), + boolean: z.boolean().optional(), + reference: zModelWithString.optional(), + 'property with space': z.string().optional(), + default: z.string().optional(), + try: z.string().optional(), + '@namespace.string': z.string().readonly().optional(), + '@namespace.integer': z.number().int().readonly().optional() +}); + +export const zModelWithReference = z.object({ + prop: zModelWithProperties.optional() +}); + +export const zModelWithReadOnlyAndWriteOnly = z.object({ + foo: z.string(), + bar: z.string().readonly(), + baz: z.string() +}); + +export const zModelWithArrayReadOnlyAndWriteOnly = z.object({ + prop: z.array(zModelWithReadOnlyAndWriteOnly).optional(), + propWithFile: z.array(z.string()).optional(), + propWithNumber: z.array(z.number()).optional() +}); + +export const zModelWithArray = z.object({ + prop: z.array(zModelWithString).optional(), + propWithFile: z.array(z.string()).optional(), + propWithNumber: z.array(z.number()).optional() +}); + +export const zModelWithDictionary = z.object({ + prop: z.object({}).optional() +}); + +export const zDeprecatedModel = z.object({ + prop: z.string().optional() +}); + +export const zModelWithCircularReference: z.AnyZodObject = z.object({ + prop: z.lazy(() => { + return zModelWithCircularReference; + }).optional() +}); + +export const zCompositionWithOneOf = z.object({ + propA: z.union([ + zModelWithString, + zModelWithEnum, + zModelWithArray, + zModelWithDictionary + ]).optional() +}); + +export const zCompositionWithOneOfAnonymous = z.object({ + propA: z.union([ + z.object({ + propA: z.string().optional() + }), + z.string(), + z.number().int() + ]).optional() +}); + +export const zModelCircle = z.object({ + kind: z.string(), + radius: z.number().optional() +}); + +export const zModelSquare = z.object({ + kind: z.string(), + sideLength: z.number().optional() +}); + +export const zCompositionWithOneOfDiscriminator = z.union([ + z.object({ + kind: z.literal('circle').optional() + }).merge(zModelCircle), + z.object({ + kind: z.literal('square').optional() + }).merge(zModelSquare) +]); + +export const zCompositionWithAnyOf = z.object({ + propA: z.union([ + zModelWithString, + zModelWithEnum, + zModelWithArray, + zModelWithDictionary + ]).optional() +}); + +export const zCompositionWithAnyOfAnonymous = z.object({ + propA: z.union([ + z.object({ + propA: z.string().optional() + }), + z.string(), + z.number().int() + ]).optional() +}); + +export const zCompositionWithNestedAnyAndTypeNull = z.object({ + propA: z.union([ + z.array(z.unknown()), + z.array(z.unknown()) + ]).optional() +}); + +export const z3eNum1Период = z.enum([ + 'Bird', + 'Dog' +]); + +export const zConstValue = z.literal('ConstValue'); + +export const zCompositionWithNestedAnyOfAndNull = z.object({ + propA: z.union([ + z.array(z.unknown()), + z.null() + ]).optional() +}); + +export const zCompositionWithOneOfAndNullable = z.object({ + propA: z.union([ + z.object({ + boolean: z.boolean().optional() + }), + zModelWithEnum, + zModelWithArray, + zModelWithDictionary, + z.null() + ]).optional() +}); + +export const zCompositionWithOneOfAndSimpleDictionary = z.object({ + propA: z.union([ + z.boolean(), + z.object({}) + ]).optional() +}); + +export const zCompositionWithOneOfAndSimpleArrayDictionary = z.object({ + propA: z.union([ + z.boolean(), + z.object({}) + ]).optional() +}); + +export const zCompositionWithOneOfAndComplexArrayDictionary = z.object({ + propA: z.union([ + z.boolean(), + z.object({}) + ]).optional() +}); + +export const zCompositionWithAllOfAndNullable = z.object({ + propA: z.union([ + z.object({ + boolean: z.boolean().optional() + }).merge(zModelWithEnum).merge(zModelWithArray).merge(zModelWithDictionary), + z.null() + ]).optional() +}); + +export const zCompositionWithAnyOfAndNullable = z.object({ + propA: z.union([ + z.object({ + boolean: z.boolean().optional() + }), + zModelWithEnum, + zModelWithArray, + zModelWithDictionary, + z.null() + ]).optional() +}); + +export const zCompositionBaseModel = z.object({ + firstName: z.string().optional(), + lastname: z.string().optional() +}); + +export const zCompositionExtendedModel = zCompositionBaseModel.merge(z.object({ + age: z.number(), + firstName: z.string(), + lastname: z.string() +})); + +export const zModelWithNestedProperties = z.object({ + first: z.union([ + z.object({ + second: z.union([ + z.object({ + third: z.union([ + z.string().readonly(), + z.null() + ]).readonly() + }).readonly(), + z.null() + ]).readonly() + }).readonly(), + z.null() + ]).readonly() +}); + +export const zModelWithDuplicateProperties = z.object({ + prop: zModelWithString.optional() +}); + +export const zModelWithOrderedProperties = z.object({ + zebra: z.string().optional(), + apple: z.string().optional(), + hawaii: z.string().optional() +}); + +export const zModelWithDuplicateImports = z.object({ + propA: zModelWithString.optional(), + propB: zModelWithString.optional(), + propC: zModelWithString.optional() +}); + +export const zModelThatExtends = zModelWithString.merge(z.object({ + propExtendsA: z.string().optional(), + propExtendsB: zModelWithString.optional() +})); + +export const zModelThatExtendsExtends = zModelWithString.merge(zModelThatExtends).merge(z.object({ + propExtendsC: z.string().optional(), + propExtendsD: zModelWithString.optional() +})); + +export const zModelWithPattern = z.object({ + key: z.string().max(64).regex(/^[a-zA-Z0-9_]*$/), + name: z.string().max(255), + enabled: z.boolean().readonly().optional(), + modified: z.string().datetime().readonly().optional(), + id: z.string().regex(/^\d{2}-\d{3}-\d{4}$/).optional(), + text: z.string().regex(/^\w+$/).optional(), + patternWithSingleQuotes: z.string().regex(/^[a-zA-Z0-9']*$/).optional(), + patternWithNewline: z.string().regex(/aaa\nbbb/).optional(), + patternWithBacktick: z.string().regex(/aaa`bbb/).optional() +}); + +export const zFile = z.object({ + id: z.string().min(1).readonly().optional(), + updated_at: z.string().datetime().readonly().optional(), + created_at: z.string().datetime().readonly().optional(), + mime: z.string().min(1).max(24), + file: z.string().url().readonly().optional() +}); + +export const zDefault = z.object({ + name: z.string().optional() +}); + +export const zPageable = z.object({ + page: z.number().int().gte(0).optional().default(0), + size: z.number().int().gte(1).optional(), + sort: z.array(z.string()).optional() +}); + +export const zFreeFormObjectWithoutAdditionalProperties = z.object({}); + +export const zFreeFormObjectWithAdditionalPropertiesEqTrue = z.object({}); + +export const zFreeFormObjectWithAdditionalPropertiesEqEmptyObject = z.object({}); + +export const zModelWithConst = z.object({ + String: z.literal('String').optional(), + number: z.literal(0).optional(), + null: z.null().optional(), + withType: z.literal('Some string').optional() +}); + +export const zModelWithAdditionalPropertiesEqTrue = z.object({ + prop: z.string().optional() +}); + +export const zNestedAnyOfArraysNullable = z.object({ + nullableArray: z.union([ + z.array(z.unknown()), + z.null() + ]).optional() +}); + +export const zSimpleParameter = z.unknown(); + +export const zCompositionWithOneOfAndProperties = z.intersection(z.union([ + z.object({ + foo: zSimpleParameter + }), + z.object({ + bar: zNonAsciiStringæøåÆøÅöôêÊ字符串 + }) +]), z.object({ + baz: z.union([ + z.number().int().gte(0), + z.null() + ]), + qux: z.number().int().gte(0) +})); + +export const zNullableObject = z.union([ + z.object({ + foo: z.string().optional() + }), + z.null() +]).default(null); + +export const zCharactersInDescription = z.string(); + +export const zModelWithNullableObject = z.object({ + data: zNullableObject.optional() +}); + +export const zModelWithOneOfEnum = z.union([ + z.object({ + foo: z.enum([ + 'Bar' + ]) + }), + z.object({ + foo: z.enum([ + 'Baz' + ]) + }), + z.object({ + foo: z.enum([ + 'Qux' + ]) + }), + z.object({ + content: z.string().datetime(), + foo: z.enum([ + 'Quux' + ]) + }), + z.object({ + content: z.unknown(), + foo: z.enum([ + 'Corge' + ]) + }) +]); + +export const zModelWithNestedArrayEnumsDataFoo = z.enum([ + 'foo', + 'bar' +]); + +export const zModelWithNestedArrayEnumsDataBar = z.enum([ + 'baz', + 'qux' +]); + +export const zModelWithNestedArrayEnumsData = z.object({ + foo: z.array(zModelWithNestedArrayEnumsDataFoo).optional(), + bar: z.array(zModelWithNestedArrayEnumsDataBar).optional() +}); + +export const zModelWithNestedArrayEnums = z.object({ + array_strings: z.array(z.string()).optional(), + data: zModelWithNestedArrayEnumsData.optional() +}); + +export const zModelWithNestedCompositionEnums = z.object({ + foo: zModelWithNestedArrayEnumsDataFoo.optional() +}); + +export const zModelWithConstantSizeArray = z.unknown(); + +export const zModelWithAnyOfConstantSizeArray = z.unknown(); + +export const zModelWithPrefixItemsConstantSizeArray = z.unknown(); + +export const zModelWithAnyOfConstantSizeArrayNullable = z.unknown(); + +export const zModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = z.unknown(); + +export const zModelWithAnyOfConstantSizeArrayAndIntersect = z.unknown(); + +export const zModelWithNumericEnumUnion = z.object({ + value: z.unknown().optional() +}); + +export const zModelWithBackticksInDescription = z.object({ + template: z.string().optional() +}); + +export const zModelWithOneOfAndProperties = z.intersection(z.union([ + zSimpleParameter, + zNonAsciiStringæøåÆøÅöôêÊ字符串 +]), z.object({ + baz: z.union([ + z.number().int().gte(0), + z.null() + ]), + qux: z.number().int().gte(0) +})); + +export const zParameterSimpleParameterUnused = z.string(); + +export const zPostServiceWithEmptyTagResponse = z.string(); + +export const zPostServiceWithEmptyTagResponse2 = z.string(); + +export const zDeleteFooData = z.string(); + +export const zDeleteFooData2 = z.string(); + +export const zImport = z.string(); + +export const zSchemaWithFormRestrictedKeys = z.object({ + description: z.string().optional(), + 'x-enum-descriptions': z.string().optional(), + 'x-enum-varnames': z.string().optional(), + 'x-enumNames': z.string().optional(), + title: z.string().optional(), + object: z.object({ + description: z.string().optional(), + 'x-enum-descriptions': z.string().optional(), + 'x-enum-varnames': z.string().optional(), + 'x-enumNames': z.string().optional(), + title: z.string().optional() + }).optional(), + array: z.array(z.object({ + description: z.string().optional(), + 'x-enum-descriptions': z.string().optional(), + 'x-enum-varnames': z.string().optional(), + 'x-enumNames': z.string().optional(), + title: z.string().optional() + })).optional() +}); + +export const zIoK8sApimachineryPkgApisMetaV1Preconditions = z.object({ + resourceVersion: z.string().optional(), + uid: z.string().optional() +}); + +export const zIoK8sApimachineryPkgApisMetaV1DeleteOptions = z.object({ + preconditions: zIoK8sApimachineryPkgApisMetaV1Preconditions.optional() +}); + +export const zAdditionalPropertiesUnknownIssue = z.object({}); + +export const zAdditionalPropertiesUnknownIssue2 = z.object({}); + +export const zAdditionalPropertiesUnknownIssue3 = z.intersection(z.string(), z.object({ + entries: z.object({}) +})); + +export const zAdditionalPropertiesIntegerIssue = z.object({ + value: z.number().int() +}); + +export const zGenericSchemaDuplicateIssue1SystemBoolean = z.object({ + item: z.boolean().optional(), + error: z.union([ + z.string(), + z.null() + ]).optional(), + hasError: z.boolean().readonly().optional(), + data: z.object({}).optional() +}); + +export const zGenericSchemaDuplicateIssue1SystemString = z.object({ + item: z.union([ + z.string(), + z.null() + ]).optional(), + error: z.union([ + z.string(), + z.null() + ]).optional(), + hasError: z.boolean().readonly().optional() +}); + +export const zOneOfAllOfIssue = z.union([ + z.intersection(z.union([ + zConstValue, + zGenericSchemaDuplicateIssue1SystemBoolean + ]), z3eNum1Период), + zGenericSchemaDuplicateIssue1SystemString +]); + +export const zImportResponse = z.union([ + zModelFromZendesk, + zModelWithReadOnlyAndWriteOnly +]); + +export const zApiVVersionODataControllerCountResponse = zModelFromZendesk; + +export const zGetApiVbyApiVersionSimpleOperationResponse = z.number(); + +export const zPostCallWithOptionalParamResponse = z.union([ + z.number(), + z.void() +]); + +export const zCallWithNoContentResponseResponse = z.void(); + +export const zCallWithResponseAndNoContentResponseResponse = z.union([ + z.number(), + z.void() +]); + +export const zDummyAResponse = z400; + +export const zDummyBResponse = z.void(); + +export const zCallWithResponseResponse = zImport; + +export const zCallWithDuplicateResponsesResponse = z.union([ + zModelWithBoolean.merge(zModelWithInteger), + zModelWithString +]); + +export const zCallWithResponsesResponse = z.union([ + z.object({ + '@namespace.string': z.string().readonly().optional(), + '@namespace.integer': z.number().int().readonly().optional(), + value: z.array(zModelWithString).readonly().optional() + }), + zModelThatExtends, + zModelThatExtendsExtends +]); + +export const zTypesResponse = z.union([ + z.number(), + z.string(), + z.boolean(), + z.object({}) +]); + +export const zUploadFileResponse = z.boolean(); + +export const zFileResponseResponse = z.string(); + +export const zComplexTypesResponse = z.array(zModelWithString); + +export const zMultipartResponseResponse = z.object({ + file: z.string().optional(), + metadata: z.object({ + foo: z.string().optional(), + bar: z.string().optional() + }).optional() +}); + +export const zComplexParamsResponse = zModelWithString; + +export const zNonAsciiæøåÆøÅöôêÊ字符串Response = z.array(zNonAsciiStringæøåÆøÅöôêÊ字符串); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/types.gen.ts new file mode 100644 index 000000000..310ad3e5f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/types.gen.ts @@ -0,0 +1,95 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type FooReadWriteReadable = BarReadReadable; + +export type FooReadWriteWritable = BarReadWritable & { + foo?: string; +}; + +export type FooReadReadable = BarReadReadable & { + readonly foo?: string; +}; + +export type FooReadWritable = BarReadWritable; + +export type FooWriteReadable = BarWriteReadable; + +export type FooWriteWritable = BarWriteWritable & { + foo?: string; +}; + +export type BarReadReadable = Baz | QuxAllWriteReadable | QuxAllReadReadable | { + readonly bar?: string; +}; + +export type BarReadWritable = Baz | QuxAllWriteWritable | QuxAllReadWritable; + +export type BarWriteReadable = Baz | QuxAllWriteReadable | QuxAllReadReadable; + +export type BarWriteWritable = Baz | QuxAllWriteWritable | QuxAllReadWritable | { + bar?: string; +}; + +export type Baz = { + baz?: string; +}; + +export type QuxAllWriteWritable = { + baz?: string; +}; + +export type QuxAllReadReadable = { + readonly baz?: string; +}; + +export type PostFooReadWriteData = { + body: FooReadWriteWritable; + path?: never; + query?: never; + url: '/foo-read-write'; +}; + +export type PostFooReadWriteResponses = { + /** + * OK + */ + 200: FooReadWriteReadable; +}; + +export type PostFooReadWriteResponse = PostFooReadWriteResponses[keyof PostFooReadWriteResponses]; + +export type PostFooReadData = { + body: FooReadWritable; + path?: never; + query?: never; + url: '/foo-read'; +}; + +export type PostFooReadResponses = { + /** + * OK + */ + 200: FooReadReadable; +}; + +export type PostFooReadResponse = PostFooReadResponses[keyof PostFooReadResponses]; + +export type PostFooWriteData = { + body: FooWriteWritable; + path?: never; + query?: never; + url: '/foo-write'; +}; + +export type PostFooWriteResponses = { + /** + * OK + */ + 200: FooWriteReadable; +}; + +export type PostFooWriteResponse = PostFooWriteResponses[keyof PostFooWriteResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/ref-type/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/ref-type/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/ref-type/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/ref-type/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/ref-type/types.gen.ts new file mode 100644 index 000000000..259cbcfaa --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/ref-type/types.gen.ts @@ -0,0 +1,31 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + foo: Array<{ + baz: Bar; + }>; +}; + +export type Bar = { + bar: number; +}; + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: Foo; +}; + +export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/required-all-of-ref/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/required-all-of-ref/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/required-all-of-ref/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/required-all-of-ref/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/required-all-of-ref/types.gen.ts new file mode 100644 index 000000000..bf9831f75 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/required-all-of-ref/types.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + foo?: string; + baz?: string; +}; + +export type Bar = Foo & { + bar: number; + foo: string; + baz: string; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/required-any-of-ref/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/required-any-of-ref/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/required-any-of-ref/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/required-any-of-ref/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/required-any-of-ref/types.gen.ts new file mode 100644 index 000000000..b001001df --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/required-any-of-ref/types.gen.ts @@ -0,0 +1,14 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + foo?: string; + baz?: string; +}; + +export type Bar = Foo & { + bar: number; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/required-one-of-ref/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/required-one-of-ref/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/required-one-of-ref/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/required-one-of-ref/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/required-one-of-ref/types.gen.ts new file mode 100644 index 000000000..b001001df --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/required-one-of-ref/types.gen.ts @@ -0,0 +1,14 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + foo?: string; + baz?: string; +}; + +export type Bar = Foo & { + bar: number; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/schema-const/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/schema-const/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/schema-const/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/schema-const/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/schema-const/types.gen.ts new file mode 100644 index 000000000..32a859497 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/schema-const/types.gen.ts @@ -0,0 +1,23 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + foo?: 'foo'; + bar?: 3.2; + baz?: -1; + qux?: true; + quux?: [ + 1, + 2, + 3, + 'foo', + true + ]; + corge?: { + [key: string]: unknown; + }; + garply?: 10n; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/schema-const/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/schema-const/zod.gen.ts new file mode 100644 index 000000000..808d0e91b --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/schema-const/zod.gen.ts @@ -0,0 +1,19 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { z } from 'zod'; + +export const zFoo = z.object({ + foo: z.literal('foo').optional(), + bar: z.literal(3.2).optional(), + baz: z.literal(-1).optional(), + qux: z.literal(true).optional(), + quux: z.tuple([ + z.literal(1), + z.literal(2), + z.literal(3), + z.literal('foo'), + z.literal(true) + ]).optional(), + corge: z.object({}).optional(), + garply: z.coerce.bigint().optional() +}); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/sdk.gen.ts new file mode 100644 index 000000000..033f5c32d --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/sdk.gen.ts @@ -0,0 +1,47 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { GetFooData, GetBarData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const getFoo = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + security: [ + { + in: 'query', + name: 'foo', + type: 'apiKey' + } + ], + url: '/foo', + ...options + }); +}; + +export const getBar = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + security: [ + { + in: 'cookie', + name: 'bar', + type: 'apiKey' + } + ], + url: '/bar', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/types.gen.ts new file mode 100644 index 000000000..a641918b4 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/types.gen.ts @@ -0,0 +1,33 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type GetBarData = { + body?: never; + path?: never; + query?: never; + url: '/bar'; +}; + +export type GetBarResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-false/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-false/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/security-false/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-false/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-false/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/security-false/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-false/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-false/sdk.gen.ts new file mode 100644 index 000000000..14ebd7036 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/security-false/sdk.gen.ts @@ -0,0 +1,26 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { GetFooData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const getFoo = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/foo', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-false/types.gen.ts new file mode 100644 index 000000000..884795c3f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/security-false/types.gen.ts @@ -0,0 +1,19 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/sdk.gen.ts new file mode 100644 index 000000000..bcb05a226 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/sdk.gen.ts @@ -0,0 +1,32 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { GetFooData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const getFoo = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + security: [ + { + scheme: 'bearer', + type: 'http' + } + ], + url: '/foo', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/types.gen.ts new file mode 100644 index 000000000..884795c3f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/types.gen.ts @@ -0,0 +1,19 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/sdk.gen.ts new file mode 100644 index 000000000..bcb05a226 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/sdk.gen.ts @@ -0,0 +1,32 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { GetFooData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const getFoo = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + security: [ + { + scheme: 'bearer', + type: 'http' + } + ], + url: '/foo', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/types.gen.ts new file mode 100644 index 000000000..884795c3f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/types.gen.ts @@ -0,0 +1,19 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/sdk.gen.ts new file mode 100644 index 000000000..bcb05a226 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/sdk.gen.ts @@ -0,0 +1,32 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; +import type { GetFooData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const getFoo = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + security: [ + { + scheme: 'bearer', + type: 'http' + } + ], + url: '/foo', + ...options + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/types.gen.ts new file mode 100644 index 000000000..884795c3f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/types.gen.ts @@ -0,0 +1,19 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/servers/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/servers/client.gen.ts new file mode 100644 index 000000000..89e76c00f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/servers/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'https://foo.com/v1' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/servers/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/servers/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/servers/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/servers/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/servers/types.gen.ts new file mode 100644 index 000000000..fa745dd45 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/servers/types.gen.ts @@ -0,0 +1,21 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: string; +}; + +export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; + +export type ClientOptions = { + baseUrl: 'https://foo.com/v1' | `${string}://${string}/v1` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/transformers.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/transformers.gen.ts new file mode 100644 index 000000000..0b520225d --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/transformers.gen.ts @@ -0,0 +1,35 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { GetFooResponse } from './types.gen'; + +const quxSchemaResponseTransformer = (data: any) => { + if (data.baz) { + data.baz = new Date(data.baz); + } + return data; +}; + +const bazSchemaResponseTransformer = (data: any) => { + data = quxSchemaResponseTransformer(data); + data.bar = new Date(data.bar); + return data; +}; + +const barSchemaResponseTransformer = (data: any) => { + data.foo = data.foo.map((item: any) => { + return bazSchemaResponseTransformer(item); + }); + return data; +}; + +const fooSchemaResponseTransformer = (data: any) => { + data.foo = data.foo.map((item: any) => { + return barSchemaResponseTransformer(item); + }); + return data; +}; + +export const getFooResponseTransformer = async (data: any): Promise => { + data = fooSchemaResponseTransformer(data); + return data; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/types.gen.ts new file mode 100644 index 000000000..25ae9771c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/types.gen.ts @@ -0,0 +1,46 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = { + foo: Array; +}; + +export type Bar = { + foo: Array; + bar: 'foo' | 'bar' | 'baz'; +}; + +export type Baz = Qux & { + id: 'Baz'; +} & { + foo: number; + bar: Date; + baz: 'foo' | 'bar' | 'baz'; + qux: number; +}; + +export type Qux = { + foo: number; + bar: number; + baz?: Date; + id: string; +}; + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: Foo; +}; + +export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/transformers.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/transformers.gen.ts new file mode 100644 index 000000000..15b043f4f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/transformers.gen.ts @@ -0,0 +1,40 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { GetFooResponse, NestedDateObjectResponse } from './types.gen'; + +const fooSchemaResponseTransformer = (data: any) => { + if (data.foo) { + data.foo = new Date(data.foo); + } + if (data.bar) { + data.bar = new Date(data.bar); + } + if (data.baz) { + data.baz = new Date(data.baz); + } + if (data.requiredQux) { + data.requiredQux = new Date(data.requiredQux); + } + return data; +}; + +export const getFooResponseTransformer = async (data: any): Promise => { + data = data.map((item: any) => { + return fooSchemaResponseTransformer(item); + }); + return data; +}; + +const nestedDateObjectSchemaResponseTransformer = (data: any) => { + if (data.foo) { + if (data.foo.bar) { + data.foo.bar = new Date(data.foo.bar); + } + } + return data; +}; + +export const nestedDateObjectResponseTransformer = async (data: any): Promise => { + data = nestedDateObjectSchemaResponseTransformer(data); + return data; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/types.gen.ts new file mode 100644 index 000000000..3bbe84e0e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/types.gen.ts @@ -0,0 +1,53 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Object with a nested date structure + */ +export type NestedDateObject = { + foo?: { + bar?: Date; + }; +}; + +export type Foo = { + foo?: Date; + bar?: Date | null; + baz?: Date | null; + requiredQux: Date | null; +}; + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: Array; +}; + +export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; + +export type NestedDateObjectData = { + body?: never; + path?: never; + query?: never; + url: '/api/nested-date-object'; +}; + +export type NestedDateObjectResponses = { + /** + * Object with nested date + */ + 200: NestedDateObject; +}; + +export type NestedDateObjectResponse = NestedDateObjectResponses[keyof NestedDateObjectResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/client.gen.ts new file mode 100644 index 000000000..6759c1f28 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/transformers.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/transformers.gen.ts new file mode 100644 index 000000000..5ad0b923d --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/transformers.gen.ts @@ -0,0 +1,11 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { GetFooResponse } from './types.gen'; + +export const getFooResponseTransformer = async (data: any): Promise => { + data.foo = data.foo.map((item: any) => { + item.baz = new Date(item.baz); + return item; + }); + return data; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/types.gen.ts new file mode 100644 index 000000000..6820b0d90 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/types.gen.ts @@ -0,0 +1,25 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetFooData = { + body?: never; + path?: never; + query?: never; + url: '/foo'; +}; + +export type GetFooResponses = { + /** + * OK + */ + 200: { + foo: Array<{ + baz: Date; + }>; + }; +}; + +export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/type-invalid/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/type-invalid/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/type-invalid/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/type-invalid/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/type-invalid/types.gen.ts new file mode 100644 index 000000000..2589e80df --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/type-invalid/types.gen.ts @@ -0,0 +1,7 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Foo = unknown; + +export type ClientOptions = { + baseUrl: `${string}://${string}` | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/validators/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/validators/zod.gen.ts new file mode 100644 index 000000000..6ac6de592 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/validators/zod.gen.ts @@ -0,0 +1,23 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { z } from 'zod'; + +export const zBar: z.AnyZodObject = z.object({ + foo: z.lazy(() => { + return zFoo; + }).optional() +}); + +export const zFoo: z.ZodTypeAny = z.union([ + z.object({ + foo: z.string().regex(/^\d{3}-\d{2}-\d{4}$/).optional(), + bar: zBar.optional(), + baz: z.array(z.lazy(() => { + return zFoo; + })).optional(), + qux: z.number().optional().default(0) + }), + z.null() +]).default(null); + +export const zBaz = z.string().regex(/foo\nbar/).readonly().default('baz'); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/zod-bigint-min-max/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/zod-bigint-min-max/zod.gen.ts new file mode 100644 index 000000000..5cd7bf827 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/zod-bigint-min-max/zod.gen.ts @@ -0,0 +1,7 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { z } from 'zod'; + +export const zFoo = z.object({ + foo: z.coerce.bigint().gte(0).lte(100).optional() +}); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/zod-circular-ref-2/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/zod-circular-ref-2/zod.gen.ts new file mode 100644 index 000000000..fe5c68cc8 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/zod-circular-ref-2/zod.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { z } from 'zod'; + +export const zBar: z.AnyZodObject = z.object({ + bar: z.union([ + z.array(z.lazy(() => { + return zBar; + })), + z.null() + ]) +}); + +export const zFoo: z.AnyZodObject = z.object({ + foo: zBar +}); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/zod-circular-ref/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/zod-circular-ref/zod.gen.ts new file mode 100644 index 000000000..b36b01adf --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/zod-circular-ref/zod.gen.ts @@ -0,0 +1,19 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { z } from 'zod'; + +export const zBar: z.AnyZodObject = z.object({ + bar: z.array(z.lazy(() => { + return zBar; + })).optional() +}); + +export const zFoo: z.AnyZodObject = z.object({ + foo: zBar.optional() +}); + +export const zQux: z.ZodTypeAny = z.lazy(() => { + return zQux; +}); + +export const zBaz: z.ZodTypeAny = zQux; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/zod-union-merge/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/zod-union-merge/zod.gen.ts new file mode 100644 index 000000000..071cc8af9 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/3.1.x/zod-union-merge/zod.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { z } from 'zod'; + +export const zBar = z.union([ + z.object({ + bar: z.string() + }), + z.object({ + baz: z.string() + }) +]); + +export const zFoo = zBar.merge(z.object({ + foo: z.string() +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/perf/client.gen.ts b/packages/openapi-ts-tests/test/generated/perf/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/perf/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/perf/index.ts b/packages/openapi-ts-tests/test/generated/perf/index.ts new file mode 100644 index 000000000..e64537d21 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/perf/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; +export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/perf/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/perf/sdk.gen.ts new file mode 100644 index 000000000..7f932711f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/perf/sdk.gen.ts @@ -0,0 +1,409 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; +import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; +import { client as _heyApiClient } from './client.gen'; + +export type Options = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +export const export_ = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const patchApiVbyApiVersionNoTag = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const import_ = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/no+tag', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const fooWow = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/no+tag', + ...options + }); +}; + +export const apiVVersionODataControllerCount = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple/$count', + ...options + }); +}; + +export const getApiVbyApiVersionSimpleOperation = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple:operation', + ...options + }); +}; + +export const deleteCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const getCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const headCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).head({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const optionsCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).options({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const patchCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).patch({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const postCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const putCallWithoutParametersAndResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/simple', + ...options + }); +}; + +export const deleteFoo = (options: Options) => { + return (options.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + ...options + }); +}; + +export const callWithDescriptions = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/descriptions', + ...options + }); +}; + +/** + * @deprecated + */ +export const deprecatedCall = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/deprecated', + ...options + }); +}; + +export const callWithParameters = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameterPath}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const callWithWeirdParameterNames = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const getCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postCallWithOptionalParam = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/parameters', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionRequestBody = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/requestBody', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +export const postApiVbyApiVersionFormData = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/formData', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const callWithDefaultParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callWithDefaultOptionalParameters = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const callToTestOrderOfParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/defaults', + ...options + }); +}; + +export const duplicateName = (options?: Options) => { + return (options?.client ?? _heyApiClient).delete({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName2 = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName3 = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const duplicateName4 = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/duplicate', + ...options + }); +}; + +export const callWithNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/no-content', + ...options + }); +}; + +export const callWithResponseAndNoContentResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/response-and-no-content', + ...options + }); +}; + +export const dummyA = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/a', + ...options + }); +}; + +export const dummyB = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multiple-tags/b', + ...options + }); +}; + +export const callWithResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithDuplicateResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const callWithResponses = (options?: Options) => { + return (options?.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/response', + ...options + }); +}; + +export const collectionFormat = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/collectionFormat', + ...options + }); +}; + +export const types = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/types', + ...options + }); +}; + +export const uploadFile = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/upload', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; + +export const fileResponse = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/file/{id}', + ...options + }); +}; + +export const complexTypes = (options: Options) => { + return (options.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/complex', + ...options + }); +}; + +export const multipartResponse = (options?: Options) => { + return (options?.client ?? _heyApiClient).get({ + url: '/api/v{api-version}/multipart', + ...options + }); +}; + +export const multipartRequest = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + ...formDataBodySerializer, + url: '/api/v{api-version}/multipart', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } + }); +}; + +export const complexParams = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + url: '/api/v{api-version}/complex/{id}', + ...options, + headers: { + 'Content-Type': 'application/json-patch+json', + ...options?.headers + } + }); +}; + +export const callWithResultFromHeader = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/header', + ...options + }); +}; + +export const testErrorCode = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/error', + ...options + }); +}; + +export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options + }); +}; + +/** + * Login User + */ +export const putWithFormUrlEncoded = (options: Options) => { + return (options.client ?? _heyApiClient).put({ + ...urlSearchParamsBodySerializer, + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/perf/types.gen.ts b/packages/openapi-ts-tests/test/generated/perf/types.gen.ts new file mode 100644 index 000000000..70cd1fa23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/perf/types.gen.ts @@ -0,0 +1,2033 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = Blob | File; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string | null; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: string | null; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceReadable = { + prop?: ModelWithPropertiesReadable; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReferenceWritable = { + prop?: ModelWithPropertiesWritable; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: ({ + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesReadable = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithPropertiesWritable = { + required: string; + requiredAndNullable: string | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedPropertiesReadable = { + readonly first: { + readonly second: { + readonly third: string | null; + } | null; + } | null; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternReadable = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPatternWritable = { + key: string; + name: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type FileReadable = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type FileWritable = { + mime: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number | null; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + string, + string + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnlyReadable = { + foo: string; + readonly bar: string; +}; + +export type ModelWithReadOnlyAndWriteOnlyWritable = { + foo: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | null | string, + number | null | string, + number | null | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number | null; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<{ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }>; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; + +export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; + +export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { + item?: boolean; + error?: string | null; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { + item?: boolean; + error?: string | null; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemStringReadable = { + item?: string | null; + error?: string | null; + readonly hasError?: boolean; +}; + +export type GenericSchemaDuplicateIssue1SystemStringWritable = { + item?: string | null; + error?: string | null; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnlyReadable; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + }; + url: '/api/v{api-version}/descriptions'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + } | null; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string | null; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string | null; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString | null; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string | null; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string | null; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number | null; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string | null; + /** + * This is a simple number with default value + */ + parameterNumber?: number | null; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string | null; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string | null; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName2Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName3Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateName4Data = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array | null; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string | null; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean | null; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is an array parameter + */ + parameterArray: Array | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error' | null; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: Blob | File; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string | null; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: Blob | File; +}; + +export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString | null; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + name: string | null; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array | null; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v2/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v2/core/ApiError.ts new file mode 100644 index 000000000..36675d288 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v2/core/ApiError.ts @@ -0,0 +1,21 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; + +export class ApiError extends Error { + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: unknown; + public readonly request: ApiRequestOptions; + + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); + + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v2/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v2/core/ApiRequestOptions.ts new file mode 100644 index 000000000..939a0aa4c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v2/core/ApiRequestOptions.ts @@ -0,0 +1,21 @@ +export type ApiRequestOptions = { + readonly body?: any; + readonly cookies?: Record; + readonly errors?: Record; + readonly formData?: Record | any[] | Blob | File; + readonly headers?: Record; + readonly mediaType?: string; + readonly method: + | 'DELETE' + | 'GET' + | 'HEAD' + | 'OPTIONS' + | 'PATCH' + | 'POST' + | 'PUT'; + readonly path?: Record; + readonly query?: Record; + readonly responseHeader?: string; + readonly responseTransformer?: (data: unknown) => Promise; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v2/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v2/core/ApiResult.ts new file mode 100644 index 000000000..4c58e3913 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v2/core/ApiResult.ts @@ -0,0 +1,7 @@ +export type ApiResult = { + readonly body: TData; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v2/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v2/core/CancelablePromise.ts new file mode 100644 index 000000000..ccc082e8f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v2/core/CancelablePromise.ts @@ -0,0 +1,126 @@ +export class CancelError extends Error { + constructor(message: string) { + super(message); + this.name = 'CancelError'; + } + + public get isCancelled(): boolean { + return true; + } +} + +export interface OnCancel { + readonly isResolved: boolean; + readonly isRejected: boolean; + readonly isCancelled: boolean; + + (cancelHandler: () => void): void; +} + +export class CancelablePromise implements Promise { + private _isResolved: boolean; + private _isRejected: boolean; + private _isCancelled: boolean; + readonly cancelHandlers: (() => void)[]; + readonly promise: Promise; + private _resolve?: (value: T | PromiseLike) => void; + private _reject?: (reason?: unknown) => void; + + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason?: unknown) => void, + onCancel: OnCancel + ) => void + ) { + this._isResolved = false; + this._isRejected = false; + this._isCancelled = false; + this.cancelHandlers = []; + this.promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + + const onResolve = (value: T | PromiseLike): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isResolved = true; + if (this._resolve) this._resolve(value); + }; + + const onReject = (reason?: unknown): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isRejected = true; + if (this._reject) this._reject(reason); + }; + + const onCancel = (cancelHandler: () => void): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this.cancelHandlers.push(cancelHandler); + }; + + Object.defineProperty(onCancel, 'isResolved', { + get: (): boolean => this._isResolved, + }); + + Object.defineProperty(onCancel, 'isRejected', { + get: (): boolean => this._isRejected, + }); + + Object.defineProperty(onCancel, 'isCancelled', { + get: (): boolean => this._isCancelled, + }); + + return executor(onResolve, onReject, onCancel as OnCancel); + }); + } + + get [Symbol.toStringTag]() { + return "Cancellable Promise"; + } + + public then( + onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null + ): Promise { + return this.promise.then(onFulfilled, onRejected); + } + + public catch( + onRejected?: ((reason: unknown) => TResult | PromiseLike) | null + ): Promise { + return this.promise.catch(onRejected); + } + + public finally(onFinally?: (() => void) | null): Promise { + return this.promise.finally(onFinally); + } + + public cancel(): void { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isCancelled = true; + if (this.cancelHandlers.length) { + try { + for (const cancelHandler of this.cancelHandlers) { + cancelHandler(); + } + } catch (error) { + console.warn('Cancellation threw an error', error); + return; + } + } + this.cancelHandlers.length = 0; + if (this._reject) this._reject(new CancelError('Request aborted')); + } + + public get isCancelled(): boolean { + return this._isCancelled; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v2/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v2/core/OpenAPI.ts new file mode 100644 index 000000000..144e25744 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v2/core/OpenAPI.ts @@ -0,0 +1,56 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; + +type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware): void { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Middleware): void { + this._fns = [...this._fns, fn]; + } +} + +export type OpenAPIConfig = { + BASE: string; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + VERSION: string; + WITH_CREDENTIALS: boolean; + interceptors: { + request: Interceptors; + response: Interceptors; + }; +}; + +export const OpenAPI: OpenAPIConfig = { + BASE: 'http://localhost:3000/base', + CREDENTIALS: 'include', + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + TOKEN: undefined, + USERNAME: undefined, + VERSION: '1.0', + WITH_CREDENTIALS: false, + interceptors: { + request: new Interceptors(), + response: new Interceptors(), + }, +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v2/core/request.ts b/packages/openapi-ts-tests/test/generated/v2/core/request.ts new file mode 100644 index 000000000..5458a2899 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v2/core/request.ts @@ -0,0 +1,350 @@ +import { ApiError } from './ApiError'; +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; +import { CancelablePromise } from './CancelablePromise'; +import type { OnCancel } from './CancelablePromise'; +import type { OpenAPIConfig } from './OpenAPI'; + +export const isString = (value: unknown): value is string => { + return typeof value === 'string'; +}; + +export const isStringWithValue = (value: unknown): value is string => { + return isString(value) && value !== ''; +}; + +export const isBlob = (value: any): value is Blob => { + return value instanceof Blob; +}; + +export const isFormData = (value: unknown): value is FormData => { + return value instanceof FormData; +}; + +export const base64 = (str: string): string => { + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } +}; + +export const getQueryString = (params: Record): string => { + const qs: string[] = []; + + const append = (key: string, value: unknown) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; + + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; + } + + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { + value.forEach(v => encodePair(key, v)); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); + } + }; + + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); + + return qs.length ? `?${qs.join('&')}` : ''; +}; + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI; + + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); + + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; +}; + +export const getFormData = (options: ApiRequestOptions): FormData | undefined => { + if (options.formData) { + const formData = new FormData(); + + const process = (key: string, value: unknown) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; + + Object.entries(options.formData) + .filter(([, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); + + return formData; + } + return undefined; +}; + +type Resolver = (options: ApiRequestOptions) => Promise; + +export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; +}; + +export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { + const [token, username, password, additionalHeaders] = await Promise.all([ + // @ts-ignore + resolve(options, config.TOKEN), + // @ts-ignore + resolve(options, config.USERNAME), + // @ts-ignore + resolve(options, config.PASSWORD), + // @ts-ignore + resolve(options, config.HEADERS), + ]); + + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + }) + .filter(([, value]) => value !== undefined && value !== null) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); + + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } + + return new Headers(headers); +}; + +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body !== undefined) { + if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { + return JSON.stringify(options.body); + } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { + return options.body; + } else { + return JSON.stringify(options.body); + } + } + return undefined; +}; + +export const sendRequest = async ( + config: OpenAPIConfig, + options: ApiRequestOptions, + url: string, + body: any, + formData: FormData | undefined, + headers: Headers, + onCancel: OnCancel +): Promise => { + const controller = new AbortController(); + + let request: RequestInit = { + headers, + body: body ?? formData, + method: options.method, + signal: controller.signal, + }; + + if (config.WITH_CREDENTIALS) { + request.credentials = config.CREDENTIALS; + } + + for (const fn of config.interceptors.request._fns) { + request = await fn(request); + } + + onCancel(() => controller.abort()); + + return await fetch(url, request); +}; + +export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { + if (responseHeader) { + const content = response.headers.get(responseHeader); + if (isString(content)) { + return content; + } + } + return undefined; +}; + +export const getResponseBody = async (response: Response): Promise => { + if (response.status !== 204) { + try { + const contentType = response.headers.get('Content-Type'); + if (contentType) { + const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; + if (contentType.includes('application/json') || contentType.includes('+json')) { + return await response.json(); + } else if (binaryTypes.some(type => contentType.includes(type))) { + return await response.blob(); + } else if (contentType.includes('multipart/form-data')) { + return await response.formData(); + } else if (contentType.includes('text/')) { + return await response.text(); + } + } + } catch (error) { + console.error(error); + } + } + return undefined; +}; + +export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Payload Too Large', + 414: 'URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Range Not Satisfiable', + 417: 'Expectation Failed', + 418: 'Im a teapot', + 421: 'Misdirected Request', + 422: 'Unprocessable Content', + 423: 'Locked', + 424: 'Failed Dependency', + 425: 'Too Early', + 426: 'Upgrade Required', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', + 451: 'Unavailable For Legal Reasons', + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 508: 'Loop Detected', + 510: 'Not Extended', + 511: 'Network Authentication Required', + ...options.errors, + } + + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } + + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } +}; + +/** + * Request method + * @param config The OpenAPI configuration object + * @param options The request options from the service + * @returns CancelablePromise + * @throws ApiError + */ +export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { + return new CancelablePromise(async (resolve, reject, onCancel) => { + try { + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); + const headers = await getHeaders(config, options); + + if (!onCancel.isCancelled) { + let response = await sendRequest(config, options, url, body, formData, headers, onCancel); + + for (const fn of config.interceptors.response._fns) { + response = await fn(response); + } + + const responseBody = await getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + + let transformedBody = responseBody; + if (options.responseTransformer && response.ok) { + transformedBody = await options.responseTransformer(responseBody) + } + + const result: ApiResult = { + url, + ok: response.ok, + status: response.status, + statusText: response.statusText, + body: responseHeader ?? transformedBody, + }; + + catchErrorCodes(options, result); + + resolve(result.body); + } + } catch (error) { + reject(error); + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v2/index.ts b/packages/openapi-ts-tests/test/generated/v2/index.ts new file mode 100644 index 000000000..50a1dd734 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v2/index.ts @@ -0,0 +1,6 @@ +// This file is auto-generated by @hey-api/openapi-ts +export { ApiError } from './core/ApiError'; +export { CancelablePromise, CancelError } from './core/CancelablePromise'; +export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v2/schemas.gen.ts b/packages/openapi-ts-tests/test/generated/v2/schemas.gen.ts new file mode 100644 index 000000000..8d4a5df9d --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v2/schemas.gen.ts @@ -0,0 +1,669 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export const CommentWithBreaksSchema = { + description: `Testing multiline comments in string: First line +Second line + +Fourth line`, + type: 'integer' +} as const; + +export const CommentWithBackticksSchema = { + description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work', + type: 'integer' +} as const; + +export const CommentWithBackticksAndQuotesSchema = { + description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`, + type: 'integer' +} as const; + +export const CommentWithSlashesSchema = { + description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work', + type: 'integer' +} as const; + +export const CommentWithExpressionPlaceholdersSchema = { + description: 'Testing expression placeholders in string: ${expression} should work', + type: 'integer' +} as const; + +export const CommentWithQuotesSchema = { + description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`, + type: 'integer' +} as const; + +export const CommentWithReservedCharactersSchema = { + description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work', + type: 'integer' +} as const; + +export const SimpleIntegerSchema = { + description: 'This is a simple number', + type: 'integer' +} as const; + +export const SimpleBooleanSchema = { + description: 'This is a simple boolean', + type: 'boolean' +} as const; + +export const SimpleStringSchema = { + description: 'This is a simple string', + type: 'string' +} as const; + +export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = { + description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)', + type: 'string' +} as const; + +export const SimpleFileSchema = { + description: 'This is a simple file', + type: 'file' +} as const; + +export const SimpleReferenceSchema = { + description: 'This is a simple reference', + '$ref': '#/definitions/ModelWithString' +} as const; + +export const SimpleStringWithPatternSchema = { + description: 'This is a simple string', + type: 'string', + maxLength: 64, + pattern: '^[a-zA-Z0-9_]*$' +} as const; + +export const EnumWithStringsSchema = { + description: 'This is a simple enum with strings', + enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串'] +} as const; + +export const EnumWithNumbersSchema = { + description: 'This is a simple enum with numbers', + enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3] +} as const; + +export const EnumFromDescriptionSchema = { + description: 'Success=1,Warning=2,Error=3', + type: 'number' +} as const; + +export const EnumWithExtensionsSchema = { + description: 'This is a simple enum with numbers', + enum: [200, 400, 500], + 'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'], + 'x-enum-descriptions': ['Used when the status of something is successful', 'Used when the status of something has a warning', 'Used when the status of something has an error'] +} as const; + +export const ArrayWithNumbersSchema = { + description: 'This is a simple array with numbers', + type: 'array', + items: { + type: 'integer' + } +} as const; + +export const ArrayWithBooleansSchema = { + description: 'This is a simple array with booleans', + type: 'array', + items: { + type: 'boolean' + } +} as const; + +export const ArrayWithStringsSchema = { + description: 'This is a simple array with strings', + type: 'array', + items: { + type: 'string' + } +} as const; + +export const ArrayWithReferencesSchema = { + description: 'This is a simple array with references', + type: 'array', + items: { + '$ref': '#/definitions/ModelWithString' + } +} as const; + +export const ArrayWithArraySchema = { + description: 'This is a simple array containing an array', + type: 'array', + items: { + type: 'array', + items: { + '$ref': '#/definitions/ModelWithString' + } + } +} as const; + +export const ArrayWithPropertiesSchema = { + description: 'This is a simple array with properties', + type: 'array', + items: { + type: 'object', + properties: { + foo: { + type: 'string' + }, + bar: { + type: 'string' + } + } + } +} as const; + +export const DictionaryWithStringSchema = { + description: 'This is a string dictionary', + type: 'object', + additionalProperties: { + type: 'string' + } +} as const; + +export const DictionaryWithReferenceSchema = { + description: 'This is a string reference', + type: 'object', + additionalProperties: { + '$ref': '#/definitions/ModelWithString' + } +} as const; + +export const DictionaryWithArraySchema = { + description: 'This is a complex dictionary', + type: 'object', + additionalProperties: { + type: 'array', + items: { + '$ref': '#/definitions/ModelWithString' + } + } +} as const; + +export const DictionaryWithDictionarySchema = { + description: 'This is a string dictionary', + type: 'object', + additionalProperties: { + type: 'object', + additionalProperties: { + type: 'string' + } + } +} as const; + +export const DictionaryWithPropertiesSchema = { + description: 'This is a complex dictionary', + type: 'object', + additionalProperties: { + type: 'object', + properties: { + foo: { + type: 'string' + }, + bar: { + type: 'string' + } + } + } +} as const; + +export const DateSchema = { + description: 'This is a type-only model that defines Date as a string', + type: 'string' +} as const; + +export const ModelWithIntegerSchema = { + description: 'This is a model with one number property', + type: 'object', + properties: { + prop: { + description: 'This is a simple number property', + type: 'integer' + } + } +} as const; + +export const ModelWithBooleanSchema = { + description: 'This is a model with one boolean property', + type: 'object', + properties: { + prop: { + description: 'This is a simple boolean property', + type: 'boolean' + } + } +} as const; + +export const ModelWithStringSchema = { + description: 'This is a model with one string property', + type: 'object', + properties: { + prop: { + description: 'This is a simple string property', + type: 'string' + } + } +} as const; + +export const ModelWithStringErrorSchema = { + description: 'This is a model with one string property', + type: 'object', + properties: { + prop: { + description: 'This is a simple string property', + type: 'string' + } + } +} as const; + +export const ModelWithNullableStringSchema = { + description: 'This is a model with one string property', + type: 'object', + required: ['nullableRequiredProp'], + properties: { + nullableProp: { + description: 'This is a simple string property', + type: 'string', + 'x-nullable': true + }, + nullableRequiredProp: { + description: 'This is a simple string property', + type: 'string', + 'x-nullable': true + } + } +} as const; + +export const ModelWithEnumSchema = { + description: 'This is a model with one enum', + type: 'object', + properties: { + test: { + description: 'This is a simple enum with strings', + enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + }, + statusCode: { + description: 'These are the HTTP error code enums', + enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar'] + }, + bool: { + description: 'Simple boolean enum', + type: 'boolean', + enum: [true] + } + } +} as const; + +export const ModelWithEnumFromDescriptionSchema = { + description: 'This is a model with one enum', + type: 'object', + properties: { + test: { + type: 'integer', + description: 'Success=1,Warning=2,Error=3' + } + } +} as const; + +export const ModelWithNestedEnumsSchema = { + description: 'This is a model with nested enums', + type: 'object', + properties: { + dictionaryWithEnum: { + type: 'object', + additionalProperties: { + enum: ['Success', 'Warning', 'Error'] + } + }, + dictionaryWithEnumFromDescription: { + type: 'object', + additionalProperties: { + type: 'integer', + description: 'Success=1,Warning=2,Error=3' + } + }, + arrayWithEnum: { + type: 'array', + items: { + enum: ['Success', 'Warning', 'Error'] + } + }, + arrayWithDescription: { + type: 'array', + items: { + type: 'integer', + description: 'Success=1,Warning=2,Error=3' + } + } + } +} as const; + +export const ModelWithReferenceSchema = { + description: 'This is a model with one property containing a reference', + type: 'object', + properties: { + prop: { + '$ref': '#/definitions/ModelWithProperties' + } + } +} as const; + +export const ModelWithArraySchema = { + description: 'This is a model with one property containing an array', + type: 'object', + properties: { + prop: { + type: 'array', + items: { + '$ref': '#/definitions/ModelWithString' + } + }, + propWithFile: { + type: 'array', + items: { + type: 'file' + } + }, + propWithNumber: { + type: 'array', + items: { + type: 'number' + } + } + } +} as const; + +export const ModelWithDictionarySchema = { + description: 'This is a model with one property containing a dictionary', + type: 'object', + properties: { + prop: { + type: 'object', + additionalProperties: { + type: 'string' + } + } + } +} as const; + +export const ModelWithCircularReferenceSchema = { + description: 'This is a model with one property containing a circular reference', + type: 'object', + properties: { + prop: { + '$ref': '#/definitions/ModelWithCircularReference' + } + } +} as const; + +export const ModelWithPropertiesSchema = { + description: 'This is a model with one nested property', + type: 'object', + required: ['required', 'requiredAndReadOnly'], + properties: { + required: { + type: 'string' + }, + requiredAndReadOnly: { + type: 'string', + readOnly: true + }, + string: { + type: 'string' + }, + number: { + type: 'number' + }, + boolean: { + type: 'boolean' + }, + reference: { + '$ref': '#/definitions/ModelWithString' + }, + 'property with space': { + type: 'string' + }, + default: { + type: 'string' + }, + try: { + type: 'string' + }, + '@namespace.string': { + type: 'string', + readOnly: true + }, + '@namespace.integer': { + type: 'integer', + readOnly: true + } + } +} as const; + +export const ModelWithNestedPropertiesSchema = { + description: 'This is a model with one nested property', + type: 'object', + required: ['first'], + properties: { + first: { + type: 'object', + required: ['second'], + readOnly: true, + properties: { + second: { + type: 'object', + required: ['third'], + readOnly: true, + properties: { + third: { + type: 'string', + readOnly: true + } + } + } + } + } + } +} as const; + +export const ModelWithDuplicatePropertiesSchema = { + description: 'This is a model with duplicated properties', + type: 'object', + properties: { + prop: { + '$ref': '#/definitions/ModelWithString' + } + } +} as const; + +export const ModelWithOrderedPropertiesSchema = { + description: 'This is a model with ordered properties', + type: 'object', + properties: { + zebra: { + type: 'string' + }, + apple: { + type: 'string' + }, + hawaii: { + type: 'string' + } + } +} as const; + +export const ModelWithDuplicateImportsSchema = { + description: 'This is a model with duplicated imports', + type: 'object', + properties: { + propA: { + '$ref': '#/definitions/ModelWithString' + }, + propB: { + '$ref': '#/definitions/ModelWithString' + }, + propC: { + '$ref': '#/definitions/ModelWithString' + } + } +} as const; + +export const ModelThatExtendsSchema = { + description: 'This is a model that extends another model', + type: 'object', + allOf: [ + { + '$ref': '#/definitions/ModelWithString' + }, + { + type: 'object', + properties: { + propExtendsA: { + type: 'string' + }, + propExtendsB: { + '$ref': '#/definitions/ModelWithString' + } + } + } + ] +} as const; + +export const ModelThatExtendsExtendsSchema = { + description: 'This is a model that extends another model', + type: 'object', + allOf: [ + { + '$ref': '#/definitions/ModelWithString' + }, + { + '$ref': '#/definitions/ModelThatExtends' + }, + { + type: 'object', + properties: { + propExtendsC: { + type: 'string' + }, + propExtendsD: { + '$ref': '#/definitions/ModelWithString' + } + } + } + ] +} as const; + +export const defaultSchema = { + type: 'object', + properties: { + name: { + type: 'string' + } + } +} as const; + +export const ModelWithPatternSchema = { + description: 'This is a model that contains a some patterns', + type: 'object', + required: ['key', 'name'], + properties: { + key: { + maxLength: 64, + pattern: '^[a-zA-Z0-9_]*$', + type: 'string' + }, + name: { + maxLength: 255, + type: 'string' + }, + enabled: { + type: 'boolean', + readOnly: true + }, + modified: { + type: 'string', + format: 'date-time', + readOnly: true + }, + id: { + type: 'string', + pattern: '^\\d{2}-\\d{3}-\\d{4}$' + }, + text: { + type: 'string', + pattern: '^\\w+$' + }, + patternWithSingleQuotes: { + type: 'string', + pattern: "^[a-zA-Z0-9']*$" + }, + patternWithNewline: { + type: 'string', + pattern: 'aaa\\nbbb' + }, + patternWithBacktick: { + type: 'string', + pattern: 'aaa`bbb' + } + } +} as const; + +export const parameter_ActivityParamsSchema = { + type: 'object', + properties: { + description: { + type: 'string' + }, + graduate_id: { + type: 'integer' + }, + organization_id: { + type: 'integer' + }, + parent_activity: { + type: 'integer' + }, + post_id: { + type: 'integer' + } + } +} as const; + +export const response_PostActivityResponseSchema = { + type: 'object', + properties: { + description: { + type: 'string' + }, + graduate_id: { + type: 'integer' + }, + organization_id: { + type: 'integer' + }, + parent_activity_id: { + type: 'integer' + }, + post_id: { + type: 'integer' + } + } +} as const; + +export const failure_FailureSchema = { + type: 'object', + properties: { + error: { + type: 'string' + }, + message: { + type: 'string' + }, + reference_code: { + type: 'string' + } + } +} as const; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v2/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v2/sdk.gen.ts new file mode 100644 index 000000000..4bf5c91f3 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v2/sdk.gen.ts @@ -0,0 +1,658 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CancelablePromise } from './core/CancelablePromise'; +import { OpenAPI } from './core/OpenAPI'; +import { request as __request } from './core/request'; +import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, PatchApiNoTagResponse, FooWowResponse, PostApiBodyData, PostApiBodyResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, CallWithResultFromHeaderResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, TypesData, TypesResponse } from './types.gen'; + +export class CollectionFormatService { + /** + * @param data The data for the request. + * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) + * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) + * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) + * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) + * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) + * @throws ApiError + */ + public static collectionFormat(data: CollectionFormatData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/collectionFormat', + query: { + parameterArrayCSV: data.parameterArrayCsv, + parameterArraySSV: data.parameterArraySsv, + parameterArrayTSV: data.parameterArrayTsv, + parameterArrayPipes: data.parameterArrayPipes, + parameterArrayMulti: data.parameterArrayMulti + } + }); + } + +} + +export class ComplexService { + /** + * @param data The data for the request. + * @param data.parameterObject Parameter containing object + * @param data.parameterReference Parameter containing reference + * @returns ModelWithString Successful response + * @throws ApiError + */ + public static complexTypes(data: ComplexTypesData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/complex', + query: { + parameterObject: data.parameterObject, + parameterReference: data.parameterReference + }, + errors: { + 400: '400 server error', + 500: '500 server error' + } + }); + } + +} + +export class DefaultService { + /** + * @throws ApiError + */ + public static serviceWithEmptyTag(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public static patchApiNoTag(): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public static fooWow(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * Body should not be unknown + * Body should not be unknown + * @param data The data for the request. + * @param data.request Body should not be unknown + * @returns response_PostActivityResponse OK + * @throws ApiError + */ + public static postApiBody(data: PostApiBodyData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/body', + body: data.request, + errors: { + 400: 'Bad Request', + 500: 'Internal Server Error' + } + }); + } + +} + +export class DefaultsService { + /** + * @param data The data for the request. + * @param data.parameterString This is a simple string with default value + * @param data.parameterNumber This is a simple number with default value + * @param data.parameterBoolean This is a simple boolean with default value + * @param data.parameterEnum This is a simple enum with default value + * @param data.parameterModel This is a simple model with default value + * @throws ApiError + */ + public static callWithDefaultParameters(data: CallWithDefaultParametersData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterString This is a simple string that is optional with default value + * @param data.parameterNumber This is a simple number that is optional with default value + * @param data.parameterBoolean This is a simple boolean that is optional with default value + * @param data.parameterEnum This is a simple enum that is optional with default value + * @param data.parameterModel This is a simple model that is optional with default value + * @throws ApiError + */ + public static callWithDefaultOptionalParameters(data: CallWithDefaultOptionalParametersData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterStringWithNoDefault This is a string with no default + * @param data.parameterOptionalStringWithDefault This is a optional string with default + * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default + * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default + * @param data.parameterStringWithDefault This is a string with default + * @param data.parameterStringWithEmptyDefault This is a string with empty default + * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default + * @param data.parameterStringNullableWithDefault This is a string that can be null with default + * @throws ApiError + */ + public static callToTestOrderOfParams(data: CallToTestOrderOfParamsData): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/defaults', + query: { + parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, + parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, + parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, + parameterStringWithDefault: data.parameterStringWithDefault, + parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, + parameterStringWithNoDefault: data.parameterStringWithNoDefault, + parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, + parameterStringNullableWithDefault: data.parameterStringNullableWithDefault + } + }); + } + +} + +export class DescriptionsService { + /** + * @param data The data for the request. + * @param data.parameterWithBreaks Testing multiline comments in string: First line + * Second line + * + * Fourth line + * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work + * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work + * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work + * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work + * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work + * @throws ApiError + */ + public static callWithDescriptions(data: CallWithDescriptionsData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/descriptions/', + query: { + parameterWithBreaks: data.parameterWithBreaks, + parameterWithBackticks: data.parameterWithBackticks, + parameterWithSlashes: data.parameterWithSlashes, + parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders, + parameterWithQuotes: data.parameterWithQuotes, + parameterWithReservedCharacters: data.parameterWithReservedCharacters + } + }); + } + +} + +export class DuplicateService { + /** + * @throws ApiError + */ + public static duplicateName(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public static duplicateName1(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public static duplicateName2(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public static duplicateName3(): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/duplicate' + }); + } + +} + +export class ErrorService { + /** + * @param data The data for the request. + * @param data.status Status code to return + * @returns unknown Custom message: Successful response + * @throws ApiError + */ + public static testErrorCode(data: TestErrorCodeData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/error', + query: { + status: data.status + }, + errors: { + 500: 'Custom message: Internal Server Error', + 501: 'Custom message: Not Implemented', + 502: 'Custom message: Bad Gateway', + 503: 'Custom message: Service Unavailable' + } + }); + } + +} + +export class HeaderService { + /** + * @returns string Successful response + * @throws ApiError + */ + public static callWithResultFromHeader(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/header', + responseHeader: 'operation-location', + errors: { + 400: '400 server error', + 500: '500 server error' + } + }); + } + +} + +export class MultipleTags1Service { + /** + * @returns void Success + * @throws ApiError + */ + public static dummyA(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/a' + }); + } + + /** + * @returns void Success + * @throws ApiError + */ + public static dummyB(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class MultipleTags2Service { + /** + * @returns void Success + * @throws ApiError + */ + public static dummyA(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/a' + }); + } + + /** + * @returns void Success + * @throws ApiError + */ + public static dummyB(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class MultipleTags3Service { + /** + * @returns void Success + * @throws ApiError + */ + public static dummyB(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class NoContentService { + /** + * @returns void Success + * @throws ApiError + */ + public static callWithNoContentResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/no-content' + }); + } + + /** + * @returns unknown Response is a simple number + * @returns void Success + * @throws ApiError + */ + public static callWithResponseAndNoContentResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/response-and-no-content' + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + /** + * @param data The data for the request. + * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param + * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response + * @throws ApiError + */ + public static nonAsciiæøåÆøÅöôêÊ字符串(data: NonAsciiæøåÆøÅöôêÊ字符串Data): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + query: { + 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ + } + }); + } + +} + +export class ParametersService { + /** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the header + * @param data.parameterQuery This is the parameter that goes into the query params + * @param data.parameterForm This is the parameter that goes into the form data + * @param data.parameterBody This is the parameter that is sent as request body + * @param data.parameterPath This is the parameter that goes into the path + * @throws ApiError + */ + public static callWithParameters(data: CallWithParametersData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/{parameterPath}', + path: { + parameterPath: data.parameterPath + }, + headers: { + parameterHeader: data.parameterHeader + }, + query: { + parameterQuery: data.parameterQuery + }, + formData: { + parameterForm: data.parameterForm + }, + body: data.parameterBody + }); + } + + /** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the request header + * @param data.parameterQuery This is the parameter that goes into the request query params + * @param data.parameterForm This is the parameter that goes into the request form data + * @param data.parameterBody This is the parameter that is sent as request body + * @param data.parameterPath1 This is the parameter that goes into the path + * @param data.parameterPath2 This is the parameter that goes into the path + * @param data.parameterPath3 This is the parameter that goes into the path + * @param data._default This is the parameter with a reserved keyword + * @throws ApiError + */ + public static callWithWeirdParameterNames(data: CallWithWeirdParameterNamesData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + path: { + 'parameter.path.1': data.parameterPath1, + 'parameter-path-2': data.parameterPath2, + 'PARAMETER-PATH-3': data.parameterPath3 + }, + headers: { + 'parameter.header': data.parameterHeader + }, + query: { + default: data._default, + 'parameter-query': data.parameterQuery + }, + formData: { + parameter_form: data.parameterForm + }, + body: data.parameterBody + }); + } + +} + +export class ResponseService { + /** + * @returns unknown Response is a simple number + * @returns void Success + * @throws ApiError + */ + public static callWithResponseAndNoContentResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/response-and-no-content' + }); + } + + /** + * @returns ModelWithString Message for default response + * @throws ApiError + */ + public static callWithResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/response' + }); + } + + /** + * @returns ModelWithString Message for 201 response + * @returns ModelWithString Message for 202 response + * @throws ApiError + */ + public static callWithDuplicateResponses(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/response', + errors: { + 500: 'Message for 500 error', + 501: 'Message for 501 error', + 502: 'Message for 502 error', + default: 'Message for default response' + } + }); + } + + /** + * @returns unknown Message for 200 response + * @returns ModelThatExtends Message for 201 response + * @returns ModelThatExtendsExtends Message for 202 response + * @throws ApiError + */ + public static callWithResponses(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/response', + errors: { + 500: 'Message for 500 error', + 501: 'Message for 501 error', + 502: 'Message for 502 error', + default: 'Message for default response' + } + }); + } + +} + +export class SimpleService { + /** + * @throws ApiError + */ + public static getCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static putCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static postCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static deleteCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static optionsCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'OPTIONS', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static headCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'HEAD', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static patchCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v{api-version}/simple' + }); + } + +} + +export class TypesService { + /** + * @param data The data for the request. + * @param data.parameterArray This is an array parameter + * @param data.parameterDictionary This is a dictionary parameter + * @param data.parameterEnum This is an enum parameter + * @param data.parameterNumber This is a number parameter + * @param data.parameterString This is a string parameter + * @param data.parameterBoolean This is a boolean parameter + * @param data.parameterObject This is an object parameter + * @param data.id This is a number parameter + * @returns number Response is a simple number + * @returns string Response is a simple string + * @returns boolean Response is a simple boolean + * @returns unknown Response is a simple object + * @throws ApiError + */ + public static types(data: TypesData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/types', + path: { + id: data.id + }, + query: { + parameterNumber: data.parameterNumber, + parameterString: data.parameterString, + parameterBoolean: data.parameterBoolean, + parameterObject: data.parameterObject, + parameterArray: data.parameterArray, + parameterDictionary: data.parameterDictionary, + parameterEnum: data.parameterEnum + } + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v2/types.gen.ts b/packages/openapi-ts-tests/test/generated/v2/types.gen.ts new file mode 100644 index 000000000..bf8b547d5 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v2/types.gen.ts @@ -0,0 +1,762 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _default = { + name?: string; +}; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array<(boolean)>; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array<(number)>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + foo?: string; + bar?: string; +}>; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array<(string)>; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * This is a type-only model that defines Date as a string + */ +export type Date = string; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: (string); + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: (string); +}; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple enum with numbers + */ +export const EnumWithExtensions = { + /** + * Used when the status of something is successful + */ + CUSTOM_SUCCESS: 200, + /** + * Used when the status of something has a warning + */ + CUSTOM_WARNING: 400, + /** + * Used when the status of something has an error + */ + CUSTOM_ERROR: 500 +} as const; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * This is a simple enum with numbers + */ +export const EnumWithNumbers = { + '_1': 1, + '_2': 2, + '_3': 3, + '_1.1': 1.1, + '_1.2': 1.2, + '_1.3': 1.3, + '_100': 100, + '_200': 200, + '_300': 300, + '_-100': -100, + '_-200': -200, + '_-300': -300, + '_-1.1': -1.1, + '_-1.2': -1.2, + '_-1.3': -1.3 +} as const; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with strings + */ +export const EnumWithStrings = { + SUCCESS: 'Success', + WARNING: 'Warning', + ERROR: 'Error', + _SINGLE_QUOTE_: "'Single Quote'", + _DOUBLE_QUOTES_: '"Double Quotes"', + 'NON_ASCII__ØÆÅÔÖ_ØÆÅÔÖ字符串': 'Non-ascii: øæåôöØÆÅÔÖ字符串' +} as const; + +export type failure_Failure = { + error?: string; + message?: string; + reference_code?: string; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: (string); + }; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: boolean; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: ('Success' | 'Warning' | 'Error'); + }; + dictionaryWithEnumFromDescription?: { + [key: string]: (number); + }; + arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; + arrayWithDescription?: Array<(number)>; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedProperties = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp: (string) | null; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPattern = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithProperties = { + required: string; + readonly requiredAndReadOnly: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReference = { + prop?: ModelWithProperties; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; + +export type parameter_ActivityParams = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity?: number; + post_id?: number; +}; + +export type response_PostActivityResponse = { + description?: string; + graduate_id?: number; + organization_id?: number; + parent_activity_id?: number; + post_id?: number; +}; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple file + */ +export type SimpleFile = (Blob | File); + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +export type CollectionFormatData = { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCsv: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySsv: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTsv: Array; +}; + +export type ComplexTypesData = { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; +}; + +export type ComplexTypesResponse = (Array); + +export type PatchApiNoTagResponse = (unknown); + +export type FooWowResponse = (unknown); + +export type PostApiBodyData = { + /** + * Body should not be unknown + */ + request: parameter_ActivityParams; +}; + +export type PostApiBodyResponse = (response_PostActivityResponse); + +export type CallWithDefaultParametersData = { + /** + * This is a simple boolean with default value + */ + parameterBoolean: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel: ModelWithString; + /** + * This is a simple number with default value + */ + parameterNumber: number; + /** + * This is a simple string with default value + */ + parameterString: string; +}; + +export type CallWithDefaultOptionalParametersData = { + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; +}; + +export type CallToTestOrderOfParamsData = { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: (string) | null; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: (string) | null; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; +}; + +export type CallWithDescriptionsData = { + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: string; + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: string; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: string; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: string; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: string; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: string; +}; + +export type TestErrorCodeData = { + /** + * Status code to return + */ + status: string; +}; + +export type TestErrorCodeResponse = (unknown); + +export type CallWithResultFromHeaderResponse = (string); + +export type DummyAResponse = (void); + +export type DummyBResponse = (void); + +export type CallWithNoContentResponseResponse = (void); + +export type CallWithResponseAndNoContentResponseResponse = (unknown | void); + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + /** + * Dummy input param + */ + nonAsciiParamæøåÆøÅöôêÊ: number; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = (NonAsciiStringæøåÆØÅöôêÊ字符串); + +export type CallWithParametersData = { + /** + * This is the parameter that is sent as request body + */ + parameterBody: string; + /** + * This is the parameter that goes into the form data + */ + parameterForm: string; + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * This is the parameter that goes into the query params + */ + parameterQuery: string; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter with a reserved keyword + */ + _default?: string; + /** + * This is the parameter that is sent as request body + */ + parameterBody: string; + /** + * This is the parameter that goes into the request form data + */ + parameterForm: string; + /** + * This is the parameter that goes into the request header + */ + parameterHeader: string; + /** + * This is the parameter that goes into the path + */ + parameterPath1?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath2?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath3?: string; + /** + * This is the parameter that goes into the request query params + */ + parameterQuery: string; +}; + +export type CallWithResponseResponse = (ModelWithString); + +export type CallWithDuplicateResponsesResponse = (ModelWithString); + +export type CallWithResponsesResponse = ({ + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; +} | ModelThatExtends | ModelThatExtendsExtends); + +export type TypesData = { + /** + * This is a number parameter + */ + id?: number; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: string; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is an object parameter + */ + parameterObject: unknown; + /** + * This is a string parameter + */ + parameterString: string; +}; + +export type TypesResponse = (number | string | boolean | unknown); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3-schemas-form/schemas.gen.ts b/packages/openapi-ts-tests/test/generated/v3-schemas-form/schemas.gen.ts new file mode 100644 index 000000000..d3a5b2a23 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3-schemas-form/schemas.gen.ts @@ -0,0 +1,1834 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export const _400Schema = { + type: 'string' +} as const; + +export const camelCaseCommentWithBreaksSchema = { + type: 'integer' +} as const; + +export const CommentWithBreaksSchema = { + type: 'integer' +} as const; + +export const CommentWithBackticksSchema = { + type: 'integer' +} as const; + +export const CommentWithBackticksAndQuotesSchema = { + type: 'integer' +} as const; + +export const CommentWithSlashesSchema = { + type: 'integer' +} as const; + +export const CommentWithExpressionPlaceholdersSchema = { + type: 'integer' +} as const; + +export const CommentWithQuotesSchema = { + type: 'integer' +} as const; + +export const CommentWithReservedCharactersSchema = { + type: 'integer' +} as const; + +export const SimpleIntegerSchema = { + type: 'integer' +} as const; + +export const SimpleBooleanSchema = { + type: 'boolean' +} as const; + +export const SimpleStringSchema = { + type: 'string' +} as const; + +export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = { + type: 'string' +} as const; + +export const SimpleFileSchema = { + type: 'file' +} as const; + +export const SimpleReferenceSchema = { + '$ref': '#/components/schemas/ModelWithString' +} as const; + +export const SimpleStringWithPatternSchema = { + type: 'string', + nullable: true, + maxLength: 64, + pattern: '^[a-zA-Z0-9_]*$' +} as const; + +export const EnumWithStringsSchema = { + enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串'] +} as const; + +export const EnumWithReplacedCharactersSchema = { + enum: ["'Single Quote'", '"Double Quotes"', 'øæåôöØÆÅÔÖ字符串', 3.1, ''], + type: 'string' +} as const; + +export const EnumWithNumbersSchema = { + enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3], + default: 200 +} as const; + +export const EnumFromDescriptionSchema = { + type: 'number' +} as const; + +export const EnumWithExtensionsSchema = { + enum: [200, 400, 500] +} as const; + +export const EnumWithXEnumNamesSchema = { + enum: [0, 1, 2] +} as const; + +export const ArrayWithNumbersSchema = { + type: 'array', + items: { + type: 'integer' + } +} as const; + +export const ArrayWithBooleansSchema = { + type: 'array', + items: { + type: 'boolean' + } +} as const; + +export const ArrayWithStringsSchema = { + type: 'array', + items: { + type: 'string' + }, + default: ['test'] +} as const; + +export const ArrayWithReferencesSchema = { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithString' + } +} as const; + +export const ArrayWithArraySchema = { + type: 'array', + items: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithString' + } + } +} as const; + +export const ArrayWithPropertiesSchema = { + type: 'array', + items: { + type: 'object', + properties: { + '16x16': { + '$ref': '#/components/schemas/camelCaseCommentWithBreaks' + }, + bar: { + type: 'string' + } + } + } +} as const; + +export const ArrayWithAnyOfPropertiesSchema = { + type: 'array', + items: { + anyOf: [ + { + type: 'object', + properties: { + foo: { + type: 'string', + default: 'test' + } + } + }, + { + type: 'object', + properties: { + bar: { + type: 'string' + } + } + } + ] + } +} as const; + +export const AnyOfAnyAndNullSchema = { + type: 'object', + properties: { + data: { + anyOf: [ + {}, + { + type: 'null' + } + ] + } + } +} as const; + +export const AnyOfArraysSchema = { + type: 'object', + properties: { + results: { + items: { + anyOf: [ + { + type: 'object', + properties: { + foo: { + type: 'string' + } + } + }, + { + type: 'object', + properties: { + bar: { + type: 'string' + } + } + } + ] + }, + type: 'array' + } + } +} as const; + +export const DictionaryWithStringSchema = { + type: 'object', + additionalProperties: { + type: 'string' + } +} as const; + +export const DictionaryWithPropertiesAndAdditionalPropertiesSchema = { + type: 'object', + properties: { + foo: { + type: 'number' + }, + bar: { + type: 'boolean' + } + }, + additionalProperties: { + type: 'string' + } +} as const; + +export const DictionaryWithReferenceSchema = { + type: 'object', + additionalProperties: { + '$ref': '#/components/schemas/ModelWithString' + } +} as const; + +export const DictionaryWithArraySchema = { + type: 'object', + additionalProperties: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithString' + } + } +} as const; + +export const DictionaryWithDictionarySchema = { + type: 'object', + additionalProperties: { + type: 'object', + additionalProperties: { + type: 'string' + } + } +} as const; + +export const DictionaryWithPropertiesSchema = { + type: 'object', + additionalProperties: { + type: 'object', + properties: { + foo: { + type: 'string' + }, + bar: { + type: 'string' + } + } + } +} as const; + +export const ModelWithIntegerSchema = { + type: 'object', + properties: { + prop: { + type: 'integer' + } + } +} as const; + +export const ModelWithBooleanSchema = { + type: 'object', + properties: { + prop: { + type: 'boolean' + } + } +} as const; + +export const ModelWithStringSchema = { + type: 'object', + properties: { + prop: { + type: 'string' + } + } +} as const; + +export const ModelWithStringErrorSchema = { + type: 'object', + properties: { + prop: { + type: 'string' + } + } +} as const; + +export const Model_From_ZendeskSchema = { + type: 'string' +} as const; + +export const ModelWithNullableStringSchema = { + type: 'object', + required: ['nullableRequiredProp1', 'nullableRequiredProp2'], + properties: { + nullableProp1: { + type: 'string', + nullable: true + }, + nullableRequiredProp1: { + type: 'string', + nullable: true + }, + nullableProp2: { + type: ['string', 'null'] + }, + nullableRequiredProp2: { + type: ['string', 'null'] + }, + 'foo_bar-enum': { + enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + } + } +} as const; + +export const ModelWithEnumSchema = { + type: 'object', + properties: { + 'foo_bar-enum': { + enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + }, + statusCode: { + enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar'] + }, + bool: { + type: 'boolean', + enum: [true] + } + } +} as const; + +export const ModelWithEnumWithHyphenSchema = { + type: 'object', + properties: { + 'foo-bar-baz-qux': { + type: 'string', + enum: ['3.0'], + default: '3.0' + } + } +} as const; + +export const ModelWithEnumFromDescriptionSchema = { + type: 'object', + properties: { + test: { + type: 'integer' + } + } +} as const; + +export const ModelWithNestedEnumsSchema = { + type: 'object', + properties: { + dictionaryWithEnum: { + type: 'object', + additionalProperties: { + enum: ['Success', 'Warning', 'Error'] + } + }, + dictionaryWithEnumFromDescription: { + type: 'object', + additionalProperties: { + type: 'integer' + } + }, + arrayWithEnum: { + type: 'array', + items: { + enum: ['Success', 'Warning', 'Error'] + } + }, + arrayWithDescription: { + type: 'array', + items: { + type: 'integer' + } + }, + 'foo_bar-enum': { + enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + } + } +} as const; + +export const ModelWithReferenceSchema = { + type: 'object', + properties: { + prop: { + '$ref': '#/components/schemas/ModelWithProperties' + } + } +} as const; + +export const ModelWithArrayReadOnlyAndWriteOnlySchema = { + type: 'object', + properties: { + prop: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnly' + } + }, + propWithFile: { + type: 'array', + items: { + type: 'file' + } + }, + propWithNumber: { + type: 'array', + items: { + type: 'number' + } + } + } +} as const; + +export const ModelWithArraySchema = { + type: 'object', + properties: { + prop: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithString' + } + }, + propWithFile: { + type: 'array', + items: { + type: 'file' + } + }, + propWithNumber: { + type: 'array', + items: { + type: 'number' + } + } + } +} as const; + +export const ModelWithDictionarySchema = { + type: 'object', + properties: { + prop: { + type: 'object', + additionalProperties: { + type: 'string' + } + } + } +} as const; + +export const DeprecatedModelSchema = { + deprecated: true, + type: 'object', + properties: { + prop: { + deprecated: true, + type: 'string' + } + } +} as const; + +export const ModelWithCircularReferenceSchema = { + type: 'object', + properties: { + prop: { + '$ref': '#/components/schemas/ModelWithCircularReference' + } + } +} as const; + +export const CompositionWithOneOfSchema = { + type: 'object', + properties: { + propA: { + type: 'object', + oneOf: [ + { + '$ref': '#/components/schemas/ModelWithString' + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const CompositionWithOneOfAnonymousSchema = { + type: 'object', + properties: { + propA: { + type: 'object', + oneOf: [ + { + type: 'object', + properties: { + propA: { + type: 'string' + } + } + }, + { + type: 'string' + }, + { + type: 'integer' + } + ] + } + } +} as const; + +export const ModelCircleSchema = { + type: 'object', + required: ['kind'], + properties: { + kind: { + type: 'string' + }, + radius: { + type: 'number' + } + } +} as const; + +export const ModelSquareSchema = { + type: 'object', + required: ['kind'], + properties: { + kind: { + type: 'string' + }, + sideLength: { + type: 'number' + } + } +} as const; + +export const CompositionWithOneOfDiscriminatorSchema = { + type: 'object', + oneOf: [ + { + '$ref': '#/components/schemas/ModelCircle' + }, + { + '$ref': '#/components/schemas/ModelSquare' + } + ], + discriminator: { + propertyName: 'kind', + mapping: { + circle: '#/components/schemas/ModelCircle', + square: '#/components/schemas/ModelSquare' + } + } +} as const; + +export const CompositionWithAnyOfSchema = { + type: 'object', + properties: { + propA: { + type: 'object', + anyOf: [ + { + '$ref': '#/components/schemas/ModelWithString' + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const CompositionWithAnyOfAnonymousSchema = { + type: 'object', + properties: { + propA: { + type: 'object', + anyOf: [ + { + type: 'object', + properties: { + propA: { + type: 'string' + } + } + }, + { + type: 'string' + }, + { + type: 'integer' + } + ] + } + } +} as const; + +export const CompositionWithNestedAnyAndTypeNullSchema = { + type: 'object', + properties: { + propA: { + type: 'object', + anyOf: [ + { + items: { + anyOf: [ + { + '$ref': '#/components/schemas/ModelWithDictionary' + }, + { + type: 'null' + } + ] + }, + type: 'array' + }, + { + items: { + anyOf: [ + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + type: 'null' + } + ] + }, + type: 'array' + } + ] + } + } +} as const; + +export const _3e_num_1ПериодSchema = { + enum: ['Bird', 'Dog'], + type: 'string' +} as const; + +export const ConstValueSchema = { + type: 'string', + const: 'ConstValue' +} as const; + +export const CompositionWithNestedAnyOfAndNullSchema = { + type: 'object', + properties: { + propA: { + anyOf: [ + { + items: { + anyOf: [ + { + '$ref': '#/components/schemas/3e-num_1Период' + }, + { + '$ref': '#/components/schemas/ConstValue' + } + ] + }, + type: 'array' + }, + { + type: 'null' + } + ] + } + } +} as const; + +export const CompositionWithOneOfAndNullableSchema = { + type: 'object', + properties: { + propA: { + nullable: true, + type: 'object', + oneOf: [ + { + type: 'object', + properties: { + boolean: { + type: 'boolean' + } + } + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const CompositionWithOneOfAndSimpleDictionarySchema = { + type: 'object', + properties: { + propA: { + oneOf: [ + { + type: 'boolean' + }, + { + type: 'object', + additionalProperties: { + type: 'number' + } + } + ] + } + } +} as const; + +export const CompositionWithOneOfAndSimpleArrayDictionarySchema = { + type: 'object', + properties: { + propA: { + oneOf: [ + { + type: 'boolean' + }, + { + type: 'object', + additionalProperties: { + type: 'array', + items: { + type: 'boolean' + } + } + } + ] + } + } +} as const; + +export const CompositionWithOneOfAndComplexArrayDictionarySchema = { + type: 'object', + properties: { + propA: { + oneOf: [ + { + type: 'boolean' + }, + { + type: 'object', + additionalProperties: { + type: 'array', + items: { + oneOf: [ + { + type: 'number' + }, + { + type: 'string' + } + ] + } + } + } + ] + } + } +} as const; + +export const CompositionWithAllOfAndNullableSchema = { + type: 'object', + properties: { + propA: { + nullable: true, + type: 'object', + allOf: [ + { + type: 'object', + properties: { + boolean: { + type: 'boolean' + } + } + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const CompositionWithAnyOfAndNullableSchema = { + type: 'object', + properties: { + propA: { + nullable: true, + type: 'object', + anyOf: [ + { + type: 'object', + properties: { + boolean: { + type: 'boolean' + } + } + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const CompositionBaseModelSchema = { + type: 'object', + properties: { + firstName: { + type: 'string' + }, + lastname: { + type: 'string' + } + } +} as const; + +export const CompositionExtendedModelSchema = { + type: 'object', + allOf: [ + { + '$ref': '#/components/schemas/CompositionBaseModel' + } + ], + properties: { + age: { + type: 'number' + } + }, + required: ['firstName', 'lastname', 'age'] +} as const; + +export const ModelWithPropertiesSchema = { + type: 'object', + required: ['required', 'requiredAndReadOnly', 'requiredAndNullable'], + properties: { + required: { + type: 'string' + }, + requiredAndReadOnly: { + type: 'string', + readOnly: true + }, + requiredAndNullable: { + type: 'string', + nullable: true + }, + string: { + type: 'string' + }, + number: { + type: 'number' + }, + boolean: { + type: 'boolean' + }, + reference: { + '$ref': '#/components/schemas/ModelWithString' + }, + 'property with space': { + type: 'string' + }, + default: { + type: 'string' + }, + try: { + type: 'string' + }, + '@namespace.string': { + type: 'string', + readOnly: true + }, + '@namespace.integer': { + type: 'integer', + readOnly: true + } + } +} as const; + +export const ModelWithNestedPropertiesSchema = { + type: 'object', + required: ['first'], + properties: { + first: { + type: 'object', + required: ['second'], + readOnly: true, + nullable: true, + properties: { + second: { + type: 'object', + required: ['third'], + readOnly: true, + nullable: true, + properties: { + third: { + type: 'string', + required: true, + readOnly: true, + nullable: true + } + } + } + } + } + } +} as const; + +export const ModelWithDuplicatePropertiesSchema = { + type: 'object', + properties: { + prop: { + '$ref': '#/components/schemas/ModelWithString' + } + } +} as const; + +export const ModelWithOrderedPropertiesSchema = { + type: 'object', + properties: { + zebra: { + type: 'string' + }, + apple: { + type: 'string' + }, + hawaii: { + type: 'string' + } + } +} as const; + +export const ModelWithDuplicateImportsSchema = { + type: 'object', + properties: { + propA: { + '$ref': '#/components/schemas/ModelWithString' + }, + propB: { + '$ref': '#/components/schemas/ModelWithString' + }, + propC: { + '$ref': '#/components/schemas/ModelWithString' + } + } +} as const; + +export const ModelThatExtendsSchema = { + type: 'object', + allOf: [ + { + '$ref': '#/components/schemas/ModelWithString' + }, + { + type: 'object', + properties: { + propExtendsA: { + type: 'string' + }, + propExtendsB: { + '$ref': '#/components/schemas/ModelWithString' + } + } + } + ] +} as const; + +export const ModelThatExtendsExtendsSchema = { + type: 'object', + allOf: [ + { + '$ref': '#/components/schemas/ModelWithString' + }, + { + '$ref': '#/components/schemas/ModelThatExtends' + }, + { + type: 'object', + properties: { + propExtendsC: { + type: 'string' + }, + propExtendsD: { + '$ref': '#/components/schemas/ModelWithString' + } + } + } + ] +} as const; + +export const ModelWithPatternSchema = { + type: 'object', + required: ['key', 'name'], + properties: { + key: { + maxLength: 64, + pattern: '^[a-zA-Z0-9_]*$', + type: 'string' + }, + name: { + maxLength: 255, + type: 'string' + }, + enabled: { + type: 'boolean', + readOnly: true + }, + modified: { + type: 'string', + format: 'date-time', + readOnly: true + }, + id: { + type: 'string', + pattern: '^\\d{2}-\\d{3}-\\d{4}$' + }, + text: { + type: 'string', + pattern: '^\\w+$' + }, + patternWithSingleQuotes: { + type: 'string', + pattern: "^[a-zA-Z0-9']*$" + }, + patternWithNewline: { + type: 'string', + pattern: 'aaa\\nbbb' + }, + patternWithBacktick: { + type: 'string', + pattern: 'aaa`bbb' + } + } +} as const; + +export const FileSchema = { + required: ['mime'], + type: 'object', + properties: { + id: { + type: 'string', + readOnly: true, + minLength: 1 + }, + updated_at: { + type: 'string', + format: 'date-time', + readOnly: true + }, + created_at: { + type: 'string', + format: 'date-time', + readOnly: true + }, + mime: { + type: 'string', + maxLength: 24, + minLength: 1 + }, + file: { + type: 'string', + readOnly: true, + format: 'uri' + } + } +} as const; + +export const defaultSchema = { + type: 'object', + properties: { + name: { + type: 'string' + } + } +} as const; + +export const PageableSchema = { + type: 'object', + properties: { + page: { + minimum: 0, + type: 'integer', + format: 'int32', + default: 0 + }, + size: { + minimum: 1, + type: 'integer', + format: 'int32' + }, + sort: { + type: 'array', + items: { + type: 'string' + } + } + } +} as const; + +export const FreeFormObjectWithoutAdditionalPropertiesSchema = { + type: 'object' +} as const; + +export const FreeFormObjectWithAdditionalPropertiesEqTrueSchema = { + type: 'object', + additionalProperties: true +} as const; + +export const FreeFormObjectWithAdditionalPropertiesEqEmptyObjectSchema = { + type: 'object', + additionalProperties: {} +} as const; + +export const ModelWithConstSchema = { + type: 'object', + properties: { + String: { + const: 'String' + }, + number: { + const: 0 + }, + null: { + const: null + }, + withType: { + type: 'string', + const: 'Some string' + } + } +} as const; + +export const ModelWithAdditionalPropertiesEqTrueSchema = { + type: 'object', + properties: { + prop: { + type: 'string' + } + }, + additionalProperties: true +} as const; + +export const NestedAnyOfArraysNullableSchema = { + properties: { + nullableArray: { + anyOf: [ + { + items: { + anyOf: [ + { + type: 'string' + }, + { + type: 'boolean' + } + ] + }, + type: 'array' + }, + { + type: 'null' + } + ] + } + }, + type: 'object' +} as const; + +export const CompositionWithOneOfAndPropertiesSchema = { + type: 'object', + oneOf: [ + { + type: 'object', + required: ['foo'], + properties: { + foo: { + '$ref': '#/components/parameters/SimpleParameter' + } + }, + additionalProperties: false + }, + { + type: 'object', + required: ['bar'], + properties: { + bar: { + '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' + } + }, + additionalProperties: false + } + ], + required: ['baz', 'qux'], + properties: { + baz: { + type: 'integer', + format: 'uint16', + minimum: 0, + nullable: true + }, + qux: { + type: 'integer', + format: 'uint8', + minimum: 0 + } + } +} as const; + +export const NullableObjectSchema = { + type: ['object', 'null'], + properties: { + foo: { + type: 'string' + } + }, + default: null +} as const; + +export const CharactersInDescriptionSchema = { + type: 'string' +} as const; + +export const ModelWithNullableObjectSchema = { + type: 'object', + properties: { + data: { + '$ref': '#/components/schemas/NullableObject' + } + } +} as const; + +export const ModelWithOneOfEnumSchema = { + oneOf: [ + { + type: 'object', + required: ['foo'], + properties: { + foo: { + type: 'string', + enum: ['Bar'] + } + } + }, + { + type: 'object', + required: ['foo'], + properties: { + foo: { + type: 'string', + enum: ['Baz'] + } + } + }, + { + type: 'object', + required: ['foo'], + properties: { + foo: { + type: 'string', + enum: ['Qux'] + } + } + }, + { + type: 'object', + required: ['content', 'foo'], + properties: { + content: { + type: 'string', + format: 'date-time' + }, + foo: { + type: 'string', + enum: ['Quux'] + } + } + }, + { + type: 'object', + required: ['content', 'foo'], + properties: { + content: { + type: 'array', + items: [ + { + type: 'string', + format: 'date-time' + }, + { + type: 'string' + } + ], + maxItems: 2, + minItems: 2 + }, + foo: { + type: 'string', + enum: ['Corge'] + } + } + } + ] +} as const; + +export const ModelWithNestedArrayEnumsDataFooSchema = { + enum: ['foo', 'bar'], + type: 'string' +} as const; + +export const ModelWithNestedArrayEnumsDataBarSchema = { + enum: ['baz', 'qux'], + type: 'string' +} as const; + +export const ModelWithNestedArrayEnumsDataSchema = { + type: 'object', + properties: { + foo: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' + } + }, + bar: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataBar' + } + } + } +} as const; + +export const ModelWithNestedArrayEnumsSchema = { + type: 'object', + properties: { + array_strings: { + type: 'array', + items: { + type: 'string' + } + }, + data: { + allOf: [ + { + '$ref': '#/components/schemas/ModelWithNestedArrayEnumsData' + } + ] + } + } +} as const; + +export const ModelWithNestedCompositionEnumsSchema = { + type: 'object', + properties: { + foo: { + allOf: [ + { + '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' + } + ] + } + } +} as const; + +export const ModelWithReadOnlyAndWriteOnlySchema = { + type: 'object', + required: ['foo', 'bar', 'baz'], + properties: { + foo: { + type: 'string' + }, + bar: { + readOnly: true, + type: 'string' + }, + baz: { + type: 'string', + writeOnly: true + } + } +} as const; + +export const ModelWithConstantSizeArraySchema = { + type: 'array', + items: { + type: 'number' + }, + minItems: 2, + maxItems: 2 +} as const; + +export const ModelWithAnyOfConstantSizeArraySchema = { + type: 'array', + items: { + oneOf: [ + { + type: 'number' + }, + { + type: 'string' + } + ] + }, + minItems: 3, + maxItems: 3 +} as const; + +export const ModelWithPrefixItemsConstantSizeArraySchema = { + type: 'array', + prefixItems: [ + { + '$ref': '#/components/schemas/ModelWithInteger' + }, + { + oneOf: [ + { + type: 'number' + }, + { + type: 'string' + } + ] + }, + { + type: 'string' + } + ] +} as const; + +export const ModelWithAnyOfConstantSizeArrayNullableSchema = { + type: ['array'], + items: { + oneOf: [ + { + type: 'number', + nullable: true + }, + { + type: 'string' + } + ] + }, + minItems: 3, + maxItems: 3 +} as const; + +export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsSchema = { + type: 'array', + items: { + oneOf: [ + { + type: 'number' + }, + { + '$ref': '#/components/schemas/import' + } + ] + }, + minItems: 2, + maxItems: 2 +} as const; + +export const ModelWithAnyOfConstantSizeArrayAndIntersectSchema = { + type: 'array', + items: { + allOf: [ + { + type: 'number' + }, + { + type: 'string' + } + ] + }, + minItems: 2, + maxItems: 2 +} as const; + +export const ModelWithNumericEnumUnionSchema = { + type: 'object', + properties: { + value: { + type: 'number', + enum: [-10, -1, 0, 1, 3, 6, 12] + } + } +} as const; + +export const ModelWithBackticksInDescriptionSchema = { + type: 'object', + properties: { + template: { + type: 'string' + } + } +} as const; + +export const ModelWithOneOfAndPropertiesSchema = { + type: 'object', + oneOf: [ + { + '$ref': '#/components/parameters/SimpleParameter' + }, + { + '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' + } + ], + required: ['baz', 'qux'], + properties: { + baz: { + type: 'integer', + format: 'uint16', + minimum: 0, + nullable: true + }, + qux: { + type: 'integer', + format: 'uint8', + minimum: 0 + } + } +} as const; + +export const ParameterSimpleParameterUnusedSchema = { + type: 'string' +} as const; + +export const PostServiceWithEmptyTagResponseSchema = { + type: 'string' +} as const; + +export const PostServiceWithEmptyTagResponse2Schema = { + type: 'string' +} as const; + +export const DeleteFooDataSchema = { + type: 'string' +} as const; + +export const DeleteFooData2Schema = { + type: 'string' +} as const; + +export const importSchema = { + type: 'string' +} as const; + +export const SchemaWithFormRestrictedKeysSchema = { + properties: { + description: { + type: 'string' + }, + 'x-enum-descriptions': { + type: 'string' + }, + 'x-enum-varnames': { + type: 'string' + }, + 'x-enumNames': { + type: 'string' + }, + title: { + type: 'string' + }, + object: { + type: 'object', + properties: { + description: { + type: 'string' + }, + 'x-enum-descriptions': { + type: 'string' + }, + 'x-enum-varnames': { + type: 'string' + }, + 'x-enumNames': { + type: 'string' + }, + title: { + type: 'string' + } + } + }, + array: { + type: 'array', + items: [ + { + type: 'object', + properties: { + description: { + type: 'string' + }, + 'x-enum-descriptions': { + type: 'string' + }, + 'x-enum-varnames': { + type: 'string' + }, + 'x-enumNames': { + type: 'string' + }, + title: { + type: 'string' + } + } + } + ] + } + } +} as const; + +export const io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptionsSchema = { + properties: { + preconditions: { + allOf: [ + { + '$ref': '#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions' + } + ] + } + }, + type: 'object' +} as const; + +export const io_k8s_apimachinery_pkg_apis_meta_v1_PreconditionsSchema = { + properties: { + resourceVersion: { + type: 'string' + }, + uid: { + type: 'string' + } + }, + type: 'object' +} as const; + +export const AdditionalPropertiesUnknownIssueSchema = { + type: 'object', + properties: {}, + additionalProperties: { + anyOf: [ + { + type: 'string' + }, + { + type: 'number' + } + ] + } +} as const; + +export const AdditionalPropertiesUnknownIssue2Schema = { + type: 'object', + additionalProperties: { + anyOf: [ + { + type: 'string' + }, + { + type: 'number' + } + ] + } +} as const; + +export const AdditionalPropertiesUnknownIssue3Schema = { + type: 'object', + allOf: [ + { + type: 'string' + }, + { + type: 'object', + required: ['entries'], + properties: { + entries: { + additionalProperties: { + '$ref': '#/components/schemas/AdditionalPropertiesUnknownIssue' + } + } + } + } + ] +} as const; + +export const AdditionalPropertiesIntegerIssueSchema = { + type: 'object', + required: ['value'], + properties: { + value: { + type: 'integer' + } + }, + additionalProperties: { + type: 'integer' + } +} as const; + +export const OneOfAllOfIssueSchema = { + oneOf: [ + { + allOf: [ + { + oneOf: [ + { + '$ref': '#/components/schemas/ConstValue' + }, + { + '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]' + } + ] + }, + { + '$ref': '#/components/schemas/3e-num_1Период' + } + ] + }, + { + '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]' + } + ] +} as const; + +export const Generic_Schema_Duplicate_Issue_1_System_Boolean_Schema = { + type: 'object', + properties: { + item: { + type: 'boolean' + }, + error: { + type: 'string', + nullable: true + }, + hasError: { + type: 'boolean', + readOnly: true + }, + data: { + type: 'object', + properties: {}, + additionalProperties: false + } + }, + additionalProperties: false +} as const; + +export const Generic_Schema_Duplicate_Issue_1_System_String_Schema = { + type: 'object', + properties: { + item: { + type: 'string', + nullable: true + }, + error: { + type: 'string', + nullable: true + }, + hasError: { + type: 'boolean', + readOnly: true + } + }, + additionalProperties: false +} as const; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3-schemas-json/schemas.gen.ts b/packages/openapi-ts-tests/test/generated/v3-schemas-json/schemas.gen.ts new file mode 100644 index 000000000..5f65189a2 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3-schemas-json/schemas.gen.ts @@ -0,0 +1,1994 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export const _400Schema = { + description: 'Model with number-only name', + type: 'string' +} as const; + +export const camelCaseCommentWithBreaksSchema = { + description: `Testing multiline comments in string: First line +Second line + +Fourth line`, + type: 'integer' +} as const; + +export const CommentWithBreaksSchema = { + description: `Testing multiline comments in string: First line +Second line + +Fourth line`, + type: 'integer' +} as const; + +export const CommentWithBackticksSchema = { + description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work', + type: 'integer' +} as const; + +export const CommentWithBackticksAndQuotesSchema = { + description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`, + type: 'integer' +} as const; + +export const CommentWithSlashesSchema = { + description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work', + type: 'integer' +} as const; + +export const CommentWithExpressionPlaceholdersSchema = { + description: 'Testing expression placeholders in string: ${expression} should work', + type: 'integer' +} as const; + +export const CommentWithQuotesSchema = { + description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`, + type: 'integer' +} as const; + +export const CommentWithReservedCharactersSchema = { + description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work', + type: 'integer' +} as const; + +export const SimpleIntegerSchema = { + description: 'This is a simple number', + type: 'integer' +} as const; + +export const SimpleBooleanSchema = { + description: 'This is a simple boolean', + type: 'boolean' +} as const; + +export const SimpleStringSchema = { + description: 'This is a simple string', + type: 'string' +} as const; + +export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = { + description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)', + type: 'string' +} as const; + +export const SimpleFileSchema = { + description: 'This is a simple file', + type: 'file' +} as const; + +export const SimpleReferenceSchema = { + description: 'This is a simple reference', + '$ref': '#/components/schemas/ModelWithString' +} as const; + +export const SimpleStringWithPatternSchema = { + description: 'This is a simple string', + type: 'string', + nullable: true, + maxLength: 64, + pattern: '^[a-zA-Z0-9_]*$' +} as const; + +export const EnumWithStringsSchema = { + description: 'This is a simple enum with strings', + enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串'] +} as const; + +export const EnumWithReplacedCharactersSchema = { + enum: ["'Single Quote'", '"Double Quotes"', 'øæåôöØÆÅÔÖ字符串', 3.1, ''], + type: 'string' +} as const; + +export const EnumWithNumbersSchema = { + description: 'This is a simple enum with numbers', + enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3], + default: 200 +} as const; + +export const EnumFromDescriptionSchema = { + description: 'Success=1,Warning=2,Error=3', + type: 'number' +} as const; + +export const EnumWithExtensionsSchema = { + description: 'This is a simple enum with numbers', + enum: [200, 400, 500], + 'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'], + 'x-enum-descriptions': ['Used when the status of something is successful', 'Used when the status of something has a warning', 'Used when the status of something has an error'] +} as const; + +export const EnumWithXEnumNamesSchema = { + enum: [0, 1, 2], + 'x-enumNames': ['zero', 'one', 'two'] +} as const; + +export const ArrayWithNumbersSchema = { + description: 'This is a simple array with numbers', + type: 'array', + items: { + type: 'integer' + } +} as const; + +export const ArrayWithBooleansSchema = { + description: 'This is a simple array with booleans', + type: 'array', + items: { + type: 'boolean' + } +} as const; + +export const ArrayWithStringsSchema = { + description: 'This is a simple array with strings', + type: 'array', + items: { + type: 'string' + }, + default: ['test'] +} as const; + +export const ArrayWithReferencesSchema = { + description: 'This is a simple array with references', + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithString' + } +} as const; + +export const ArrayWithArraySchema = { + description: 'This is a simple array containing an array', + type: 'array', + items: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithString' + } + } +} as const; + +export const ArrayWithPropertiesSchema = { + description: 'This is a simple array with properties', + type: 'array', + items: { + type: 'object', + properties: { + '16x16': { + '$ref': '#/components/schemas/camelCaseCommentWithBreaks' + }, + bar: { + type: 'string' + } + } + } +} as const; + +export const ArrayWithAnyOfPropertiesSchema = { + description: 'This is a simple array with any of properties', + type: 'array', + items: { + anyOf: [ + { + type: 'object', + properties: { + foo: { + type: 'string', + default: 'test' + } + } + }, + { + type: 'object', + properties: { + bar: { + type: 'string' + } + } + } + ] + } +} as const; + +export const AnyOfAnyAndNullSchema = { + type: 'object', + properties: { + data: { + anyOf: [ + {}, + { + type: 'null' + } + ] + } + } +} as const; + +export const AnyOfArraysSchema = { + description: 'This is a simple array with any of properties', + type: 'object', + properties: { + results: { + items: { + anyOf: [ + { + type: 'object', + properties: { + foo: { + type: 'string' + } + } + }, + { + type: 'object', + properties: { + bar: { + type: 'string' + } + } + } + ] + }, + type: 'array' + } + } +} as const; + +export const DictionaryWithStringSchema = { + description: 'This is a string dictionary', + type: 'object', + additionalProperties: { + type: 'string' + } +} as const; + +export const DictionaryWithPropertiesAndAdditionalPropertiesSchema = { + type: 'object', + properties: { + foo: { + type: 'number' + }, + bar: { + type: 'boolean' + } + }, + additionalProperties: { + type: 'string' + } +} as const; + +export const DictionaryWithReferenceSchema = { + description: 'This is a string reference', + type: 'object', + additionalProperties: { + '$ref': '#/components/schemas/ModelWithString' + } +} as const; + +export const DictionaryWithArraySchema = { + description: 'This is a complex dictionary', + type: 'object', + additionalProperties: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithString' + } + } +} as const; + +export const DictionaryWithDictionarySchema = { + description: 'This is a string dictionary', + type: 'object', + additionalProperties: { + type: 'object', + additionalProperties: { + type: 'string' + } + } +} as const; + +export const DictionaryWithPropertiesSchema = { + description: 'This is a complex dictionary', + type: 'object', + additionalProperties: { + type: 'object', + properties: { + foo: { + type: 'string' + }, + bar: { + type: 'string' + } + } + } +} as const; + +export const ModelWithIntegerSchema = { + description: 'This is a model with one number property', + type: 'object', + properties: { + prop: { + description: 'This is a simple number property', + type: 'integer' + } + } +} as const; + +export const ModelWithBooleanSchema = { + description: 'This is a model with one boolean property', + type: 'object', + properties: { + prop: { + description: 'This is a simple boolean property', + type: 'boolean' + } + } +} as const; + +export const ModelWithStringSchema = { + description: 'This is a model with one string property', + type: 'object', + properties: { + prop: { + description: 'This is a simple string property', + type: 'string' + } + } +} as const; + +export const ModelWithStringErrorSchema = { + description: 'This is a model with one string property', + type: 'object', + properties: { + prop: { + description: 'This is a simple string property', + type: 'string' + } + } +} as const; + +export const Model_From_ZendeskSchema = { + description: `\`Comment\` or \`VoiceComment\`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets)`, + type: 'string' +} as const; + +export const ModelWithNullableStringSchema = { + description: 'This is a model with one string property', + type: 'object', + required: ['nullableRequiredProp1', 'nullableRequiredProp2'], + properties: { + nullableProp1: { + description: 'This is a simple string property', + type: 'string', + nullable: true + }, + nullableRequiredProp1: { + description: 'This is a simple string property', + type: 'string', + nullable: true + }, + nullableProp2: { + description: 'This is a simple string property', + type: ['string', 'null'] + }, + nullableRequiredProp2: { + description: 'This is a simple string property', + type: ['string', 'null'] + }, + 'foo_bar-enum': { + description: 'This is a simple enum with strings', + enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + } + } +} as const; + +export const ModelWithEnumSchema = { + description: 'This is a model with one enum', + type: 'object', + properties: { + 'foo_bar-enum': { + description: 'This is a simple enum with strings', + enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + }, + statusCode: { + description: 'These are the HTTP error code enums', + enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar'] + }, + bool: { + description: 'Simple boolean enum', + type: 'boolean', + enum: [true] + } + } +} as const; + +export const ModelWithEnumWithHyphenSchema = { + description: 'This is a model with one enum with escaped name', + type: 'object', + properties: { + 'foo-bar-baz-qux': { + type: 'string', + enum: ['3.0'], + title: 'Foo-Bar-Baz-Qux', + default: '3.0' + } + } +} as const; + +export const ModelWithEnumFromDescriptionSchema = { + description: 'This is a model with one enum', + type: 'object', + properties: { + test: { + type: 'integer', + description: 'Success=1,Warning=2,Error=3' + } + } +} as const; + +export const ModelWithNestedEnumsSchema = { + description: 'This is a model with nested enums', + type: 'object', + properties: { + dictionaryWithEnum: { + type: 'object', + additionalProperties: { + enum: ['Success', 'Warning', 'Error'] + } + }, + dictionaryWithEnumFromDescription: { + type: 'object', + additionalProperties: { + type: 'integer', + description: 'Success=1,Warning=2,Error=3' + } + }, + arrayWithEnum: { + type: 'array', + items: { + enum: ['Success', 'Warning', 'Error'] + } + }, + arrayWithDescription: { + type: 'array', + items: { + type: 'integer', + description: 'Success=1,Warning=2,Error=3' + } + }, + 'foo_bar-enum': { + description: 'This is a simple enum with strings', + enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + } + } +} as const; + +export const ModelWithReferenceSchema = { + description: 'This is a model with one property containing a reference', + type: 'object', + properties: { + prop: { + '$ref': '#/components/schemas/ModelWithProperties' + } + } +} as const; + +export const ModelWithArrayReadOnlyAndWriteOnlySchema = { + description: 'This is a model with one property containing an array', + type: 'object', + properties: { + prop: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnly' + } + }, + propWithFile: { + type: 'array', + items: { + type: 'file' + } + }, + propWithNumber: { + type: 'array', + items: { + type: 'number' + } + } + } +} as const; + +export const ModelWithArraySchema = { + description: 'This is a model with one property containing an array', + type: 'object', + properties: { + prop: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithString' + } + }, + propWithFile: { + type: 'array', + items: { + type: 'file' + } + }, + propWithNumber: { + type: 'array', + items: { + type: 'number' + } + } + } +} as const; + +export const ModelWithDictionarySchema = { + description: 'This is a model with one property containing a dictionary', + type: 'object', + properties: { + prop: { + type: 'object', + additionalProperties: { + type: 'string' + } + } + } +} as const; + +export const DeprecatedModelSchema = { + deprecated: true, + description: 'This is a deprecated model with a deprecated property', + type: 'object', + properties: { + prop: { + deprecated: true, + description: 'This is a deprecated property', + type: 'string' + } + } +} as const; + +export const ModelWithCircularReferenceSchema = { + description: 'This is a model with one property containing a circular reference', + type: 'object', + properties: { + prop: { + '$ref': '#/components/schemas/ModelWithCircularReference' + } + } +} as const; + +export const CompositionWithOneOfSchema = { + description: "This is a model with one property with a 'one of' relationship", + type: 'object', + properties: { + propA: { + type: 'object', + oneOf: [ + { + '$ref': '#/components/schemas/ModelWithString' + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const CompositionWithOneOfAnonymousSchema = { + description: "This is a model with one property with a 'one of' relationship where the options are not $ref", + type: 'object', + properties: { + propA: { + type: 'object', + oneOf: [ + { + description: 'Anonymous object type', + type: 'object', + properties: { + propA: { + type: 'string' + } + } + }, + { + description: 'Anonymous string type', + type: 'string' + }, + { + description: 'Anonymous integer type', + type: 'integer' + } + ] + } + } +} as const; + +export const ModelCircleSchema = { + description: 'Circle', + type: 'object', + required: ['kind'], + properties: { + kind: { + type: 'string' + }, + radius: { + type: 'number' + } + } +} as const; + +export const ModelSquareSchema = { + description: 'Square', + type: 'object', + required: ['kind'], + properties: { + kind: { + type: 'string' + }, + sideLength: { + type: 'number' + } + } +} as const; + +export const CompositionWithOneOfDiscriminatorSchema = { + description: "This is a model with one property with a 'one of' relationship where the options are not $ref", + type: 'object', + oneOf: [ + { + '$ref': '#/components/schemas/ModelCircle' + }, + { + '$ref': '#/components/schemas/ModelSquare' + } + ], + discriminator: { + propertyName: 'kind', + mapping: { + circle: '#/components/schemas/ModelCircle', + square: '#/components/schemas/ModelSquare' + } + } +} as const; + +export const CompositionWithAnyOfSchema = { + description: "This is a model with one property with a 'any of' relationship", + type: 'object', + properties: { + propA: { + type: 'object', + anyOf: [ + { + '$ref': '#/components/schemas/ModelWithString' + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const CompositionWithAnyOfAnonymousSchema = { + description: "This is a model with one property with a 'any of' relationship where the options are not $ref", + type: 'object', + properties: { + propA: { + type: 'object', + anyOf: [ + { + description: 'Anonymous object type', + type: 'object', + properties: { + propA: { + type: 'string' + } + } + }, + { + description: 'Anonymous string type', + type: 'string' + }, + { + description: 'Anonymous integer type', + type: 'integer' + } + ] + } + } +} as const; + +export const CompositionWithNestedAnyAndTypeNullSchema = { + description: "This is a model with nested 'any of' property with a type null", + type: 'object', + properties: { + propA: { + type: 'object', + anyOf: [ + { + items: { + anyOf: [ + { + '$ref': '#/components/schemas/ModelWithDictionary' + }, + { + type: 'null' + } + ] + }, + type: 'array' + }, + { + items: { + anyOf: [ + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + type: 'null' + } + ] + }, + type: 'array' + } + ] + } + } +} as const; + +export const _3e_num_1ПериодSchema = { + enum: ['Bird', 'Dog'], + type: 'string' +} as const; + +export const ConstValueSchema = { + type: 'string', + const: 'ConstValue' +} as const; + +export const CompositionWithNestedAnyOfAndNullSchema = { + description: "This is a model with one property with a 'any of' relationship where the options are not $ref", + type: 'object', + properties: { + propA: { + anyOf: [ + { + items: { + anyOf: [ + { + '$ref': '#/components/schemas/3e-num_1Период' + }, + { + '$ref': '#/components/schemas/ConstValue' + } + ] + }, + type: 'array' + }, + { + type: 'null' + } + ], + title: 'Scopes' + } + } +} as const; + +export const CompositionWithOneOfAndNullableSchema = { + description: "This is a model with one property with a 'one of' relationship", + type: 'object', + properties: { + propA: { + nullable: true, + type: 'object', + oneOf: [ + { + type: 'object', + properties: { + boolean: { + type: 'boolean' + } + } + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const CompositionWithOneOfAndSimpleDictionarySchema = { + description: 'This is a model that contains a simple dictionary within composition', + type: 'object', + properties: { + propA: { + oneOf: [ + { + type: 'boolean' + }, + { + type: 'object', + additionalProperties: { + type: 'number' + } + } + ] + } + } +} as const; + +export const CompositionWithOneOfAndSimpleArrayDictionarySchema = { + description: 'This is a model that contains a dictionary of simple arrays within composition', + type: 'object', + properties: { + propA: { + oneOf: [ + { + type: 'boolean' + }, + { + type: 'object', + additionalProperties: { + type: 'array', + items: { + type: 'boolean' + } + } + } + ] + } + } +} as const; + +export const CompositionWithOneOfAndComplexArrayDictionarySchema = { + description: 'This is a model that contains a dictionary of complex arrays (composited) within composition', + type: 'object', + properties: { + propA: { + oneOf: [ + { + type: 'boolean' + }, + { + type: 'object', + additionalProperties: { + type: 'array', + items: { + oneOf: [ + { + type: 'number' + }, + { + type: 'string' + } + ] + } + } + } + ] + } + } +} as const; + +export const CompositionWithAllOfAndNullableSchema = { + description: "This is a model with one property with a 'all of' relationship", + type: 'object', + properties: { + propA: { + nullable: true, + type: 'object', + allOf: [ + { + type: 'object', + properties: { + boolean: { + type: 'boolean' + } + } + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const CompositionWithAnyOfAndNullableSchema = { + description: "This is a model with one property with a 'any of' relationship", + type: 'object', + properties: { + propA: { + nullable: true, + type: 'object', + anyOf: [ + { + type: 'object', + properties: { + boolean: { + type: 'boolean' + } + } + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const CompositionBaseModelSchema = { + description: 'This is a base model with two simple optional properties', + type: 'object', + properties: { + firstName: { + type: 'string' + }, + lastname: { + type: 'string' + } + } +} as const; + +export const CompositionExtendedModelSchema = { + description: 'This is a model that extends the base model', + type: 'object', + allOf: [ + { + '$ref': '#/components/schemas/CompositionBaseModel' + } + ], + properties: { + age: { + type: 'number' + } + }, + required: ['firstName', 'lastname', 'age'] +} as const; + +export const ModelWithPropertiesSchema = { + description: 'This is a model with one nested property', + type: 'object', + required: ['required', 'requiredAndReadOnly', 'requiredAndNullable'], + properties: { + required: { + type: 'string' + }, + requiredAndReadOnly: { + type: 'string', + readOnly: true + }, + requiredAndNullable: { + type: 'string', + nullable: true + }, + string: { + type: 'string' + }, + number: { + type: 'number' + }, + boolean: { + type: 'boolean' + }, + reference: { + '$ref': '#/components/schemas/ModelWithString' + }, + 'property with space': { + type: 'string' + }, + default: { + type: 'string' + }, + try: { + type: 'string' + }, + '@namespace.string': { + type: 'string', + readOnly: true + }, + '@namespace.integer': { + type: 'integer', + readOnly: true + } + } +} as const; + +export const ModelWithNestedPropertiesSchema = { + description: 'This is a model with one nested property', + type: 'object', + required: ['first'], + properties: { + first: { + type: 'object', + required: ['second'], + readOnly: true, + nullable: true, + properties: { + second: { + type: 'object', + required: ['third'], + readOnly: true, + nullable: true, + properties: { + third: { + type: 'string', + required: true, + readOnly: true, + nullable: true + } + } + } + } + } + } +} as const; + +export const ModelWithDuplicatePropertiesSchema = { + description: 'This is a model with duplicated properties', + type: 'object', + properties: { + prop: { + '$ref': '#/components/schemas/ModelWithString' + } + } +} as const; + +export const ModelWithOrderedPropertiesSchema = { + description: 'This is a model with ordered properties', + type: 'object', + properties: { + zebra: { + type: 'string' + }, + apple: { + type: 'string' + }, + hawaii: { + type: 'string' + } + } +} as const; + +export const ModelWithDuplicateImportsSchema = { + description: 'This is a model with duplicated imports', + type: 'object', + properties: { + propA: { + '$ref': '#/components/schemas/ModelWithString' + }, + propB: { + '$ref': '#/components/schemas/ModelWithString' + }, + propC: { + '$ref': '#/components/schemas/ModelWithString' + } + } +} as const; + +export const ModelThatExtendsSchema = { + description: 'This is a model that extends another model', + type: 'object', + allOf: [ + { + '$ref': '#/components/schemas/ModelWithString' + }, + { + type: 'object', + properties: { + propExtendsA: { + type: 'string' + }, + propExtendsB: { + '$ref': '#/components/schemas/ModelWithString' + } + } + } + ] +} as const; + +export const ModelThatExtendsExtendsSchema = { + description: 'This is a model that extends another model', + type: 'object', + allOf: [ + { + '$ref': '#/components/schemas/ModelWithString' + }, + { + '$ref': '#/components/schemas/ModelThatExtends' + }, + { + type: 'object', + properties: { + propExtendsC: { + type: 'string' + }, + propExtendsD: { + '$ref': '#/components/schemas/ModelWithString' + } + } + } + ] +} as const; + +export const ModelWithPatternSchema = { + description: 'This is a model that contains a some patterns', + type: 'object', + required: ['key', 'name'], + properties: { + key: { + maxLength: 64, + pattern: '^[a-zA-Z0-9_]*$', + type: 'string' + }, + name: { + maxLength: 255, + type: 'string' + }, + enabled: { + type: 'boolean', + readOnly: true + }, + modified: { + type: 'string', + format: 'date-time', + readOnly: true + }, + id: { + type: 'string', + pattern: '^\\d{2}-\\d{3}-\\d{4}$' + }, + text: { + type: 'string', + pattern: '^\\w+$' + }, + patternWithSingleQuotes: { + type: 'string', + pattern: "^[a-zA-Z0-9']*$" + }, + patternWithNewline: { + type: 'string', + pattern: 'aaa\\nbbb' + }, + patternWithBacktick: { + type: 'string', + pattern: 'aaa`bbb' + } + } +} as const; + +export const FileSchema = { + required: ['mime'], + type: 'object', + properties: { + id: { + title: 'Id', + type: 'string', + readOnly: true, + minLength: 1 + }, + updated_at: { + title: 'Updated at', + type: 'string', + format: 'date-time', + readOnly: true + }, + created_at: { + title: 'Created at', + type: 'string', + format: 'date-time', + readOnly: true + }, + mime: { + title: 'Mime', + type: 'string', + maxLength: 24, + minLength: 1 + }, + file: { + title: 'File', + type: 'string', + readOnly: true, + format: 'uri' + } + } +} as const; + +export const defaultSchema = { + type: 'object', + properties: { + name: { + type: 'string' + } + } +} as const; + +export const PageableSchema = { + type: 'object', + properties: { + page: { + minimum: 0, + type: 'integer', + format: 'int32', + default: 0 + }, + size: { + minimum: 1, + type: 'integer', + format: 'int32' + }, + sort: { + type: 'array', + items: { + type: 'string' + } + } + } +} as const; + +export const FreeFormObjectWithoutAdditionalPropertiesSchema = { + description: 'This is a free-form object without additionalProperties.', + type: 'object' +} as const; + +export const FreeFormObjectWithAdditionalPropertiesEqTrueSchema = { + description: 'This is a free-form object with additionalProperties: true.', + type: 'object', + additionalProperties: true +} as const; + +export const FreeFormObjectWithAdditionalPropertiesEqEmptyObjectSchema = { + description: 'This is a free-form object with additionalProperties: {}.', + type: 'object', + additionalProperties: {} +} as const; + +export const ModelWithConstSchema = { + type: 'object', + properties: { + String: { + const: 'String' + }, + number: { + const: 0 + }, + null: { + const: null + }, + withType: { + type: 'string', + const: 'Some string' + } + } +} as const; + +export const ModelWithAdditionalPropertiesEqTrueSchema = { + description: 'This is a model with one property and additionalProperties: true', + type: 'object', + properties: { + prop: { + description: 'This is a simple string property', + type: 'string' + } + }, + additionalProperties: true +} as const; + +export const NestedAnyOfArraysNullableSchema = { + properties: { + nullableArray: { + anyOf: [ + { + items: { + anyOf: [ + { + type: 'string' + }, + { + type: 'boolean' + } + ] + }, + type: 'array' + }, + { + type: 'null' + } + ] + } + }, + type: 'object' +} as const; + +export const CompositionWithOneOfAndPropertiesSchema = { + type: 'object', + oneOf: [ + { + type: 'object', + required: ['foo'], + properties: { + foo: { + '$ref': '#/components/parameters/SimpleParameter' + } + }, + additionalProperties: false + }, + { + type: 'object', + required: ['bar'], + properties: { + bar: { + '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' + } + }, + additionalProperties: false + } + ], + required: ['baz', 'qux'], + properties: { + baz: { + type: 'integer', + format: 'uint16', + minimum: 0, + nullable: true + }, + qux: { + type: 'integer', + format: 'uint8', + minimum: 0 + } + } +} as const; + +export const NullableObjectSchema = { + type: ['object', 'null'], + description: 'An object that can be null', + properties: { + foo: { + type: 'string' + } + }, + default: null +} as const; + +export const CharactersInDescriptionSchema = { + type: 'string', + description: 'Some % character' +} as const; + +export const ModelWithNullableObjectSchema = { + type: 'object', + properties: { + data: { + '$ref': '#/components/schemas/NullableObject' + } + } +} as const; + +export const ModelWithOneOfEnumSchema = { + oneOf: [ + { + type: 'object', + required: ['foo'], + properties: { + foo: { + type: 'string', + enum: ['Bar'] + } + } + }, + { + type: 'object', + required: ['foo'], + properties: { + foo: { + type: 'string', + enum: ['Baz'] + } + } + }, + { + type: 'object', + required: ['foo'], + properties: { + foo: { + type: 'string', + enum: ['Qux'] + } + } + }, + { + type: 'object', + required: ['content', 'foo'], + properties: { + content: { + type: 'string', + format: 'date-time' + }, + foo: { + type: 'string', + enum: ['Quux'] + } + } + }, + { + type: 'object', + required: ['content', 'foo'], + properties: { + content: { + type: 'array', + items: [ + { + type: 'string', + format: 'date-time' + }, + { + type: 'string' + } + ], + maxItems: 2, + minItems: 2 + }, + foo: { + type: 'string', + enum: ['Corge'] + } + } + } + ] +} as const; + +export const ModelWithNestedArrayEnumsDataFooSchema = { + enum: ['foo', 'bar'], + type: 'string' +} as const; + +export const ModelWithNestedArrayEnumsDataBarSchema = { + enum: ['baz', 'qux'], + type: 'string' +} as const; + +export const ModelWithNestedArrayEnumsDataSchema = { + type: 'object', + properties: { + foo: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' + } + }, + bar: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataBar' + } + } + } +} as const; + +export const ModelWithNestedArrayEnumsSchema = { + type: 'object', + properties: { + array_strings: { + type: 'array', + items: { + type: 'string' + } + }, + data: { + allOf: [ + { + '$ref': '#/components/schemas/ModelWithNestedArrayEnumsData' + } + ] + } + } +} as const; + +export const ModelWithNestedCompositionEnumsSchema = { + type: 'object', + properties: { + foo: { + allOf: [ + { + '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' + } + ] + } + } +} as const; + +export const ModelWithReadOnlyAndWriteOnlySchema = { + type: 'object', + required: ['foo', 'bar', 'baz'], + properties: { + foo: { + type: 'string' + }, + bar: { + readOnly: true, + type: 'string' + }, + baz: { + type: 'string', + writeOnly: true + } + } +} as const; + +export const ModelWithConstantSizeArraySchema = { + type: 'array', + items: { + type: 'number' + }, + minItems: 2, + maxItems: 2 +} as const; + +export const ModelWithAnyOfConstantSizeArraySchema = { + type: 'array', + items: { + oneOf: [ + { + type: 'number' + }, + { + type: 'string' + } + ] + }, + minItems: 3, + maxItems: 3 +} as const; + +export const ModelWithPrefixItemsConstantSizeArraySchema = { + type: 'array', + prefixItems: [ + { + '$ref': '#/components/schemas/ModelWithInteger' + }, + { + oneOf: [ + { + type: 'number' + }, + { + type: 'string' + } + ] + }, + { + type: 'string' + } + ] +} as const; + +export const ModelWithAnyOfConstantSizeArrayNullableSchema = { + type: ['array'], + items: { + oneOf: [ + { + type: 'number', + nullable: true + }, + { + type: 'string' + } + ] + }, + minItems: 3, + maxItems: 3 +} as const; + +export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsSchema = { + type: 'array', + items: { + oneOf: [ + { + type: 'number' + }, + { + '$ref': '#/components/schemas/import' + } + ] + }, + minItems: 2, + maxItems: 2 +} as const; + +export const ModelWithAnyOfConstantSizeArrayAndIntersectSchema = { + type: 'array', + items: { + allOf: [ + { + type: 'number' + }, + { + type: 'string' + } + ] + }, + minItems: 2, + maxItems: 2 +} as const; + +export const ModelWithNumericEnumUnionSchema = { + type: 'object', + properties: { + value: { + type: 'number', + description: 'Период', + enum: [-10, -1, 0, 1, 3, 6, 12] + } + } +} as const; + +export const ModelWithBackticksInDescriptionSchema = { + description: 'Some description with `back ticks`', + type: 'object', + properties: { + template: { + type: 'string', + description: `The template \`that\` should be used for parsing and importing the contents of the CSV file. + +

There is one placeholder currently supported:

  • \${x} - refers to the n-th column in the CSV file, e.g. \${1}, \${2}, ...)

Example of a correct JSON template:

+
+[
+  {
+    "resourceType": "Asset",
+    "identifier": {
+      "name": "\${1}",
+      "domain": {
+        "name": "\${2}",
+        "community": {
+          "name": "Some Community"
+        }
+      }
+    },
+    "attributes" : {
+      "00000000-0000-0000-0000-000000003115" : [ {
+        "value" : "\${3}" 
+      } ],
+      "00000000-0000-0000-0000-000000000222" : [ {
+        "value" : "\${4}"
+      } ]
+    }
+  }
+]
+
` + } + } +} as const; + +export const ModelWithOneOfAndPropertiesSchema = { + type: 'object', + oneOf: [ + { + '$ref': '#/components/parameters/SimpleParameter' + }, + { + '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' + } + ], + required: ['baz', 'qux'], + properties: { + baz: { + type: 'integer', + format: 'uint16', + minimum: 0, + nullable: true + }, + qux: { + type: 'integer', + format: 'uint8', + minimum: 0 + } + } +} as const; + +export const ParameterSimpleParameterUnusedSchema = { + description: 'Model used to test deduplication strategy (unused)', + type: 'string' +} as const; + +export const PostServiceWithEmptyTagResponseSchema = { + description: 'Model used to test deduplication strategy', + type: 'string' +} as const; + +export const PostServiceWithEmptyTagResponse2Schema = { + description: 'Model used to test deduplication strategy', + type: 'string' +} as const; + +export const DeleteFooDataSchema = { + description: 'Model used to test deduplication strategy', + type: 'string' +} as const; + +export const DeleteFooData2Schema = { + description: 'Model used to test deduplication strategy', + type: 'string' +} as const; + +export const importSchema = { + description: 'Model with restricted keyword name', + type: 'string' +} as const; + +export const SchemaWithFormRestrictedKeysSchema = { + properties: { + description: { + type: 'string' + }, + 'x-enum-descriptions': { + type: 'string' + }, + 'x-enum-varnames': { + type: 'string' + }, + 'x-enumNames': { + type: 'string' + }, + title: { + type: 'string' + }, + object: { + type: 'object', + properties: { + description: { + type: 'string' + }, + 'x-enum-descriptions': { + type: 'string' + }, + 'x-enum-varnames': { + type: 'string' + }, + 'x-enumNames': { + type: 'string' + }, + title: { + type: 'string' + } + } + }, + array: { + type: 'array', + items: [ + { + type: 'object', + properties: { + description: { + type: 'string' + }, + 'x-enum-descriptions': { + type: 'string' + }, + 'x-enum-varnames': { + type: 'string' + }, + 'x-enumNames': { + type: 'string' + }, + title: { + type: 'string' + } + } + } + ] + } + } +} as const; + +export const io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptionsSchema = { + description: 'This schema was giving PascalCase transformations a hard time', + properties: { + preconditions: { + allOf: [ + { + '$ref': '#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions' + } + ], + description: 'Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.' + } + }, + type: 'object' +} as const; + +export const io_k8s_apimachinery_pkg_apis_meta_v1_PreconditionsSchema = { + description: 'This schema was giving PascalCase transformations a hard time', + properties: { + resourceVersion: { + description: 'Specifies the target ResourceVersion', + type: 'string' + }, + uid: { + description: 'Specifies the target UID.', + type: 'string' + } + }, + type: 'object' +} as const; + +export const AdditionalPropertiesUnknownIssueSchema = { + type: 'object', + properties: {}, + additionalProperties: { + anyOf: [ + { + type: 'string' + }, + { + type: 'number' + } + ] + } +} as const; + +export const AdditionalPropertiesUnknownIssue2Schema = { + type: 'object', + additionalProperties: { + anyOf: [ + { + type: 'string' + }, + { + type: 'number' + } + ] + } +} as const; + +export const AdditionalPropertiesUnknownIssue3Schema = { + type: 'object', + allOf: [ + { + type: 'string' + }, + { + type: 'object', + required: ['entries'], + properties: { + entries: { + additionalProperties: { + '$ref': '#/components/schemas/AdditionalPropertiesUnknownIssue' + } + } + } + } + ] +} as const; + +export const AdditionalPropertiesIntegerIssueSchema = { + type: 'object', + required: ['value'], + properties: { + value: { + type: 'integer' + } + }, + additionalProperties: { + type: 'integer' + } +} as const; + +export const OneOfAllOfIssueSchema = { + oneOf: [ + { + allOf: [ + { + oneOf: [ + { + '$ref': '#/components/schemas/ConstValue' + }, + { + '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]' + } + ] + }, + { + '$ref': '#/components/schemas/3e-num_1Период' + } + ] + }, + { + '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]' + } + ] +} as const; + +export const Generic_Schema_Duplicate_Issue_1_System_Boolean_Schema = { + type: 'object', + properties: { + item: { + type: 'boolean' + }, + error: { + type: 'string', + nullable: true + }, + hasError: { + type: 'boolean', + readOnly: true + }, + data: { + type: 'object', + properties: {}, + additionalProperties: false + } + }, + additionalProperties: false +} as const; + +export const Generic_Schema_Duplicate_Issue_1_System_String_Schema = { + type: 'object', + properties: { + item: { + type: 'string', + nullable: true + }, + error: { + type: 'string', + nullable: true + }, + hasError: { + type: 'boolean', + readOnly: true + } + }, + additionalProperties: false +} as const; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3-schemas-name/schemas.gen.ts b/packages/openapi-ts-tests/test/generated/v3-schemas-name/schemas.gen.ts new file mode 100644 index 000000000..b45a3bbae --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3-schemas-name/schemas.gen.ts @@ -0,0 +1,1994 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export const $400 = { + description: 'Model with number-only name', + type: 'string' +} as const; + +export const $camelCaseCommentWithBreaks = { + description: `Testing multiline comments in string: First line +Second line + +Fourth line`, + type: 'integer' +} as const; + +export const $CommentWithBreaks = { + description: `Testing multiline comments in string: First line +Second line + +Fourth line`, + type: 'integer' +} as const; + +export const $CommentWithBackticks = { + description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work', + type: 'integer' +} as const; + +export const $CommentWithBackticksAndQuotes = { + description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`, + type: 'integer' +} as const; + +export const $CommentWithSlashes = { + description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work', + type: 'integer' +} as const; + +export const $CommentWithExpressionPlaceholders = { + description: 'Testing expression placeholders in string: ${expression} should work', + type: 'integer' +} as const; + +export const $CommentWithQuotes = { + description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`, + type: 'integer' +} as const; + +export const $CommentWithReservedCharacters = { + description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work', + type: 'integer' +} as const; + +export const $SimpleInteger = { + description: 'This is a simple number', + type: 'integer' +} as const; + +export const $SimpleBoolean = { + description: 'This is a simple boolean', + type: 'boolean' +} as const; + +export const $SimpleString = { + description: 'This is a simple string', + type: 'string' +} as const; + +export const $NonAsciiStringæøåÆØÅöôêÊ字符串 = { + description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)', + type: 'string' +} as const; + +export const $SimpleFile = { + description: 'This is a simple file', + type: 'file' +} as const; + +export const $SimpleReference = { + description: 'This is a simple reference', + '$ref': '#/components/schemas/ModelWithString' +} as const; + +export const $SimpleStringWithPattern = { + description: 'This is a simple string', + type: 'string', + nullable: true, + maxLength: 64, + pattern: '^[a-zA-Z0-9_]*$' +} as const; + +export const $EnumWithStrings = { + description: 'This is a simple enum with strings', + enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串'] +} as const; + +export const $EnumWithReplacedCharacters = { + enum: ["'Single Quote'", '"Double Quotes"', 'øæåôöØÆÅÔÖ字符串', 3.1, ''], + type: 'string' +} as const; + +export const $EnumWithNumbers = { + description: 'This is a simple enum with numbers', + enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3], + default: 200 +} as const; + +export const $EnumFromDescription = { + description: 'Success=1,Warning=2,Error=3', + type: 'number' +} as const; + +export const $EnumWithExtensions = { + description: 'This is a simple enum with numbers', + enum: [200, 400, 500], + 'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'], + 'x-enum-descriptions': ['Used when the status of something is successful', 'Used when the status of something has a warning', 'Used when the status of something has an error'] +} as const; + +export const $EnumWithXEnumNames = { + enum: [0, 1, 2], + 'x-enumNames': ['zero', 'one', 'two'] +} as const; + +export const $ArrayWithNumbers = { + description: 'This is a simple array with numbers', + type: 'array', + items: { + type: 'integer' + } +} as const; + +export const $ArrayWithBooleans = { + description: 'This is a simple array with booleans', + type: 'array', + items: { + type: 'boolean' + } +} as const; + +export const $ArrayWithStrings = { + description: 'This is a simple array with strings', + type: 'array', + items: { + type: 'string' + }, + default: ['test'] +} as const; + +export const $ArrayWithReferences = { + description: 'This is a simple array with references', + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithString' + } +} as const; + +export const $ArrayWithArray = { + description: 'This is a simple array containing an array', + type: 'array', + items: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithString' + } + } +} as const; + +export const $ArrayWithProperties = { + description: 'This is a simple array with properties', + type: 'array', + items: { + type: 'object', + properties: { + '16x16': { + '$ref': '#/components/schemas/camelCaseCommentWithBreaks' + }, + bar: { + type: 'string' + } + } + } +} as const; + +export const $ArrayWithAnyOfProperties = { + description: 'This is a simple array with any of properties', + type: 'array', + items: { + anyOf: [ + { + type: 'object', + properties: { + foo: { + type: 'string', + default: 'test' + } + } + }, + { + type: 'object', + properties: { + bar: { + type: 'string' + } + } + } + ] + } +} as const; + +export const $AnyOfAnyAndNull = { + type: 'object', + properties: { + data: { + anyOf: [ + {}, + { + type: 'null' + } + ] + } + } +} as const; + +export const $AnyOfArrays = { + description: 'This is a simple array with any of properties', + type: 'object', + properties: { + results: { + items: { + anyOf: [ + { + type: 'object', + properties: { + foo: { + type: 'string' + } + } + }, + { + type: 'object', + properties: { + bar: { + type: 'string' + } + } + } + ] + }, + type: 'array' + } + } +} as const; + +export const $DictionaryWithString = { + description: 'This is a string dictionary', + type: 'object', + additionalProperties: { + type: 'string' + } +} as const; + +export const $DictionaryWithPropertiesAndAdditionalProperties = { + type: 'object', + properties: { + foo: { + type: 'number' + }, + bar: { + type: 'boolean' + } + }, + additionalProperties: { + type: 'string' + } +} as const; + +export const $DictionaryWithReference = { + description: 'This is a string reference', + type: 'object', + additionalProperties: { + '$ref': '#/components/schemas/ModelWithString' + } +} as const; + +export const $DictionaryWithArray = { + description: 'This is a complex dictionary', + type: 'object', + additionalProperties: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithString' + } + } +} as const; + +export const $DictionaryWithDictionary = { + description: 'This is a string dictionary', + type: 'object', + additionalProperties: { + type: 'object', + additionalProperties: { + type: 'string' + } + } +} as const; + +export const $DictionaryWithProperties = { + description: 'This is a complex dictionary', + type: 'object', + additionalProperties: { + type: 'object', + properties: { + foo: { + type: 'string' + }, + bar: { + type: 'string' + } + } + } +} as const; + +export const $ModelWithInteger = { + description: 'This is a model with one number property', + type: 'object', + properties: { + prop: { + description: 'This is a simple number property', + type: 'integer' + } + } +} as const; + +export const $ModelWithBoolean = { + description: 'This is a model with one boolean property', + type: 'object', + properties: { + prop: { + description: 'This is a simple boolean property', + type: 'boolean' + } + } +} as const; + +export const $ModelWithString = { + description: 'This is a model with one string property', + type: 'object', + properties: { + prop: { + description: 'This is a simple string property', + type: 'string' + } + } +} as const; + +export const $ModelWithStringError = { + description: 'This is a model with one string property', + type: 'object', + properties: { + prop: { + description: 'This is a simple string property', + type: 'string' + } + } +} as const; + +export const $Model_From_Zendesk = { + description: `\`Comment\` or \`VoiceComment\`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets)`, + type: 'string' +} as const; + +export const $ModelWithNullableString = { + description: 'This is a model with one string property', + type: 'object', + required: ['nullableRequiredProp1', 'nullableRequiredProp2'], + properties: { + nullableProp1: { + description: 'This is a simple string property', + type: 'string', + nullable: true + }, + nullableRequiredProp1: { + description: 'This is a simple string property', + type: 'string', + nullable: true + }, + nullableProp2: { + description: 'This is a simple string property', + type: ['string', 'null'] + }, + nullableRequiredProp2: { + description: 'This is a simple string property', + type: ['string', 'null'] + }, + 'foo_bar-enum': { + description: 'This is a simple enum with strings', + enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + } + } +} as const; + +export const $ModelWithEnum = { + description: 'This is a model with one enum', + type: 'object', + properties: { + 'foo_bar-enum': { + description: 'This is a simple enum with strings', + enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + }, + statusCode: { + description: 'These are the HTTP error code enums', + enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar'] + }, + bool: { + description: 'Simple boolean enum', + type: 'boolean', + enum: [true] + } + } +} as const; + +export const $ModelWithEnumWithHyphen = { + description: 'This is a model with one enum with escaped name', + type: 'object', + properties: { + 'foo-bar-baz-qux': { + type: 'string', + enum: ['3.0'], + title: 'Foo-Bar-Baz-Qux', + default: '3.0' + } + } +} as const; + +export const $ModelWithEnumFromDescription = { + description: 'This is a model with one enum', + type: 'object', + properties: { + test: { + type: 'integer', + description: 'Success=1,Warning=2,Error=3' + } + } +} as const; + +export const $ModelWithNestedEnums = { + description: 'This is a model with nested enums', + type: 'object', + properties: { + dictionaryWithEnum: { + type: 'object', + additionalProperties: { + enum: ['Success', 'Warning', 'Error'] + } + }, + dictionaryWithEnumFromDescription: { + type: 'object', + additionalProperties: { + type: 'integer', + description: 'Success=1,Warning=2,Error=3' + } + }, + arrayWithEnum: { + type: 'array', + items: { + enum: ['Success', 'Warning', 'Error'] + } + }, + arrayWithDescription: { + type: 'array', + items: { + type: 'integer', + description: 'Success=1,Warning=2,Error=3' + } + }, + 'foo_bar-enum': { + description: 'This is a simple enum with strings', + enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + } + } +} as const; + +export const $ModelWithReference = { + description: 'This is a model with one property containing a reference', + type: 'object', + properties: { + prop: { + '$ref': '#/components/schemas/ModelWithProperties' + } + } +} as const; + +export const $ModelWithArrayReadOnlyAndWriteOnly = { + description: 'This is a model with one property containing an array', + type: 'object', + properties: { + prop: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnly' + } + }, + propWithFile: { + type: 'array', + items: { + type: 'file' + } + }, + propWithNumber: { + type: 'array', + items: { + type: 'number' + } + } + } +} as const; + +export const $ModelWithArray = { + description: 'This is a model with one property containing an array', + type: 'object', + properties: { + prop: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithString' + } + }, + propWithFile: { + type: 'array', + items: { + type: 'file' + } + }, + propWithNumber: { + type: 'array', + items: { + type: 'number' + } + } + } +} as const; + +export const $ModelWithDictionary = { + description: 'This is a model with one property containing a dictionary', + type: 'object', + properties: { + prop: { + type: 'object', + additionalProperties: { + type: 'string' + } + } + } +} as const; + +export const $DeprecatedModel = { + deprecated: true, + description: 'This is a deprecated model with a deprecated property', + type: 'object', + properties: { + prop: { + deprecated: true, + description: 'This is a deprecated property', + type: 'string' + } + } +} as const; + +export const $ModelWithCircularReference = { + description: 'This is a model with one property containing a circular reference', + type: 'object', + properties: { + prop: { + '$ref': '#/components/schemas/ModelWithCircularReference' + } + } +} as const; + +export const $CompositionWithOneOf = { + description: "This is a model with one property with a 'one of' relationship", + type: 'object', + properties: { + propA: { + type: 'object', + oneOf: [ + { + '$ref': '#/components/schemas/ModelWithString' + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const $CompositionWithOneOfAnonymous = { + description: "This is a model with one property with a 'one of' relationship where the options are not $ref", + type: 'object', + properties: { + propA: { + type: 'object', + oneOf: [ + { + description: 'Anonymous object type', + type: 'object', + properties: { + propA: { + type: 'string' + } + } + }, + { + description: 'Anonymous string type', + type: 'string' + }, + { + description: 'Anonymous integer type', + type: 'integer' + } + ] + } + } +} as const; + +export const $ModelCircle = { + description: 'Circle', + type: 'object', + required: ['kind'], + properties: { + kind: { + type: 'string' + }, + radius: { + type: 'number' + } + } +} as const; + +export const $ModelSquare = { + description: 'Square', + type: 'object', + required: ['kind'], + properties: { + kind: { + type: 'string' + }, + sideLength: { + type: 'number' + } + } +} as const; + +export const $CompositionWithOneOfDiscriminator = { + description: "This is a model with one property with a 'one of' relationship where the options are not $ref", + type: 'object', + oneOf: [ + { + '$ref': '#/components/schemas/ModelCircle' + }, + { + '$ref': '#/components/schemas/ModelSquare' + } + ], + discriminator: { + propertyName: 'kind', + mapping: { + circle: '#/components/schemas/ModelCircle', + square: '#/components/schemas/ModelSquare' + } + } +} as const; + +export const $CompositionWithAnyOf = { + description: "This is a model with one property with a 'any of' relationship", + type: 'object', + properties: { + propA: { + type: 'object', + anyOf: [ + { + '$ref': '#/components/schemas/ModelWithString' + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const $CompositionWithAnyOfAnonymous = { + description: "This is a model with one property with a 'any of' relationship where the options are not $ref", + type: 'object', + properties: { + propA: { + type: 'object', + anyOf: [ + { + description: 'Anonymous object type', + type: 'object', + properties: { + propA: { + type: 'string' + } + } + }, + { + description: 'Anonymous string type', + type: 'string' + }, + { + description: 'Anonymous integer type', + type: 'integer' + } + ] + } + } +} as const; + +export const $CompositionWithNestedAnyAndTypeNull = { + description: "This is a model with nested 'any of' property with a type null", + type: 'object', + properties: { + propA: { + type: 'object', + anyOf: [ + { + items: { + anyOf: [ + { + '$ref': '#/components/schemas/ModelWithDictionary' + }, + { + type: 'null' + } + ] + }, + type: 'array' + }, + { + items: { + anyOf: [ + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + type: 'null' + } + ] + }, + type: 'array' + } + ] + } + } +} as const; + +export const $3e_num_1Период = { + enum: ['Bird', 'Dog'], + type: 'string' +} as const; + +export const $ConstValue = { + type: 'string', + const: 'ConstValue' +} as const; + +export const $CompositionWithNestedAnyOfAndNull = { + description: "This is a model with one property with a 'any of' relationship where the options are not $ref", + type: 'object', + properties: { + propA: { + anyOf: [ + { + items: { + anyOf: [ + { + '$ref': '#/components/schemas/3e-num_1Период' + }, + { + '$ref': '#/components/schemas/ConstValue' + } + ] + }, + type: 'array' + }, + { + type: 'null' + } + ], + title: 'Scopes' + } + } +} as const; + +export const $CompositionWithOneOfAndNullable = { + description: "This is a model with one property with a 'one of' relationship", + type: 'object', + properties: { + propA: { + nullable: true, + type: 'object', + oneOf: [ + { + type: 'object', + properties: { + boolean: { + type: 'boolean' + } + } + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const $CompositionWithOneOfAndSimpleDictionary = { + description: 'This is a model that contains a simple dictionary within composition', + type: 'object', + properties: { + propA: { + oneOf: [ + { + type: 'boolean' + }, + { + type: 'object', + additionalProperties: { + type: 'number' + } + } + ] + } + } +} as const; + +export const $CompositionWithOneOfAndSimpleArrayDictionary = { + description: 'This is a model that contains a dictionary of simple arrays within composition', + type: 'object', + properties: { + propA: { + oneOf: [ + { + type: 'boolean' + }, + { + type: 'object', + additionalProperties: { + type: 'array', + items: { + type: 'boolean' + } + } + } + ] + } + } +} as const; + +export const $CompositionWithOneOfAndComplexArrayDictionary = { + description: 'This is a model that contains a dictionary of complex arrays (composited) within composition', + type: 'object', + properties: { + propA: { + oneOf: [ + { + type: 'boolean' + }, + { + type: 'object', + additionalProperties: { + type: 'array', + items: { + oneOf: [ + { + type: 'number' + }, + { + type: 'string' + } + ] + } + } + } + ] + } + } +} as const; + +export const $CompositionWithAllOfAndNullable = { + description: "This is a model with one property with a 'all of' relationship", + type: 'object', + properties: { + propA: { + nullable: true, + type: 'object', + allOf: [ + { + type: 'object', + properties: { + boolean: { + type: 'boolean' + } + } + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const $CompositionWithAnyOfAndNullable = { + description: "This is a model with one property with a 'any of' relationship", + type: 'object', + properties: { + propA: { + nullable: true, + type: 'object', + anyOf: [ + { + type: 'object', + properties: { + boolean: { + type: 'boolean' + } + } + }, + { + '$ref': '#/components/schemas/ModelWithEnum' + }, + { + '$ref': '#/components/schemas/ModelWithArray' + }, + { + '$ref': '#/components/schemas/ModelWithDictionary' + } + ] + } + } +} as const; + +export const $CompositionBaseModel = { + description: 'This is a base model with two simple optional properties', + type: 'object', + properties: { + firstName: { + type: 'string' + }, + lastname: { + type: 'string' + } + } +} as const; + +export const $CompositionExtendedModel = { + description: 'This is a model that extends the base model', + type: 'object', + allOf: [ + { + '$ref': '#/components/schemas/CompositionBaseModel' + } + ], + properties: { + age: { + type: 'number' + } + }, + required: ['firstName', 'lastname', 'age'] +} as const; + +export const $ModelWithProperties = { + description: 'This is a model with one nested property', + type: 'object', + required: ['required', 'requiredAndReadOnly', 'requiredAndNullable'], + properties: { + required: { + type: 'string' + }, + requiredAndReadOnly: { + type: 'string', + readOnly: true + }, + requiredAndNullable: { + type: 'string', + nullable: true + }, + string: { + type: 'string' + }, + number: { + type: 'number' + }, + boolean: { + type: 'boolean' + }, + reference: { + '$ref': '#/components/schemas/ModelWithString' + }, + 'property with space': { + type: 'string' + }, + default: { + type: 'string' + }, + try: { + type: 'string' + }, + '@namespace.string': { + type: 'string', + readOnly: true + }, + '@namespace.integer': { + type: 'integer', + readOnly: true + } + } +} as const; + +export const $ModelWithNestedProperties = { + description: 'This is a model with one nested property', + type: 'object', + required: ['first'], + properties: { + first: { + type: 'object', + required: ['second'], + readOnly: true, + nullable: true, + properties: { + second: { + type: 'object', + required: ['third'], + readOnly: true, + nullable: true, + properties: { + third: { + type: 'string', + required: true, + readOnly: true, + nullable: true + } + } + } + } + } + } +} as const; + +export const $ModelWithDuplicateProperties = { + description: 'This is a model with duplicated properties', + type: 'object', + properties: { + prop: { + '$ref': '#/components/schemas/ModelWithString' + } + } +} as const; + +export const $ModelWithOrderedProperties = { + description: 'This is a model with ordered properties', + type: 'object', + properties: { + zebra: { + type: 'string' + }, + apple: { + type: 'string' + }, + hawaii: { + type: 'string' + } + } +} as const; + +export const $ModelWithDuplicateImports = { + description: 'This is a model with duplicated imports', + type: 'object', + properties: { + propA: { + '$ref': '#/components/schemas/ModelWithString' + }, + propB: { + '$ref': '#/components/schemas/ModelWithString' + }, + propC: { + '$ref': '#/components/schemas/ModelWithString' + } + } +} as const; + +export const $ModelThatExtends = { + description: 'This is a model that extends another model', + type: 'object', + allOf: [ + { + '$ref': '#/components/schemas/ModelWithString' + }, + { + type: 'object', + properties: { + propExtendsA: { + type: 'string' + }, + propExtendsB: { + '$ref': '#/components/schemas/ModelWithString' + } + } + } + ] +} as const; + +export const $ModelThatExtendsExtends = { + description: 'This is a model that extends another model', + type: 'object', + allOf: [ + { + '$ref': '#/components/schemas/ModelWithString' + }, + { + '$ref': '#/components/schemas/ModelThatExtends' + }, + { + type: 'object', + properties: { + propExtendsC: { + type: 'string' + }, + propExtendsD: { + '$ref': '#/components/schemas/ModelWithString' + } + } + } + ] +} as const; + +export const $ModelWithPattern = { + description: 'This is a model that contains a some patterns', + type: 'object', + required: ['key', 'name'], + properties: { + key: { + maxLength: 64, + pattern: '^[a-zA-Z0-9_]*$', + type: 'string' + }, + name: { + maxLength: 255, + type: 'string' + }, + enabled: { + type: 'boolean', + readOnly: true + }, + modified: { + type: 'string', + format: 'date-time', + readOnly: true + }, + id: { + type: 'string', + pattern: '^\\d{2}-\\d{3}-\\d{4}$' + }, + text: { + type: 'string', + pattern: '^\\w+$' + }, + patternWithSingleQuotes: { + type: 'string', + pattern: "^[a-zA-Z0-9']*$" + }, + patternWithNewline: { + type: 'string', + pattern: 'aaa\\nbbb' + }, + patternWithBacktick: { + type: 'string', + pattern: 'aaa`bbb' + } + } +} as const; + +export const $File = { + required: ['mime'], + type: 'object', + properties: { + id: { + title: 'Id', + type: 'string', + readOnly: true, + minLength: 1 + }, + updated_at: { + title: 'Updated at', + type: 'string', + format: 'date-time', + readOnly: true + }, + created_at: { + title: 'Created at', + type: 'string', + format: 'date-time', + readOnly: true + }, + mime: { + title: 'Mime', + type: 'string', + maxLength: 24, + minLength: 1 + }, + file: { + title: 'File', + type: 'string', + readOnly: true, + format: 'uri' + } + } +} as const; + +export const $default = { + type: 'object', + properties: { + name: { + type: 'string' + } + } +} as const; + +export const $Pageable = { + type: 'object', + properties: { + page: { + minimum: 0, + type: 'integer', + format: 'int32', + default: 0 + }, + size: { + minimum: 1, + type: 'integer', + format: 'int32' + }, + sort: { + type: 'array', + items: { + type: 'string' + } + } + } +} as const; + +export const $FreeFormObjectWithoutAdditionalProperties = { + description: 'This is a free-form object without additionalProperties.', + type: 'object' +} as const; + +export const $FreeFormObjectWithAdditionalPropertiesEqTrue = { + description: 'This is a free-form object with additionalProperties: true.', + type: 'object', + additionalProperties: true +} as const; + +export const $FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { + description: 'This is a free-form object with additionalProperties: {}.', + type: 'object', + additionalProperties: {} +} as const; + +export const $ModelWithConst = { + type: 'object', + properties: { + String: { + const: 'String' + }, + number: { + const: 0 + }, + null: { + const: null + }, + withType: { + type: 'string', + const: 'Some string' + } + } +} as const; + +export const $ModelWithAdditionalPropertiesEqTrue = { + description: 'This is a model with one property and additionalProperties: true', + type: 'object', + properties: { + prop: { + description: 'This is a simple string property', + type: 'string' + } + }, + additionalProperties: true +} as const; + +export const $NestedAnyOfArraysNullable = { + properties: { + nullableArray: { + anyOf: [ + { + items: { + anyOf: [ + { + type: 'string' + }, + { + type: 'boolean' + } + ] + }, + type: 'array' + }, + { + type: 'null' + } + ] + } + }, + type: 'object' +} as const; + +export const $CompositionWithOneOfAndProperties = { + type: 'object', + oneOf: [ + { + type: 'object', + required: ['foo'], + properties: { + foo: { + '$ref': '#/components/parameters/SimpleParameter' + } + }, + additionalProperties: false + }, + { + type: 'object', + required: ['bar'], + properties: { + bar: { + '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' + } + }, + additionalProperties: false + } + ], + required: ['baz', 'qux'], + properties: { + baz: { + type: 'integer', + format: 'uint16', + minimum: 0, + nullable: true + }, + qux: { + type: 'integer', + format: 'uint8', + minimum: 0 + } + } +} as const; + +export const $NullableObject = { + type: ['object', 'null'], + description: 'An object that can be null', + properties: { + foo: { + type: 'string' + } + }, + default: null +} as const; + +export const $CharactersInDescription = { + type: 'string', + description: 'Some % character' +} as const; + +export const $ModelWithNullableObject = { + type: 'object', + properties: { + data: { + '$ref': '#/components/schemas/NullableObject' + } + } +} as const; + +export const $ModelWithOneOfEnum = { + oneOf: [ + { + type: 'object', + required: ['foo'], + properties: { + foo: { + type: 'string', + enum: ['Bar'] + } + } + }, + { + type: 'object', + required: ['foo'], + properties: { + foo: { + type: 'string', + enum: ['Baz'] + } + } + }, + { + type: 'object', + required: ['foo'], + properties: { + foo: { + type: 'string', + enum: ['Qux'] + } + } + }, + { + type: 'object', + required: ['content', 'foo'], + properties: { + content: { + type: 'string', + format: 'date-time' + }, + foo: { + type: 'string', + enum: ['Quux'] + } + } + }, + { + type: 'object', + required: ['content', 'foo'], + properties: { + content: { + type: 'array', + items: [ + { + type: 'string', + format: 'date-time' + }, + { + type: 'string' + } + ], + maxItems: 2, + minItems: 2 + }, + foo: { + type: 'string', + enum: ['Corge'] + } + } + } + ] +} as const; + +export const $ModelWithNestedArrayEnumsDataFoo = { + enum: ['foo', 'bar'], + type: 'string' +} as const; + +export const $ModelWithNestedArrayEnumsDataBar = { + enum: ['baz', 'qux'], + type: 'string' +} as const; + +export const $ModelWithNestedArrayEnumsData = { + type: 'object', + properties: { + foo: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' + } + }, + bar: { + type: 'array', + items: { + '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataBar' + } + } + } +} as const; + +export const $ModelWithNestedArrayEnums = { + type: 'object', + properties: { + array_strings: { + type: 'array', + items: { + type: 'string' + } + }, + data: { + allOf: [ + { + '$ref': '#/components/schemas/ModelWithNestedArrayEnumsData' + } + ] + } + } +} as const; + +export const $ModelWithNestedCompositionEnums = { + type: 'object', + properties: { + foo: { + allOf: [ + { + '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' + } + ] + } + } +} as const; + +export const $ModelWithReadOnlyAndWriteOnly = { + type: 'object', + required: ['foo', 'bar', 'baz'], + properties: { + foo: { + type: 'string' + }, + bar: { + readOnly: true, + type: 'string' + }, + baz: { + type: 'string', + writeOnly: true + } + } +} as const; + +export const $ModelWithConstantSizeArray = { + type: 'array', + items: { + type: 'number' + }, + minItems: 2, + maxItems: 2 +} as const; + +export const $ModelWithAnyOfConstantSizeArray = { + type: 'array', + items: { + oneOf: [ + { + type: 'number' + }, + { + type: 'string' + } + ] + }, + minItems: 3, + maxItems: 3 +} as const; + +export const $ModelWithPrefixItemsConstantSizeArray = { + type: 'array', + prefixItems: [ + { + '$ref': '#/components/schemas/ModelWithInteger' + }, + { + oneOf: [ + { + type: 'number' + }, + { + type: 'string' + } + ] + }, + { + type: 'string' + } + ] +} as const; + +export const $ModelWithAnyOfConstantSizeArrayNullable = { + type: ['array'], + items: { + oneOf: [ + { + type: 'number', + nullable: true + }, + { + type: 'string' + } + ] + }, + minItems: 3, + maxItems: 3 +} as const; + +export const $ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = { + type: 'array', + items: { + oneOf: [ + { + type: 'number' + }, + { + '$ref': '#/components/schemas/import' + } + ] + }, + minItems: 2, + maxItems: 2 +} as const; + +export const $ModelWithAnyOfConstantSizeArrayAndIntersect = { + type: 'array', + items: { + allOf: [ + { + type: 'number' + }, + { + type: 'string' + } + ] + }, + minItems: 2, + maxItems: 2 +} as const; + +export const $ModelWithNumericEnumUnion = { + type: 'object', + properties: { + value: { + type: 'number', + description: 'Период', + enum: [-10, -1, 0, 1, 3, 6, 12] + } + } +} as const; + +export const $ModelWithBackticksInDescription = { + description: 'Some description with `back ticks`', + type: 'object', + properties: { + template: { + type: 'string', + description: `The template \`that\` should be used for parsing and importing the contents of the CSV file. + +

There is one placeholder currently supported:

  • \${x} - refers to the n-th column in the CSV file, e.g. \${1}, \${2}, ...)

Example of a correct JSON template:

+
+[
+  {
+    "resourceType": "Asset",
+    "identifier": {
+      "name": "\${1}",
+      "domain": {
+        "name": "\${2}",
+        "community": {
+          "name": "Some Community"
+        }
+      }
+    },
+    "attributes" : {
+      "00000000-0000-0000-0000-000000003115" : [ {
+        "value" : "\${3}" 
+      } ],
+      "00000000-0000-0000-0000-000000000222" : [ {
+        "value" : "\${4}"
+      } ]
+    }
+  }
+]
+
` + } + } +} as const; + +export const $ModelWithOneOfAndProperties = { + type: 'object', + oneOf: [ + { + '$ref': '#/components/parameters/SimpleParameter' + }, + { + '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' + } + ], + required: ['baz', 'qux'], + properties: { + baz: { + type: 'integer', + format: 'uint16', + minimum: 0, + nullable: true + }, + qux: { + type: 'integer', + format: 'uint8', + minimum: 0 + } + } +} as const; + +export const $ParameterSimpleParameterUnused = { + description: 'Model used to test deduplication strategy (unused)', + type: 'string' +} as const; + +export const $PostServiceWithEmptyTagResponse = { + description: 'Model used to test deduplication strategy', + type: 'string' +} as const; + +export const $PostServiceWithEmptyTagResponse2 = { + description: 'Model used to test deduplication strategy', + type: 'string' +} as const; + +export const $DeleteFooData = { + description: 'Model used to test deduplication strategy', + type: 'string' +} as const; + +export const $DeleteFooData2 = { + description: 'Model used to test deduplication strategy', + type: 'string' +} as const; + +export const $import = { + description: 'Model with restricted keyword name', + type: 'string' +} as const; + +export const $SchemaWithFormRestrictedKeys = { + properties: { + description: { + type: 'string' + }, + 'x-enum-descriptions': { + type: 'string' + }, + 'x-enum-varnames': { + type: 'string' + }, + 'x-enumNames': { + type: 'string' + }, + title: { + type: 'string' + }, + object: { + type: 'object', + properties: { + description: { + type: 'string' + }, + 'x-enum-descriptions': { + type: 'string' + }, + 'x-enum-varnames': { + type: 'string' + }, + 'x-enumNames': { + type: 'string' + }, + title: { + type: 'string' + } + } + }, + array: { + type: 'array', + items: [ + { + type: 'object', + properties: { + description: { + type: 'string' + }, + 'x-enum-descriptions': { + type: 'string' + }, + 'x-enum-varnames': { + type: 'string' + }, + 'x-enumNames': { + type: 'string' + }, + title: { + type: 'string' + } + } + } + ] + } + } +} as const; + +export const $io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { + description: 'This schema was giving PascalCase transformations a hard time', + properties: { + preconditions: { + allOf: [ + { + '$ref': '#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions' + } + ], + description: 'Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.' + } + }, + type: 'object' +} as const; + +export const $io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { + description: 'This schema was giving PascalCase transformations a hard time', + properties: { + resourceVersion: { + description: 'Specifies the target ResourceVersion', + type: 'string' + }, + uid: { + description: 'Specifies the target UID.', + type: 'string' + } + }, + type: 'object' +} as const; + +export const $AdditionalPropertiesUnknownIssue = { + type: 'object', + properties: {}, + additionalProperties: { + anyOf: [ + { + type: 'string' + }, + { + type: 'number' + } + ] + } +} as const; + +export const $AdditionalPropertiesUnknownIssue2 = { + type: 'object', + additionalProperties: { + anyOf: [ + { + type: 'string' + }, + { + type: 'number' + } + ] + } +} as const; + +export const $AdditionalPropertiesUnknownIssue3 = { + type: 'object', + allOf: [ + { + type: 'string' + }, + { + type: 'object', + required: ['entries'], + properties: { + entries: { + additionalProperties: { + '$ref': '#/components/schemas/AdditionalPropertiesUnknownIssue' + } + } + } + } + ] +} as const; + +export const $AdditionalPropertiesIntegerIssue = { + type: 'object', + required: ['value'], + properties: { + value: { + type: 'integer' + } + }, + additionalProperties: { + type: 'integer' + } +} as const; + +export const $OneOfAllOfIssue = { + oneOf: [ + { + allOf: [ + { + oneOf: [ + { + '$ref': '#/components/schemas/ConstValue' + }, + { + '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]' + } + ] + }, + { + '$ref': '#/components/schemas/3e-num_1Период' + } + ] + }, + { + '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]' + } + ] +} as const; + +export const $Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { + type: 'object', + properties: { + item: { + type: 'boolean' + }, + error: { + type: 'string', + nullable: true + }, + hasError: { + type: 'boolean', + readOnly: true + }, + data: { + type: 'object', + properties: {}, + additionalProperties: false + } + }, + additionalProperties: false +} as const; + +export const $Generic_Schema_Duplicate_Issue_1_System_String_ = { + type: 'object', + properties: { + item: { + type: 'string', + nullable: true + }, + error: { + type: 'string', + nullable: true + }, + hasError: { + type: 'boolean', + readOnly: true + } + }, + additionalProperties: false +} as const; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3-types-PascalCase/index.ts b/packages/openapi-ts-tests/test/generated/v3-types-PascalCase/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3-types-PascalCase/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3-types-PascalCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3-types-PascalCase/types.gen.ts new file mode 100644 index 000000000..f6a6095e3 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3-types-PascalCase/types.gen.ts @@ -0,0 +1,1970 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = unknown; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string; + /** + * This is a simple string property + */ + nullableRequiredProp1: string; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReference = { + prop?: ModelWithProperties; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnly = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: { + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithProperties = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedProperties = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPattern = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type File = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + unknown, + unknown + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnly = { + foo: string; + readonly bar: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | string, + number | string, + number | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: unknown; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssue = ((ConstValue | GenericSchemaDuplicateIssue1SystemBoolean) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemString; + +export type GenericSchemaDuplicateIssue1SystemBoolean = { + item?: boolean; + error?: string; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemString = { + item?: string; + error?: string; + readonly hasError?: boolean; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnly; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: unknown; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: unknown; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: unknown; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: unknown; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: unknown; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: unknown; + }; + url: '/api/v{api-version}/descriptions/'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + }; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters/'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters/'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody/'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData/'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string; + /** + * This is a simple number with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + }; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + /** + * This is tuple parameter + */ + parameterTuple: [ + number, + number, + number, + number + ]; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: unknown; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: unknown; +}; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + readonly key: string; + name: string; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array; + listOfStrings?: Array; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + readonly user?: { + readonly id?: number; + readonly name?: string; + }; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3/core/ApiError.ts new file mode 100644 index 000000000..36675d288 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3/core/ApiError.ts @@ -0,0 +1,21 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; + +export class ApiError extends Error { + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: unknown; + public readonly request: ApiRequestOptions; + + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); + + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3/core/ApiRequestOptions.ts new file mode 100644 index 000000000..939a0aa4c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3/core/ApiRequestOptions.ts @@ -0,0 +1,21 @@ +export type ApiRequestOptions = { + readonly body?: any; + readonly cookies?: Record; + readonly errors?: Record; + readonly formData?: Record | any[] | Blob | File; + readonly headers?: Record; + readonly mediaType?: string; + readonly method: + | 'DELETE' + | 'GET' + | 'HEAD' + | 'OPTIONS' + | 'PATCH' + | 'POST' + | 'PUT'; + readonly path?: Record; + readonly query?: Record; + readonly responseHeader?: string; + readonly responseTransformer?: (data: unknown) => Promise; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3/core/ApiResult.ts new file mode 100644 index 000000000..4c58e3913 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3/core/ApiResult.ts @@ -0,0 +1,7 @@ +export type ApiResult = { + readonly body: TData; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3/core/CancelablePromise.ts new file mode 100644 index 000000000..ccc082e8f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3/core/CancelablePromise.ts @@ -0,0 +1,126 @@ +export class CancelError extends Error { + constructor(message: string) { + super(message); + this.name = 'CancelError'; + } + + public get isCancelled(): boolean { + return true; + } +} + +export interface OnCancel { + readonly isResolved: boolean; + readonly isRejected: boolean; + readonly isCancelled: boolean; + + (cancelHandler: () => void): void; +} + +export class CancelablePromise implements Promise { + private _isResolved: boolean; + private _isRejected: boolean; + private _isCancelled: boolean; + readonly cancelHandlers: (() => void)[]; + readonly promise: Promise; + private _resolve?: (value: T | PromiseLike) => void; + private _reject?: (reason?: unknown) => void; + + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason?: unknown) => void, + onCancel: OnCancel + ) => void + ) { + this._isResolved = false; + this._isRejected = false; + this._isCancelled = false; + this.cancelHandlers = []; + this.promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + + const onResolve = (value: T | PromiseLike): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isResolved = true; + if (this._resolve) this._resolve(value); + }; + + const onReject = (reason?: unknown): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isRejected = true; + if (this._reject) this._reject(reason); + }; + + const onCancel = (cancelHandler: () => void): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this.cancelHandlers.push(cancelHandler); + }; + + Object.defineProperty(onCancel, 'isResolved', { + get: (): boolean => this._isResolved, + }); + + Object.defineProperty(onCancel, 'isRejected', { + get: (): boolean => this._isRejected, + }); + + Object.defineProperty(onCancel, 'isCancelled', { + get: (): boolean => this._isCancelled, + }); + + return executor(onResolve, onReject, onCancel as OnCancel); + }); + } + + get [Symbol.toStringTag]() { + return "Cancellable Promise"; + } + + public then( + onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null + ): Promise { + return this.promise.then(onFulfilled, onRejected); + } + + public catch( + onRejected?: ((reason: unknown) => TResult | PromiseLike) | null + ): Promise { + return this.promise.catch(onRejected); + } + + public finally(onFinally?: (() => void) | null): Promise { + return this.promise.finally(onFinally); + } + + public cancel(): void { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isCancelled = true; + if (this.cancelHandlers.length) { + try { + for (const cancelHandler of this.cancelHandlers) { + cancelHandler(); + } + } catch (error) { + console.warn('Cancellation threw an error', error); + return; + } + } + this.cancelHandlers.length = 0; + if (this._reject) this._reject(new CancelError('Request aborted')); + } + + public get isCancelled(): boolean { + return this._isCancelled; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3/core/OpenAPI.ts new file mode 100644 index 000000000..144e25744 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3/core/OpenAPI.ts @@ -0,0 +1,56 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; + +type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware): void { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Middleware): void { + this._fns = [...this._fns, fn]; + } +} + +export type OpenAPIConfig = { + BASE: string; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + VERSION: string; + WITH_CREDENTIALS: boolean; + interceptors: { + request: Interceptors; + response: Interceptors; + }; +}; + +export const OpenAPI: OpenAPIConfig = { + BASE: 'http://localhost:3000/base', + CREDENTIALS: 'include', + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + TOKEN: undefined, + USERNAME: undefined, + VERSION: '1.0', + WITH_CREDENTIALS: false, + interceptors: { + request: new Interceptors(), + response: new Interceptors(), + }, +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3/core/request.ts b/packages/openapi-ts-tests/test/generated/v3/core/request.ts new file mode 100644 index 000000000..5458a2899 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3/core/request.ts @@ -0,0 +1,350 @@ +import { ApiError } from './ApiError'; +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; +import { CancelablePromise } from './CancelablePromise'; +import type { OnCancel } from './CancelablePromise'; +import type { OpenAPIConfig } from './OpenAPI'; + +export const isString = (value: unknown): value is string => { + return typeof value === 'string'; +}; + +export const isStringWithValue = (value: unknown): value is string => { + return isString(value) && value !== ''; +}; + +export const isBlob = (value: any): value is Blob => { + return value instanceof Blob; +}; + +export const isFormData = (value: unknown): value is FormData => { + return value instanceof FormData; +}; + +export const base64 = (str: string): string => { + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } +}; + +export const getQueryString = (params: Record): string => { + const qs: string[] = []; + + const append = (key: string, value: unknown) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; + + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; + } + + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { + value.forEach(v => encodePair(key, v)); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); + } + }; + + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); + + return qs.length ? `?${qs.join('&')}` : ''; +}; + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI; + + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); + + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; +}; + +export const getFormData = (options: ApiRequestOptions): FormData | undefined => { + if (options.formData) { + const formData = new FormData(); + + const process = (key: string, value: unknown) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; + + Object.entries(options.formData) + .filter(([, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); + + return formData; + } + return undefined; +}; + +type Resolver = (options: ApiRequestOptions) => Promise; + +export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; +}; + +export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { + const [token, username, password, additionalHeaders] = await Promise.all([ + // @ts-ignore + resolve(options, config.TOKEN), + // @ts-ignore + resolve(options, config.USERNAME), + // @ts-ignore + resolve(options, config.PASSWORD), + // @ts-ignore + resolve(options, config.HEADERS), + ]); + + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + }) + .filter(([, value]) => value !== undefined && value !== null) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); + + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } + + return new Headers(headers); +}; + +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body !== undefined) { + if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { + return JSON.stringify(options.body); + } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { + return options.body; + } else { + return JSON.stringify(options.body); + } + } + return undefined; +}; + +export const sendRequest = async ( + config: OpenAPIConfig, + options: ApiRequestOptions, + url: string, + body: any, + formData: FormData | undefined, + headers: Headers, + onCancel: OnCancel +): Promise => { + const controller = new AbortController(); + + let request: RequestInit = { + headers, + body: body ?? formData, + method: options.method, + signal: controller.signal, + }; + + if (config.WITH_CREDENTIALS) { + request.credentials = config.CREDENTIALS; + } + + for (const fn of config.interceptors.request._fns) { + request = await fn(request); + } + + onCancel(() => controller.abort()); + + return await fetch(url, request); +}; + +export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { + if (responseHeader) { + const content = response.headers.get(responseHeader); + if (isString(content)) { + return content; + } + } + return undefined; +}; + +export const getResponseBody = async (response: Response): Promise => { + if (response.status !== 204) { + try { + const contentType = response.headers.get('Content-Type'); + if (contentType) { + const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; + if (contentType.includes('application/json') || contentType.includes('+json')) { + return await response.json(); + } else if (binaryTypes.some(type => contentType.includes(type))) { + return await response.blob(); + } else if (contentType.includes('multipart/form-data')) { + return await response.formData(); + } else if (contentType.includes('text/')) { + return await response.text(); + } + } + } catch (error) { + console.error(error); + } + } + return undefined; +}; + +export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Payload Too Large', + 414: 'URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Range Not Satisfiable', + 417: 'Expectation Failed', + 418: 'Im a teapot', + 421: 'Misdirected Request', + 422: 'Unprocessable Content', + 423: 'Locked', + 424: 'Failed Dependency', + 425: 'Too Early', + 426: 'Upgrade Required', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', + 451: 'Unavailable For Legal Reasons', + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 508: 'Loop Detected', + 510: 'Not Extended', + 511: 'Network Authentication Required', + ...options.errors, + } + + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } + + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } +}; + +/** + * Request method + * @param config The OpenAPI configuration object + * @param options The request options from the service + * @returns CancelablePromise + * @throws ApiError + */ +export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { + return new CancelablePromise(async (resolve, reject, onCancel) => { + try { + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); + const headers = await getHeaders(config, options); + + if (!onCancel.isCancelled) { + let response = await sendRequest(config, options, url, body, formData, headers, onCancel); + + for (const fn of config.interceptors.response._fns) { + response = await fn(response); + } + + const responseBody = await getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + + let transformedBody = responseBody; + if (options.responseTransformer && response.ok) { + transformedBody = await options.responseTransformer(responseBody) + } + + const result: ApiResult = { + url, + ok: response.ok, + status: response.status, + statusText: response.statusText, + body: responseHeader ?? transformedBody, + }; + + catchErrorCodes(options, result); + + resolve(result.body); + } + } catch (error) { + reject(error); + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3/index.ts b/packages/openapi-ts-tests/test/generated/v3/index.ts new file mode 100644 index 000000000..50a1dd734 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3/index.ts @@ -0,0 +1,6 @@ +// This file is auto-generated by @hey-api/openapi-ts +export { ApiError } from './core/ApiError'; +export { CancelablePromise, CancelError } from './core/CancelablePromise'; +export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3/sdk.gen.ts new file mode 100644 index 000000000..f62288bcf --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3/sdk.gen.ts @@ -0,0 +1,913 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CancelablePromise } from './core/CancelablePromise'; +import { OpenAPI } from './core/OpenAPI'; +import { request as __request } from './core/request'; +import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; + +export class CollectionFormatService { + /** + * @param data The data for the request. + * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) + * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) + * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) + * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) + * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) + * @throws ApiError + */ + public static collectionFormat(data: CollectionFormatData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/collectionFormat', + query: { + parameterArrayCSV: data.parameterArrayCsv, + parameterArraySSV: data.parameterArraySsv, + parameterArrayTSV: data.parameterArrayTsv, + parameterArrayPipes: data.parameterArrayPipes, + parameterArrayMulti: data.parameterArrayMulti + } + }); + } + +} + +export class ComplexService { + /** + * @param data The data for the request. + * @param data.parameterObject Parameter containing object + * @param data.parameterReference Parameter containing reference + * @returns ModelWithString Successful response + * @throws ApiError + */ + public static complexTypes(data: ComplexTypesData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/complex', + query: { + parameterObject: data.parameterObject, + parameterReference: data.parameterReference + }, + errors: { + 400: '400 `server` error', + 500: '500 server error' + } + }); + } + + /** + * @param data The data for the request. + * @param data.id + * @param data.requestBody + * @returns ModelWithString Success + * @throws ApiError + */ + public static complexParams(data: ComplexParamsData): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/complex/{id}', + path: { + id: data.id + }, + body: data.requestBody, + mediaType: 'application/json-patch+json' + }); + } + +} + +export class DefaultService { + /** + * @throws ApiError + */ + public static export(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public static patchApiNoTag(): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @param data The data for the request. + * @param data.requestBody + * @returns Model_From_Zendesk Success + * @returns ModelWithReadOnlyAndWriteOnly Default success response + * @throws ApiError + */ + public static import(data: ImportData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/no+tag', + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public static fooWow(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @param data The data for the request. + * @param data.fooParam foo in method + * @returns number Response is a simple number + * @throws ApiError + */ + public static getApiSimpleOperation(data: GetApiSimpleOperationData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple:operation', + path: { + foo_param: data.fooParam + }, + errors: { + default: 'Default error response' + } + }); + } + +} + +export class DefaultsService { + /** + * @param data The data for the request. + * @param data.parameterString This is a simple string with default value + * @param data.parameterNumber This is a simple number with default value + * @param data.parameterBoolean This is a simple boolean with default value + * @param data.parameterEnum This is a simple enum with default value + * @param data.parameterModel This is a simple model with default value + * @throws ApiError + */ + public static callWithDefaultParameters(data: CallWithDefaultParametersData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterString This is a simple string that is optional with default value + * @param data.parameterNumber This is a simple number that is optional with default value + * @param data.parameterBoolean This is a simple boolean that is optional with default value + * @param data.parameterEnum This is a simple enum that is optional with default value + * @param data.parameterModel This is a simple model that is optional with default value + * @throws ApiError + */ + public static callWithDefaultOptionalParameters(data: CallWithDefaultOptionalParametersData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterStringWithNoDefault This is a string with no default + * @param data.parameterOptionalStringWithDefault This is a optional string with default + * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default + * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default + * @param data.parameterStringWithDefault This is a string with default + * @param data.parameterStringWithEmptyDefault This is a string with empty default + * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default + * @param data.parameterStringNullableWithDefault This is a string that can be null with default + * @throws ApiError + */ + public static callToTestOrderOfParams(data: CallToTestOrderOfParamsData): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/defaults', + query: { + parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, + parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, + parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, + parameterStringWithDefault: data.parameterStringWithDefault, + parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, + parameterStringWithNoDefault: data.parameterStringWithNoDefault, + parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, + parameterStringNullableWithDefault: data.parameterStringNullableWithDefault + } + }); + } + +} + +export class DeprecatedService { + /** + * @deprecated + * @param data The data for the request. + * @param data.parameter This parameter is deprecated + * @throws ApiError + */ + public static deprecatedCall(data: DeprecatedCallData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/deprecated', + headers: { + parameter: data.parameter + } + }); + } + +} + +export class DescriptionsService { + /** + * @param data The data for the request. + * @param data.parameterWithBreaks Testing multiline comments in string: First line + * Second line + * + * Fourth line + * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work + * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work + * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work + * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work + * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work + * @throws ApiError + */ + public static callWithDescriptions(data: CallWithDescriptionsData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/descriptions/', + query: { + parameterWithBreaks: data.parameterWithBreaks, + parameterWithBackticks: data.parameterWithBackticks, + parameterWithSlashes: data.parameterWithSlashes, + parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders, + parameterWithQuotes: data.parameterWithQuotes, + parameterWithReservedCharacters: data.parameterWithReservedCharacters + } + }); + } + +} + +export class DuplicateService { + /** + * @throws ApiError + */ + public static duplicateName(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public static duplicateName1(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public static duplicateName2(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public static duplicateName3(): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/duplicate' + }); + } + +} + +export class ErrorService { + /** + * @param data The data for the request. + * @param data.status Status code to return + * @returns unknown Custom message: Successful response + * @throws ApiError + */ + public static testErrorCode(data: TestErrorCodeData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/error', + query: { + status: data.status + }, + errors: { + 500: 'Custom message: Internal Server Error', + 501: 'Custom message: Not Implemented', + 502: 'Custom message: Bad Gateway', + 503: 'Custom message: Service Unavailable' + } + }); + } + +} + +export class FileResponseService { + /** + * @param data The data for the request. + * @param data.id + * @returns binary Success + * @throws ApiError + */ + public static fileResponse(data: FileResponseData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/file/{id}', + path: { + id: data.id + } + }); + } + +} + +export class FormDataService { + /** + * @param data The data for the request. + * @param data.parameter This is a reusable parameter + * @param data.formData A reusable request body + * @throws ApiError + */ + public static postApiFormData(data: PostApiFormDataData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/formData/', + query: { + parameter: data.parameter + }, + formData: data.formData, + mediaType: 'multipart/form-data' + }); + } + +} + +export class HeaderService { + /** + * @returns string Successful response + * @throws ApiError + */ + public static callWithResultFromHeader(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/header', + responseHeader: 'operation-location', + errors: { + 400: '400 server error', + 500: '500 server error' + } + }); + } + +} + +export class MultipartService { + /** + * @param data The data for the request. + * @param data.formData + * @throws ApiError + */ + public static multipartRequest(data: MultipartRequestData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/multipart', + formData: data.formData, + mediaType: 'multipart/form-data' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public static multipartResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multipart' + }); + } + +} + +export class MultipleTags1Service { + /** + * @returns _400 + * @throws ApiError + */ + public static dummyA(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/a' + }); + } + + /** + * @returns void Success + * @throws ApiError + */ + public static dummyB(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class MultipleTags2Service { + /** + * @returns _400 + * @throws ApiError + */ + public static dummyA(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/a' + }); + } + + /** + * @returns void Success + * @throws ApiError + */ + public static dummyB(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class MultipleTags3Service { + /** + * @returns void Success + * @throws ApiError + */ + public static dummyB(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class NoContentService { + /** + * @returns void Success + * @throws ApiError + */ + public static callWithNoContentResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/no-content' + }); + } + + /** + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public static callWithResponseAndNoContentResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/response-and-no-content' + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + /** + * @param data The data for the request. + * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param + * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response + * @throws ApiError + */ + public static nonAsciiæøåÆøÅöôêÊ字符串(data: NonAsciiæøåÆøÅöôêÊ字符串Data): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + query: { + 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ + } + }); + } + + /** + * Login User + * @param data The data for the request. + * @param data.formData + * @throws ApiError + */ + public static putWithFormUrlEncoded(data: PutWithFormUrlEncodedData): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + formData: data.formData, + mediaType: 'application/x-www-form-urlencoded' + }); + } + +} + +export class ParametersService { + /** + * @param data The data for the request. + * @param data.fooParam foo in method + * @param data.barParam bar in method + * @param data.xFooBar Parameter with illegal characters + * @throws ApiError + */ + public static deleteFoo(data: DeleteFooData3): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + path: { + foo_param: data.fooParam, + BarParam: data.barParam + }, + headers: { + 'x-Foo-Bar': data.xFooBar + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the header + * @param data.fooAllOfEnum + * @param data.cursor This is the parameter that goes into the query params + * @param data.parameterCookie This is the parameter that goes into the cookie + * @param data.parameterPath This is the parameter that goes into the path + * @param data.requestBody This is the parameter that goes into the body + * @param data.fooRefEnum + * @throws ApiError + */ + public static callWithParameters(data: CallWithParametersData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/{parameterPath}', + path: { + parameterPath: data.parameterPath + }, + cookies: { + parameterCookie: data.parameterCookie + }, + headers: { + parameterHeader: data.parameterHeader + }, + query: { + foo_ref_enum: data.fooRefEnum, + foo_all_of_enum: data.fooAllOfEnum, + cursor: data.cursor + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the request header + * @param data.parameterQuery This is the parameter that goes into the request query params + * @param data.parameterCookie This is the parameter that goes into the cookie + * @param data.requestBody This is the parameter that goes into the body + * @param data.parameterPath1 This is the parameter that goes into the path + * @param data.parameterPath2 This is the parameter that goes into the path + * @param data.parameterPath3 This is the parameter that goes into the path + * @param data._default This is the parameter with a reserved keyword + * @throws ApiError + */ + public static callWithWeirdParameterNames(data: CallWithWeirdParameterNamesData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + path: { + 'parameter.path.1': data.parameterPath1, + 'parameter-path-2': data.parameterPath2, + 'PARAMETER-PATH-3': data.parameterPath3 + }, + cookies: { + 'PARAMETER-COOKIE': data.parameterCookie + }, + headers: { + 'parameter.header': data.parameterHeader + }, + query: { + default: data._default, + 'parameter-query': data.parameterQuery + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.requestBody This is a required parameter + * @param data.page This is an optional parameter + * @throws ApiError + */ + public static getCallWithOptionalParam(data: GetCallWithOptionalParamData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/parameters/', + query: { + page: data.page + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.parameter This is a required parameter + * @param data.requestBody This is an optional parameter + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public static postCallWithOptionalParam(data: PostCallWithOptionalParamData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/', + query: { + parameter: data.parameter + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + +} + +export class RequestBodyService { + /** + * @param data The data for the request. + * @param data.parameter This is a reusable parameter + * @param data.foo A reusable request body + * @throws ApiError + */ + public static postApiRequestBody(data: PostApiRequestBodyData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/requestBody/', + query: { + parameter: data.parameter + }, + body: data.foo, + mediaType: 'application/json' + }); + } + +} + +export class ResponseService { + /** + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public static callWithResponseAndNoContentResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/response-and-no-content' + }); + } + + /** + * @returns import + * @throws ApiError + */ + public static callWithResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/response' + }); + } + + /** + * @returns unknown Message for 200 response + * @returns ModelWithString Message for 201 response + * @returns ModelWithString Message for 202 response + * @throws ApiError + */ + public static callWithDuplicateResponses(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/response', + errors: { + 500: 'Message for 500 error', + 501: 'Message for 501 error', + 502: 'Message for 502 error', + '4XX': 'Message for 4XX errors', + default: 'Default error response' + } + }); + } + + /** + * @returns unknown Message for 200 response + * @returns ModelThatExtends Message for 201 response + * @returns ModelThatExtendsExtends Message for 202 response + * @throws ApiError + */ + public static callWithResponses(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/response', + errors: { + 500: 'Message for 500 error', + 501: 'Message for 501 error', + 502: 'Message for 502 error', + default: 'Message for default response' + } + }); + } + +} + +export class SimpleService { + /** + * @returns Model_From_Zendesk Success + * @throws ApiError + */ + public static apiVVersionODataControllerCount(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple/$count' + }); + } + + /** + * @throws ApiError + */ + public static getCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static putCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static postCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static deleteCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static optionsCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'OPTIONS', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static headCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'HEAD', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static patchCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v{api-version}/simple' + }); + } + +} + +export class TypesService { + /** + * @param data The data for the request. + * @param data.parameterArray This is an array parameter + * @param data.parameterDictionary This is a dictionary parameter + * @param data.parameterEnum This is an enum parameter + * @param data.parameterTuple This is tuple parameter + * @param data.parameterNumber This is a number parameter + * @param data.parameterString This is a string parameter + * @param data.parameterBoolean This is a boolean parameter + * @param data.parameterObject This is an object parameter + * @param data.id This is a number parameter + * @returns number Response is a simple number + * @returns string Response is a simple string + * @returns boolean Response is a simple boolean + * @returns unknown Response is a simple object + * @throws ApiError + */ + public static types(data: TypesData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/types', + path: { + id: data.id + }, + query: { + parameterNumber: data.parameterNumber, + parameterString: data.parameterString, + parameterBoolean: data.parameterBoolean, + parameterObject: data.parameterObject, + parameterArray: data.parameterArray, + parameterDictionary: data.parameterDictionary, + parameterEnum: data.parameterEnum, + parameterTuple: data.parameterTuple + } + }); + } + +} + +export class UploadService { + /** + * @param data The data for the request. + * @param data.formData + * @returns boolean + * @throws ApiError + */ + public static uploadFile(data: UploadFileData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/upload', + formData: data.formData, + mediaType: 'application/x-www-form-urlencoded' + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3/types.gen.ts new file mode 100644 index 000000000..d20c92660 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3/types.gen.ts @@ -0,0 +1,1537 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _3e_num_1Период = 'Bird' | 'Dog'; + +export const _3e_num_1Период = { + BIRD: 'Bird', + DOG: 'Dog' +} as const; + +/** + * Model with number-only name + */ +export type _400 = string; + +export type _default = { + name?: string; +}; + +/** + * Model with restricted keyword name + */ +export type _import = string; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: (number) | undefined; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AnyOfAnyAndNull = { + data?: (unknown | null); +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<({ + foo?: string; +} | { + bar?: string; +})>; +}; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<({ + foo?: string; +} | { + bar?: string; +})>; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array<(boolean)>; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array<(number)>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: camelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array<(string)>; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type camelCaseCommentWithBreaks = number; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + firstName: string; + lastname: string; + age: number; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: (({ + boolean?: boolean; +} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: (Array<(_3e_num_1Период | ConstValue)> | null); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(number | string)>; +}); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: ParameterSimpleParameter; +} | { + bar: NonAsciiStringæøåÆØÅöôêÊ字符串; +}) & { + baz: (number) | null; + qux: number; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(boolean)>; +}); +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: (boolean | { + [key: string]: (number); +}); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; + +export type ConstValue = "ConstValue"; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: (string); + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: (string | number | boolean) | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: (string); +}; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple enum with numbers + */ +export const EnumWithExtensions = { + /** + * Used when the status of something is successful + */ + CUSTOM_SUCCESS: 200, + /** + * Used when the status of something has a warning + */ + CUSTOM_WARNING: 400, + /** + * Used when the status of something has an error + */ + CUSTOM_ERROR: 500 +} as const; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * This is a simple enum with numbers + */ +export const EnumWithNumbers = { + '_1': 1, + '_2': 2, + '_3': 3, + '_1.1': 1.1, + '_1.2': 1.2, + '_1.3': 1.3, + '_100': 100, + '_200': 200, + '_300': 300, + '_-100': -100, + '_-200': -200, + '_-300': -300, + '_-1.1': -1.1, + '_-1.2': -1.2, + '_-1.3': -1.3 +} as const; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +export const EnumWithReplacedCharacters = { + _SINGLE_QUOTE_: "'Single Quote'", + _DOUBLE_QUOTES_: '"Double Quotes"', + 'ØÆÅÔÖ_ØÆÅÔÖ字符串': 'øæåôöØÆÅÔÖ字符串', + '_3.1': 3.1, + EMPTY_STRING: '' +} as const; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with strings + */ +export const EnumWithStrings = { + SUCCESS: 'Success', + WARNING: 'Warning', + ERROR: 'Error', + _SINGLE_QUOTE_: "'Single Quote'", + _DOUBLE_QUOTES_: '"Double Quotes"', + 'NON_ASCII__ØÆÅÔÖ_ØÆÅÔÖ字符串': 'Non-ascii: øæåôöØÆÅÔÖ字符串' +} as const; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +export const EnumWithXEnumNames = { + zero: 0, + one: 1, + two: 2 +} as const; + +export type File = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { + item?: boolean; + error?: (string) | null; + readonly hasError?: boolean; + data?: { + [key: string]: unknown; + }; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_String_ = { + item?: (string) | null; + error?: (string) | null; + readonly hasError?: boolean; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type Model_From_Zendesk = string; + +/** + * Circle + */ +export type ModelCircle = { + kind: 'circle'; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: 'square'; + sideLength?: number; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string; +}; + +export type ModelWithAnyOfConstantSizeArray = [ + (number | string), + (number | string), + (number | string) +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + (number & string), + (number & string) +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + ((number) | null | string), + ((number) | null | string), + ((number) | null | string) +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + (number | _import), + (number | _import) +]; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnly = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +export type ModelWithConst = { + String?: "String"; + number?: 0; + null?: null; + withType?: "Some string"; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: (string); + }; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: boolean; +}; + +/** + * This is a simple enum with strings + */ +export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + +/** + * This is a simple enum with strings + */ +export const foo_bar_enum = { + SUCCESS: 'Success', + WARNING: 'Warning', + ERROR: 'Error', + 'ØÆÅ字符串': 'ØÆÅ字符串' +} as const; + +/** + * These are the HTTP error code enums + */ +export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + +/** + * These are the HTTP error code enums + */ +export const statusCode = { + _100: '100', + _200_FOO: '200 FOO', + _300_FOO_BAR: '300 FOO_BAR', + _400_FOO_BAR: '400 foo-bar', + _500_FOO_BAR: '500 foo.bar', + _600_FOO_BAR: '600 foo&bar' +} as const; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +export type foo_bar_baz_qux = '3.0'; + +export const foo_bar_baz_qux = { + _3_0: '3.0' +} as const; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array<(string)>; + data?: (ModelWithNestedArrayEnumsData); +}; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export const ModelWithNestedArrayEnumsDataBar = { + BAZ: 'baz', + QUX: 'qux' +} as const; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export const ModelWithNestedArrayEnumsDataFoo = { + FOO: 'foo', + BAR: 'bar' +} as const; + +export type ModelWithNestedCompositionEnums = { + foo?: (ModelWithNestedArrayEnumsDataFoo); +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: ('Success' | 'Warning' | 'Error'); + }; + dictionaryWithEnumFromDescription?: { + [key: string]: (number); + }; + arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; + arrayWithDescription?: Array<(number)>; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedProperties = { + readonly first: { + readonly second: { + readonly third: (string) | null; + } | null; + } | null; +}; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: (string) | null; + /** + * This is a simple string property + */ + nullableProp2?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: (string) | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Период + */ +export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; + +/** + * Период + */ +export const value = { + '_-10': -10, + '_-1': -1, + '_0': 0, + '_1': 1, + '_3': 3, + '_6': 6, + '_12': 12 +} as const; + +export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { + baz: (number) | null; + qux: number; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + (string), + (string) + ]; + foo: 'Corge'; +}; + +export type foo = 'Bar'; + +export const foo = { + BAR: 'Bar' +} as const; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPattern = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + (number | string), + string +]; + +/** + * This is a model with one nested property + */ +export type ModelWithProperties = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: (string) | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +export type ModelWithReadOnlyAndWriteOnly = { + foo: string; + readonly bar: string; + baz: string; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReference = { + prop?: ModelWithProperties; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: (Array<(string | boolean)> | null); +}; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array<(string)>; +}; + +/** + * This is a reusable parameter + */ +export type ParameterSimpleParameter = string; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Parameter with illegal characters + */ +export type Parameterx_Foo_Bar = ModelWithString; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<({ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; +})>; +}; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple file + */ +export type SimpleFile = (Blob | File); + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = (string) | null; + +export type CollectionFormatData = { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCsv: Array<(string)> | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array<(string)> | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array<(string)> | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySsv: Array<(string)> | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTsv: Array<(string)> | null; +}; + +export type ComplexTypesData = { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; +}; + +export type ComplexTypesResponse = (Array); + +export type ComplexParamsData = { + id: number; + requestBody?: { + readonly key: (string) | null; + name: (string) | null; + enabled?: boolean; + readonly type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array<(string)> | null; + parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); + readonly user?: { + readonly id?: number; + readonly name?: (string) | null; + }; + }; +}; + +export type ComplexParamsResponse = (ModelWithString); + +export type PatchApiNoTagResponse = (unknown); + +export type ImportData = { + requestBody: (ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly); +}; + +export type ImportResponse = (Model_From_Zendesk | ModelWithReadOnlyAndWriteOnly); + +export type FooWowResponse = (unknown); + +export type GetApiSimpleOperationData = { + /** + * foo in method + */ + fooParam: string; +}; + +export type GetApiSimpleOperationResponse = (number); + +export type CallWithDefaultParametersData = { + /** + * This is a simple boolean with default value + */ + parameterBoolean?: (boolean) | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: (ModelWithString) | null; + /** + * This is a simple number with default value + */ + parameterNumber?: (number) | null; + /** + * This is a simple string with default value + */ + parameterString?: (string) | null; +}; + +export type CallWithDefaultOptionalParametersData = { + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; +}; + +export type CallToTestOrderOfParamsData = { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: (string) | null; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: (string) | null; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; +}; + +export type DeprecatedCallData = { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: (DeprecatedModel) | null; +}; + +export type CallWithDescriptionsData = { + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: unknown; + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: unknown; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: unknown; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: unknown; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: unknown; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: unknown; +}; + +export type TestErrorCodeData = { + /** + * Status code to return + */ + status: number; +}; + +export type TestErrorCodeResponse = (unknown); + +export type FileResponseData = { + id: string; +}; + +export type FileResponseResponse = ((Blob | File)); + +export type PostApiFormDataData = { + /** + * A reusable request body + */ + formData?: ModelWithString; + /** + * This is a reusable parameter + */ + parameter?: string; +}; + +export type CallWithResultFromHeaderResponse = (string); + +export type MultipartRequestData = { + formData?: { + content?: (Blob | File); + data?: ((ModelWithString) | null); + }; +}; + +export type MultipartResponseResponse = ({ + file?: (Blob | File); + metadata?: { + foo?: string; + bar?: string; + }; +}); + +export type DummyAResponse = (_400); + +export type DummyBResponse = (void); + +export type CallWithNoContentResponseResponse = (void); + +export type CallWithResponseAndNoContentResponseResponse = (number | void); + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + /** + * Dummy input param + */ + nonAsciiParamæøåÆøÅöôêÊ: number; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = (Array); + +export type PutWithFormUrlEncodedData = { + formData: ArrayWithStrings; +}; + +export type DeleteFooData3 = { + /** + * bar in method + */ + barParam: string; + /** + * foo in method + */ + fooParam: string; + /** + * Parameter with illegal characters + */ + xFooBar: ModelWithString; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the query params + */ + cursor: (string) | null; + fooAllOfEnum: (ModelWithNestedArrayEnumsDataFoo); + fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the cookie + */ + parameterCookie: (string) | null; + /** + * This is the parameter that goes into the header + */ + parameterHeader: (string) | null; + /** + * This is the parameter that goes into the path + */ + parameterPath: (string) | null; + /** + * This is the parameter that goes into the body + */ + requestBody: { + [key: string]: unknown; + } | null; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter with a reserved keyword + */ + _default?: string; + /** + * This is the parameter that goes into the cookie + */ + parameterCookie: (string) | null; + /** + * This is the parameter that goes into the request header + */ + parameterHeader: (string) | null; + /** + * This is the parameter that goes into the path + */ + parameterPath1?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath2?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath3?: string; + /** + * This is the parameter that goes into the request query params + */ + parameterQuery: (string) | null; + /** + * This is the parameter that goes into the body + */ + requestBody: (ModelWithString) | null; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + page?: number; + /** + * This is a required parameter + */ + requestBody: ModelWithOneOfEnum; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is a required parameter + */ + parameter: Pageable; + /** + * This is an optional parameter + */ + requestBody?: { + offset?: (number) | null; + }; +}; + +export type PostCallWithOptionalParamResponse = (number | void); + +export type PostApiRequestBodyData = { + /** + * A reusable request body + */ + foo?: ModelWithString; + /** + * This is a reusable parameter + */ + parameter?: string; +}; + +export type CallWithResponseResponse = (_import); + +export type CallWithDuplicateResponsesResponse = ((ModelWithBoolean & ModelWithInteger) | ModelWithString); + +export type CallWithResponsesResponse = ({ + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; +} | ModelThatExtends | ModelThatExtendsExtends); + +export type ApiVVersionODataControllerCountResponse = (Model_From_Zendesk); + +export type TypesData = { + /** + * This is a number parameter + */ + id?: number; + /** + * This is an array parameter + */ + parameterArray: Array<(string)> | null; + /** + * This is a boolean parameter + */ + parameterBoolean: (boolean) | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: ('Success' | 'Warning' | 'Error') | null; + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is a string parameter + */ + parameterString: (string) | null; + /** + * This is tuple parameter + */ + parameterTuple: [ + number, + number, + number, + number + ]; +}; + +export type TypesResponse = (number | string | boolean | { + [key: string]: unknown; +}); + +export type UploadFileData = { + formData: (Blob | File); +}; + +export type UploadFileResponse = (boolean); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_angular/core/ApiError.ts new file mode 100644 index 000000000..36675d288 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular/core/ApiError.ts @@ -0,0 +1,21 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; + +export class ApiError extends Error { + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: unknown; + public readonly request: ApiRequestOptions; + + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); + + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_angular/core/ApiRequestOptions.ts new file mode 100644 index 000000000..939a0aa4c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular/core/ApiRequestOptions.ts @@ -0,0 +1,21 @@ +export type ApiRequestOptions = { + readonly body?: any; + readonly cookies?: Record; + readonly errors?: Record; + readonly formData?: Record | any[] | Blob | File; + readonly headers?: Record; + readonly mediaType?: string; + readonly method: + | 'DELETE' + | 'GET' + | 'HEAD' + | 'OPTIONS' + | 'PATCH' + | 'POST' + | 'PUT'; + readonly path?: Record; + readonly query?: Record; + readonly responseHeader?: string; + readonly responseTransformer?: (data: unknown) => Promise; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_angular/core/ApiResult.ts new file mode 100644 index 000000000..4c58e3913 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular/core/ApiResult.ts @@ -0,0 +1,7 @@ +export type ApiResult = { + readonly body: TData; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_angular/core/OpenAPI.ts new file mode 100644 index 000000000..9fafe8d52 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular/core/OpenAPI.ts @@ -0,0 +1,55 @@ +import type { HttpResponse } from '@angular/common/http'; +import type { ApiRequestOptions } from './ApiRequestOptions'; + +type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware): void { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Middleware): void { + this._fns = [...this._fns, fn]; + } +} + +export type OpenAPIConfig = { + BASE: string; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + VERSION: string; + WITH_CREDENTIALS: boolean; + interceptors: { + response: Interceptors>; + }; +}; + +export const OpenAPI: OpenAPIConfig = { + BASE: 'http://localhost:3000/base', + CREDENTIALS: 'include', + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + TOKEN: undefined, + USERNAME: undefined, + VERSION: '1.0', + WITH_CREDENTIALS: false, + interceptors: { + response: new Interceptors(), + }, +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_angular/core/request.ts new file mode 100644 index 000000000..4eab34ab6 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular/core/request.ts @@ -0,0 +1,337 @@ +import { HttpClient, HttpHeaders } from '@angular/common/http'; +import type { HttpResponse, HttpErrorResponse } from '@angular/common/http'; +import { forkJoin, of, throwError } from 'rxjs'; +import { catchError, map, switchMap } from 'rxjs/operators'; +import type { Observable } from 'rxjs'; + +import { ApiError } from './ApiError'; +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; +import type { OpenAPIConfig } from './OpenAPI'; + +export const isString = (value: unknown): value is string => { + return typeof value === 'string'; +}; + +export const isStringWithValue = (value: unknown): value is string => { + return isString(value) && value !== ''; +}; + +export const isBlob = (value: any): value is Blob => { + return value instanceof Blob; +}; + +export const isFormData = (value: unknown): value is FormData => { + return value instanceof FormData; +}; + +export const base64 = (str: string): string => { + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } +}; + +export const getQueryString = (params: Record): string => { + const qs: string[] = []; + + const append = (key: string, value: unknown) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; + + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; + } + + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { + value.forEach(v => encodePair(key, v)); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); + } + }; + + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); + + return qs.length ? `?${qs.join('&')}` : ''; +}; + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI; + + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); + + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; +}; + +export const getFormData = (options: ApiRequestOptions): FormData | undefined => { + if (options.formData) { + const formData = new FormData(); + + const process = (key: string, value: unknown) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; + + Object.entries(options.formData) + .filter(([, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); + + return formData; + } + return undefined; +}; + +type Resolver = (options: ApiRequestOptions) => Promise; + +export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; +}; + +export const getHeaders = (config: OpenAPIConfig, options: ApiRequestOptions): Observable => { + return forkJoin({ + // @ts-ignore + token: resolve(options, config.TOKEN), + // @ts-ignore + username: resolve(options, config.USERNAME), + // @ts-ignore + password: resolve(options, config.PASSWORD), + // @ts-ignore + additionalHeaders: resolve(options, config.HEADERS), + }).pipe( + map(({ token, username, password, additionalHeaders }) => { + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + }) + .filter(([, value]) => value !== undefined && value !== null) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); + + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } + + return new HttpHeaders(headers); + }), + ); +}; + +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body) { + if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { + return JSON.stringify(options.body); + } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { + return options.body; + } else { + return JSON.stringify(options.body); + } + } + return undefined; +}; + +export const sendRequest = ( + config: OpenAPIConfig, + options: ApiRequestOptions, + http: HttpClient, + url: string, + body: unknown, + formData: FormData | undefined, + headers: HttpHeaders +): Observable> => { + return http.request(options.method, url, { + headers, + body: body ?? formData, + withCredentials: config.WITH_CREDENTIALS, + observe: 'response', + }); +}; + +export const getResponseHeader = (response: HttpResponse, responseHeader?: string): string | undefined => { + if (responseHeader) { + const value = response.headers.get(responseHeader); + if (isString(value)) { + return value; + } + } + return undefined; +}; + +export const getResponseBody = (response: HttpResponse): T | undefined => { + if (response.status !== 204 && response.body !== null) { + return response.body; + } + return undefined; +}; + +export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Payload Too Large', + 414: 'URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Range Not Satisfiable', + 417: 'Expectation Failed', + 418: 'Im a teapot', + 421: 'Misdirected Request', + 422: 'Unprocessable Content', + 423: 'Locked', + 424: 'Failed Dependency', + 425: 'Too Early', + 426: 'Upgrade Required', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', + 451: 'Unavailable For Legal Reasons', + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 508: 'Loop Detected', + 510: 'Not Extended', + 511: 'Network Authentication Required', + ...options.errors, + } + + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } + + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } +}; + +/** + * Request method + * @param config The OpenAPI configuration object + * @param http The Angular HTTP client + * @param options The request options from the service + * @returns Observable + * @throws ApiError + */ +export const request = (config: OpenAPIConfig, http: HttpClient, options: ApiRequestOptions): Observable => { + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); + + return getHeaders(config, options).pipe( + switchMap(headers => { + return sendRequest(config, options, http, url, body, formData, headers); + }), + switchMap(async response => { + for (const fn of config.interceptors.response._fns) { + response = await fn(response); + } + const responseBody = getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + + let transformedBody = responseBody; + if (options.responseTransformer && response.ok) { + transformedBody = await options.responseTransformer(responseBody) + } + + return { + url, + ok: response.ok, + status: response.status, + statusText: response.statusText, + body: responseHeader ?? transformedBody, + } as ApiResult; + }), + catchError((error: HttpErrorResponse) => { + if (!error.status) { + return throwError(() => error); + } + return of({ + url, + ok: error.ok, + status: error.status, + statusText: error.statusText, + body: error.error ?? error.statusText, + } as ApiResult); + }), + map(result => { + catchErrorCodes(options, result); + return result.body as T; + }), + catchError((error: ApiError) => { + return throwError(() => error); + }), + ); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular/index.ts b/packages/openapi-ts-tests/test/generated/v3_angular/index.ts new file mode 100644 index 000000000..3f555f4f1 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular/index.ts @@ -0,0 +1,5 @@ +// This file is auto-generated by @hey-api/openapi-ts +export { ApiError } from './core/ApiError'; +export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_angular/sdk.gen.ts new file mode 100644 index 000000000..033cabb6e --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular/sdk.gen.ts @@ -0,0 +1,1030 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import type { Observable } from 'rxjs'; +import { OpenAPI } from './core/OpenAPI'; +import { request as __request } from './core/request'; +import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; + +@Injectable({ + providedIn: 'root' +}) +export class CollectionFormatService { + constructor(public readonly http: HttpClient) { } + + /** + * @param data The data for the request. + * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) + * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) + * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) + * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) + * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) + * @throws ApiError + */ + public collectionFormat(data: CollectionFormatData): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/collectionFormat', + query: { + parameterArrayCSV: data.parameterArrayCsv, + parameterArraySSV: data.parameterArraySsv, + parameterArrayTSV: data.parameterArrayTsv, + parameterArrayPipes: data.parameterArrayPipes, + parameterArrayMulti: data.parameterArrayMulti + } + }); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class ComplexService { + constructor(public readonly http: HttpClient) { } + + /** + * @param data The data for the request. + * @param data.parameterObject Parameter containing object + * @param data.parameterReference Parameter containing reference + * @returns ModelWithString Successful response + * @throws ApiError + */ + public complexTypes(data: ComplexTypesData): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/complex', + query: { + parameterObject: data.parameterObject, + parameterReference: data.parameterReference + }, + errors: { + 400: '400 `server` error', + 500: '500 server error' + } + }); + } + + /** + * @param data The data for the request. + * @param data.id + * @param data.requestBody + * @returns ModelWithString Success + * @throws ApiError + */ + public complexParams(data: ComplexParamsData): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/v{api-version}/complex/{id}', + path: { + id: data.id + }, + body: data.requestBody, + mediaType: 'application/json-patch+json' + }); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class DefaultService { + constructor(public readonly http: HttpClient) { } + + /** + * @throws ApiError + */ + public export(): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public patchApiNoTag(): Observable { + return __request(OpenAPI, this.http, { + method: 'PATCH', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @param data The data for the request. + * @param data.requestBody + * @returns Model_From_Zendesk Success + * @returns ModelWithReadOnlyAndWriteOnly Default success response + * @throws ApiError + */ + public import(data: ImportData): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/no+tag', + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public fooWow(): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @param data The data for the request. + * @param data.fooParam foo in method + * @returns number Response is a simple number + * @throws ApiError + */ + public getApiSimpleOperation(data: GetApiSimpleOperationData): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/simple:operation', + path: { + foo_param: data.fooParam + }, + errors: { + default: 'Default error response' + } + }); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class DefaultsService { + constructor(public readonly http: HttpClient) { } + + /** + * @param data The data for the request. + * @param data.parameterString This is a simple string with default value + * @param data.parameterNumber This is a simple number with default value + * @param data.parameterBoolean This is a simple boolean with default value + * @param data.parameterEnum This is a simple enum with default value + * @param data.parameterModel This is a simple model with default value + * @throws ApiError + */ + public callWithDefaultParameters(data: CallWithDefaultParametersData = {}): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterString This is a simple string that is optional with default value + * @param data.parameterNumber This is a simple number that is optional with default value + * @param data.parameterBoolean This is a simple boolean that is optional with default value + * @param data.parameterEnum This is a simple enum that is optional with default value + * @param data.parameterModel This is a simple model that is optional with default value + * @throws ApiError + */ + public callWithDefaultOptionalParameters(data: CallWithDefaultOptionalParametersData = {}): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterStringWithNoDefault This is a string with no default + * @param data.parameterOptionalStringWithDefault This is a optional string with default + * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default + * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default + * @param data.parameterStringWithDefault This is a string with default + * @param data.parameterStringWithEmptyDefault This is a string with empty default + * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default + * @param data.parameterStringNullableWithDefault This is a string that can be null with default + * @throws ApiError + */ + public callToTestOrderOfParams(data: CallToTestOrderOfParamsData): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/v{api-version}/defaults', + query: { + parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, + parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, + parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, + parameterStringWithDefault: data.parameterStringWithDefault, + parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, + parameterStringWithNoDefault: data.parameterStringWithNoDefault, + parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, + parameterStringNullableWithDefault: data.parameterStringNullableWithDefault + } + }); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class DeprecatedService { + constructor(public readonly http: HttpClient) { } + + /** + * @deprecated + * @param data The data for the request. + * @param data.parameter This parameter is deprecated + * @throws ApiError + */ + public deprecatedCall(data: DeprecatedCallData): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/parameters/deprecated', + headers: { + parameter: data.parameter + } + }); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class DescriptionsService { + constructor(public readonly http: HttpClient) { } + + /** + * @param data The data for the request. + * @param data.parameterWithBreaks Testing multiline comments in string: First line + * Second line + * + * Fourth line + * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work + * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work + * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work + * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work + * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work + * @throws ApiError + */ + public callWithDescriptions(data: CallWithDescriptionsData = {}): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/descriptions/', + query: { + parameterWithBreaks: data.parameterWithBreaks, + parameterWithBackticks: data.parameterWithBackticks, + parameterWithSlashes: data.parameterWithSlashes, + parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders, + parameterWithQuotes: data.parameterWithQuotes, + parameterWithReservedCharacters: data.parameterWithReservedCharacters + } + }); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class DuplicateService { + constructor(public readonly http: HttpClient) { } + + /** + * @throws ApiError + */ + public duplicateName(): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public duplicateName1(): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public duplicateName2(): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public duplicateName3(): Observable { + return __request(OpenAPI, this.http, { + method: 'DELETE', + url: '/api/v{api-version}/duplicate' + }); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class ErrorService { + constructor(public readonly http: HttpClient) { } + + /** + * @param data The data for the request. + * @param data.status Status code to return + * @returns unknown Custom message: Successful response + * @throws ApiError + */ + public testErrorCode(data: TestErrorCodeData): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/error', + query: { + status: data.status + }, + errors: { + 500: 'Custom message: Internal Server Error', + 501: 'Custom message: Not Implemented', + 502: 'Custom message: Bad Gateway', + 503: 'Custom message: Service Unavailable' + } + }); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class FileResponseService { + constructor(public readonly http: HttpClient) { } + + /** + * @param data The data for the request. + * @param data.id + * @returns binary Success + * @throws ApiError + */ + public fileResponse(data: FileResponseData): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/file/{id}', + path: { + id: data.id + } + }); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class FormDataService { + constructor(public readonly http: HttpClient) { } + + /** + * @param data The data for the request. + * @param data.parameter This is a reusable parameter + * @param data.formData A reusable request body + * @throws ApiError + */ + public postApiFormData(data: PostApiFormDataData = {}): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/formData/', + query: { + parameter: data.parameter + }, + formData: data.formData, + mediaType: 'multipart/form-data' + }); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class HeaderService { + constructor(public readonly http: HttpClient) { } + + /** + * @returns string Successful response + * @throws ApiError + */ + public callWithResultFromHeader(): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/header', + responseHeader: 'operation-location', + errors: { + 400: '400 server error', + 500: '500 server error' + } + }); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class MultipartService { + constructor(public readonly http: HttpClient) { } + + /** + * @param data The data for the request. + * @param data.formData + * @throws ApiError + */ + public multipartRequest(data: MultipartRequestData = {}): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/multipart', + formData: data.formData, + mediaType: 'multipart/form-data' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public multipartResponse(): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/multipart' + }); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class MultipleTags1Service { + constructor(public readonly http: HttpClient) { } + + /** + * @returns _400 + * @throws ApiError + */ + public dummyA(): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/a' + }); + } + + /** + * @returns void Success + * @throws ApiError + */ + public dummyB(): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class MultipleTags2Service { + constructor(public readonly http: HttpClient) { } + + /** + * @returns _400 + * @throws ApiError + */ + public dummyA(): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/a' + }); + } + + /** + * @returns void Success + * @throws ApiError + */ + public dummyB(): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class MultipleTags3Service { + constructor(public readonly http: HttpClient) { } + + /** + * @returns void Success + * @throws ApiError + */ + public dummyB(): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class NoContentService { + constructor(public readonly http: HttpClient) { } + + /** + * @returns void Success + * @throws ApiError + */ + public callWithNoContentResponse(): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/no-content' + }); + } + + /** + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public callWithResponseAndNoContentResponse(): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/response-and-no-content' + }); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class NonAsciiÆøåÆøÅöôêÊService { + constructor(public readonly http: HttpClient) { } + + /** + * @param data The data for the request. + * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param + * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response + * @throws ApiError + */ + public nonAsciiæøåÆøÅöôêÊ字符串(data: NonAsciiæøåÆøÅöôêÊ字符串Data): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + query: { + 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ + } + }); + } + + /** + * Login User + * @param data The data for the request. + * @param data.formData + * @throws ApiError + */ + public putWithFormUrlEncoded(data: PutWithFormUrlEncodedData): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + formData: data.formData, + mediaType: 'application/x-www-form-urlencoded' + }); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class ParametersService { + constructor(public readonly http: HttpClient) { } + + /** + * @param data The data for the request. + * @param data.fooParam foo in method + * @param data.barParam bar in method + * @param data.xFooBar Parameter with illegal characters + * @throws ApiError + */ + public deleteFoo(data: DeleteFooData3): Observable { + return __request(OpenAPI, this.http, { + method: 'DELETE', + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + path: { + foo_param: data.fooParam, + BarParam: data.barParam + }, + headers: { + 'x-Foo-Bar': data.xFooBar + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the header + * @param data.fooAllOfEnum + * @param data.cursor This is the parameter that goes into the query params + * @param data.parameterCookie This is the parameter that goes into the cookie + * @param data.parameterPath This is the parameter that goes into the path + * @param data.requestBody This is the parameter that goes into the body + * @param data.fooRefEnum + * @throws ApiError + */ + public callWithParameters(data: CallWithParametersData): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/parameters/{parameterPath}', + path: { + parameterPath: data.parameterPath + }, + cookies: { + parameterCookie: data.parameterCookie + }, + headers: { + parameterHeader: data.parameterHeader + }, + query: { + foo_ref_enum: data.fooRefEnum, + foo_all_of_enum: data.fooAllOfEnum, + cursor: data.cursor + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the request header + * @param data.parameterQuery This is the parameter that goes into the request query params + * @param data.parameterCookie This is the parameter that goes into the cookie + * @param data.requestBody This is the parameter that goes into the body + * @param data.parameterPath1 This is the parameter that goes into the path + * @param data.parameterPath2 This is the parameter that goes into the path + * @param data.parameterPath3 This is the parameter that goes into the path + * @param data._default This is the parameter with a reserved keyword + * @throws ApiError + */ + public callWithWeirdParameterNames(data: CallWithWeirdParameterNamesData): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + path: { + 'parameter.path.1': data.parameterPath1, + 'parameter-path-2': data.parameterPath2, + 'PARAMETER-PATH-3': data.parameterPath3 + }, + cookies: { + 'PARAMETER-COOKIE': data.parameterCookie + }, + headers: { + 'parameter.header': data.parameterHeader + }, + query: { + default: data._default, + 'parameter-query': data.parameterQuery + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.requestBody This is a required parameter + * @param data.page This is an optional parameter + * @throws ApiError + */ + public getCallWithOptionalParam(data: GetCallWithOptionalParamData): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/parameters/', + query: { + page: data.page + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.parameter This is a required parameter + * @param data.requestBody This is an optional parameter + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public postCallWithOptionalParam(data: PostCallWithOptionalParamData): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/parameters/', + query: { + parameter: data.parameter + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class RequestBodyService { + constructor(public readonly http: HttpClient) { } + + /** + * @param data The data for the request. + * @param data.parameter This is a reusable parameter + * @param data.foo A reusable request body + * @throws ApiError + */ + public postApiRequestBody(data: PostApiRequestBodyData = {}): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/requestBody/', + query: { + parameter: data.parameter + }, + body: data.foo, + mediaType: 'application/json' + }); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class ResponseService { + constructor(public readonly http: HttpClient) { } + + /** + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public callWithResponseAndNoContentResponse(): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/response-and-no-content' + }); + } + + /** + * @returns import + * @throws ApiError + */ + public callWithResponse(): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/response' + }); + } + + /** + * @returns unknown Message for 200 response + * @returns ModelWithString Message for 201 response + * @returns ModelWithString Message for 202 response + * @throws ApiError + */ + public callWithDuplicateResponses(): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/response', + errors: { + 500: 'Message for 500 error', + 501: 'Message for 501 error', + 502: 'Message for 502 error', + '4XX': 'Message for 4XX errors', + default: 'Default error response' + } + }); + } + + /** + * @returns unknown Message for 200 response + * @returns ModelThatExtends Message for 201 response + * @returns ModelThatExtendsExtends Message for 202 response + * @throws ApiError + */ + public callWithResponses(): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/v{api-version}/response', + errors: { + 500: 'Message for 500 error', + 501: 'Message for 501 error', + 502: 'Message for 502 error', + default: 'Message for default response' + } + }); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class SimpleService { + constructor(public readonly http: HttpClient) { } + + /** + * @returns Model_From_Zendesk Success + * @throws ApiError + */ + public apiVVersionODataControllerCount(): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/simple/$count' + }); + } + + /** + * @throws ApiError + */ + public getCallWithoutParametersAndResponse(): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public putCallWithoutParametersAndResponse(): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public postCallWithoutParametersAndResponse(): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public deleteCallWithoutParametersAndResponse(): Observable { + return __request(OpenAPI, this.http, { + method: 'DELETE', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public optionsCallWithoutParametersAndResponse(): Observable { + return __request(OpenAPI, this.http, { + method: 'OPTIONS', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public headCallWithoutParametersAndResponse(): Observable { + return __request(OpenAPI, this.http, { + method: 'HEAD', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public patchCallWithoutParametersAndResponse(): Observable { + return __request(OpenAPI, this.http, { + method: 'PATCH', + url: '/api/v{api-version}/simple' + }); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class TypesService { + constructor(public readonly http: HttpClient) { } + + /** + * @param data The data for the request. + * @param data.parameterArray This is an array parameter + * @param data.parameterDictionary This is a dictionary parameter + * @param data.parameterEnum This is an enum parameter + * @param data.parameterTuple This is tuple parameter + * @param data.parameterNumber This is a number parameter + * @param data.parameterString This is a string parameter + * @param data.parameterBoolean This is a boolean parameter + * @param data.parameterObject This is an object parameter + * @param data.id This is a number parameter + * @returns number Response is a simple number + * @returns string Response is a simple string + * @returns boolean Response is a simple boolean + * @returns unknown Response is a simple object + * @throws ApiError + */ + public types(data: TypesData): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/types', + path: { + id: data.id + }, + query: { + parameterNumber: data.parameterNumber, + parameterString: data.parameterString, + parameterBoolean: data.parameterBoolean, + parameterObject: data.parameterObject, + parameterArray: data.parameterArray, + parameterDictionary: data.parameterDictionary, + parameterEnum: data.parameterEnum, + parameterTuple: data.parameterTuple + } + }); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class UploadService { + constructor(public readonly http: HttpClient) { } + + /** + * @param data The data for the request. + * @param data.formData + * @returns boolean + * @throws ApiError + */ + public uploadFile(data: UploadFileData): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/upload', + formData: data.formData, + mediaType: 'application/x-www-form-urlencoded' + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_angular/types.gen.ts new file mode 100644 index 000000000..344261da0 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular/types.gen.ts @@ -0,0 +1,1414 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _3e_num_1Период = 'Bird' | 'Dog'; + +/** + * Model with number-only name + */ +export type _400 = string; + +export type _default = { + name?: string; +}; + +/** + * Model with restricted keyword name + */ +export type _import = string; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: (number) | undefined; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AnyOfAnyAndNull = { + data?: (unknown | null); +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<({ + foo?: string; +} | { + bar?: string; +})>; +}; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<({ + foo?: string; +} | { + bar?: string; +})>; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array<(boolean)>; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array<(number)>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: camelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array<(string)>; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type camelCaseCommentWithBreaks = number; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + firstName: string; + lastname: string; + age: number; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: (({ + boolean?: boolean; +} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: (Array<(_3e_num_1Период | ConstValue)> | null); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(number | string)>; +}); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: ParameterSimpleParameter; +} | { + bar: NonAsciiStringæøåÆØÅöôêÊ字符串; +}) & { + baz: (number) | null; + qux: number; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(boolean)>; +}); +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: (boolean | { + [key: string]: (number); +}); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; + +export type ConstValue = "ConstValue"; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: (string); + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: (string | number | boolean) | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: (string); +}; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +export type File = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { + item?: boolean; + error?: (string) | null; + readonly hasError?: boolean; + data?: { + [key: string]: unknown; + }; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_String_ = { + item?: (string) | null; + error?: (string) | null; + readonly hasError?: boolean; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type Model_From_Zendesk = string; + +/** + * Circle + */ +export type ModelCircle = { + kind: 'circle'; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: 'square'; + sideLength?: number; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string; +}; + +export type ModelWithAnyOfConstantSizeArray = [ + (number | string), + (number | string), + (number | string) +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + (number & string), + (number & string) +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + ((number) | null | string), + ((number) | null | string), + ((number) | null | string) +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + (number | _import), + (number | _import) +]; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnly = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +export type ModelWithConst = { + String?: "String"; + number?: 0; + null?: null; + withType?: "Some string"; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: (string); + }; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: boolean; +}; + +/** + * This is a simple enum with strings + */ +export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + +/** + * These are the HTTP error code enums + */ +export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +export type foo_bar_baz_qux = '3.0'; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array<(string)>; + data?: (ModelWithNestedArrayEnumsData); +}; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedCompositionEnums = { + foo?: (ModelWithNestedArrayEnumsDataFoo); +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: ('Success' | 'Warning' | 'Error'); + }; + dictionaryWithEnumFromDescription?: { + [key: string]: (number); + }; + arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; + arrayWithDescription?: Array<(number)>; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedProperties = { + readonly first: { + readonly second: { + readonly third: (string) | null; + } | null; + } | null; +}; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: (string) | null; + /** + * This is a simple string property + */ + nullableProp2?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: (string) | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Период + */ +export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; + +export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { + baz: (number) | null; + qux: number; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + (string), + (string) + ]; + foo: 'Corge'; +}; + +export type foo = 'Bar'; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPattern = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + (number | string), + string +]; + +/** + * This is a model with one nested property + */ +export type ModelWithProperties = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: (string) | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +export type ModelWithReadOnlyAndWriteOnly = { + foo: string; + readonly bar: string; + baz: string; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReference = { + prop?: ModelWithProperties; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: (Array<(string | boolean)> | null); +}; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array<(string)>; +}; + +/** + * This is a reusable parameter + */ +export type ParameterSimpleParameter = string; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Parameter with illegal characters + */ +export type Parameterx_Foo_Bar = ModelWithString; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<({ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; +})>; +}; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple file + */ +export type SimpleFile = (Blob | File); + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = (string) | null; + +export type CollectionFormatData = { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCsv: Array<(string)> | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array<(string)> | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array<(string)> | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySsv: Array<(string)> | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTsv: Array<(string)> | null; +}; + +export type ComplexTypesData = { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; +}; + +export type ComplexTypesResponse = (Array); + +export type ComplexParamsData = { + id: number; + requestBody?: { + readonly key: (string) | null; + name: (string) | null; + enabled?: boolean; + readonly type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array<(string)> | null; + parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); + readonly user?: { + readonly id?: number; + readonly name?: (string) | null; + }; + }; +}; + +export type ComplexParamsResponse = (ModelWithString); + +export type PatchApiNoTagResponse = (unknown); + +export type ImportData = { + requestBody: (ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly); +}; + +export type ImportResponse = (Model_From_Zendesk | ModelWithReadOnlyAndWriteOnly); + +export type FooWowResponse = (unknown); + +export type GetApiSimpleOperationData = { + /** + * foo in method + */ + fooParam: string; +}; + +export type GetApiSimpleOperationResponse = (number); + +export type CallWithDefaultParametersData = { + /** + * This is a simple boolean with default value + */ + parameterBoolean?: (boolean) | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: (ModelWithString) | null; + /** + * This is a simple number with default value + */ + parameterNumber?: (number) | null; + /** + * This is a simple string with default value + */ + parameterString?: (string) | null; +}; + +export type CallWithDefaultOptionalParametersData = { + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; +}; + +export type CallToTestOrderOfParamsData = { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: (string) | null; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: (string) | null; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; +}; + +export type DeprecatedCallData = { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: (DeprecatedModel) | null; +}; + +export type CallWithDescriptionsData = { + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: unknown; + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: unknown; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: unknown; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: unknown; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: unknown; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: unknown; +}; + +export type TestErrorCodeData = { + /** + * Status code to return + */ + status: number; +}; + +export type TestErrorCodeResponse = (unknown); + +export type FileResponseData = { + id: string; +}; + +export type FileResponseResponse = ((Blob | File)); + +export type PostApiFormDataData = { + /** + * A reusable request body + */ + formData?: ModelWithString; + /** + * This is a reusable parameter + */ + parameter?: string; +}; + +export type CallWithResultFromHeaderResponse = (string); + +export type MultipartRequestData = { + formData?: { + content?: (Blob | File); + data?: ((ModelWithString) | null); + }; +}; + +export type MultipartResponseResponse = ({ + file?: (Blob | File); + metadata?: { + foo?: string; + bar?: string; + }; +}); + +export type DummyAResponse = (_400); + +export type DummyBResponse = (void); + +export type CallWithNoContentResponseResponse = (void); + +export type CallWithResponseAndNoContentResponseResponse = (number | void); + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + /** + * Dummy input param + */ + nonAsciiParamæøåÆøÅöôêÊ: number; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = (Array); + +export type PutWithFormUrlEncodedData = { + formData: ArrayWithStrings; +}; + +export type DeleteFooData3 = { + /** + * bar in method + */ + barParam: string; + /** + * foo in method + */ + fooParam: string; + /** + * Parameter with illegal characters + */ + xFooBar: ModelWithString; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the query params + */ + cursor: (string) | null; + fooAllOfEnum: (ModelWithNestedArrayEnumsDataFoo); + fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the cookie + */ + parameterCookie: (string) | null; + /** + * This is the parameter that goes into the header + */ + parameterHeader: (string) | null; + /** + * This is the parameter that goes into the path + */ + parameterPath: (string) | null; + /** + * This is the parameter that goes into the body + */ + requestBody: { + [key: string]: unknown; + } | null; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter with a reserved keyword + */ + _default?: string; + /** + * This is the parameter that goes into the cookie + */ + parameterCookie: (string) | null; + /** + * This is the parameter that goes into the request header + */ + parameterHeader: (string) | null; + /** + * This is the parameter that goes into the path + */ + parameterPath1?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath2?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath3?: string; + /** + * This is the parameter that goes into the request query params + */ + parameterQuery: (string) | null; + /** + * This is the parameter that goes into the body + */ + requestBody: (ModelWithString) | null; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + page?: number; + /** + * This is a required parameter + */ + requestBody: ModelWithOneOfEnum; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is a required parameter + */ + parameter: Pageable; + /** + * This is an optional parameter + */ + requestBody?: { + offset?: (number) | null; + }; +}; + +export type PostCallWithOptionalParamResponse = (number | void); + +export type PostApiRequestBodyData = { + /** + * A reusable request body + */ + foo?: ModelWithString; + /** + * This is a reusable parameter + */ + parameter?: string; +}; + +export type CallWithResponseResponse = (_import); + +export type CallWithDuplicateResponsesResponse = ((ModelWithBoolean & ModelWithInteger) | ModelWithString); + +export type CallWithResponsesResponse = ({ + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; +} | ModelThatExtends | ModelThatExtendsExtends); + +export type ApiVVersionODataControllerCountResponse = (Model_From_Zendesk); + +export type TypesData = { + /** + * This is a number parameter + */ + id?: number; + /** + * This is an array parameter + */ + parameterArray: Array<(string)> | null; + /** + * This is a boolean parameter + */ + parameterBoolean: (boolean) | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: ('Success' | 'Warning' | 'Error') | null; + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is a string parameter + */ + parameterString: (string) | null; + /** + * This is tuple parameter + */ + parameterTuple: [ + number, + number, + number, + number + ]; +}; + +export type TypesResponse = (number | string | boolean | { + [key: string]: unknown; +}); + +export type UploadFileData = { + formData: (Blob | File); +}; + +export type UploadFileResponse = (boolean); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiError.ts new file mode 100644 index 000000000..36675d288 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiError.ts @@ -0,0 +1,21 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; + +export class ApiError extends Error { + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: unknown; + public readonly request: ApiRequestOptions; + + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); + + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiRequestOptions.ts new file mode 100644 index 000000000..939a0aa4c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiRequestOptions.ts @@ -0,0 +1,21 @@ +export type ApiRequestOptions = { + readonly body?: any; + readonly cookies?: Record; + readonly errors?: Record; + readonly formData?: Record | any[] | Blob | File; + readonly headers?: Record; + readonly mediaType?: string; + readonly method: + | 'DELETE' + | 'GET' + | 'HEAD' + | 'OPTIONS' + | 'PATCH' + | 'POST' + | 'PUT'; + readonly path?: Record; + readonly query?: Record; + readonly responseHeader?: string; + readonly responseTransformer?: (data: unknown) => Promise; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiResult.ts new file mode 100644 index 000000000..4c58e3913 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiResult.ts @@ -0,0 +1,7 @@ +export type ApiResult = { + readonly body: TData; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/OpenAPI.ts new file mode 100644 index 000000000..9fafe8d52 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/OpenAPI.ts @@ -0,0 +1,55 @@ +import type { HttpResponse } from '@angular/common/http'; +import type { ApiRequestOptions } from './ApiRequestOptions'; + +type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware): void { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Middleware): void { + this._fns = [...this._fns, fn]; + } +} + +export type OpenAPIConfig = { + BASE: string; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + VERSION: string; + WITH_CREDENTIALS: boolean; + interceptors: { + response: Interceptors>; + }; +}; + +export const OpenAPI: OpenAPIConfig = { + BASE: 'http://localhost:3000/base', + CREDENTIALS: 'include', + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + TOKEN: undefined, + USERNAME: undefined, + VERSION: '1.0', + WITH_CREDENTIALS: false, + interceptors: { + response: new Interceptors(), + }, +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/request.ts new file mode 100644 index 000000000..4eab34ab6 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/request.ts @@ -0,0 +1,337 @@ +import { HttpClient, HttpHeaders } from '@angular/common/http'; +import type { HttpResponse, HttpErrorResponse } from '@angular/common/http'; +import { forkJoin, of, throwError } from 'rxjs'; +import { catchError, map, switchMap } from 'rxjs/operators'; +import type { Observable } from 'rxjs'; + +import { ApiError } from './ApiError'; +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; +import type { OpenAPIConfig } from './OpenAPI'; + +export const isString = (value: unknown): value is string => { + return typeof value === 'string'; +}; + +export const isStringWithValue = (value: unknown): value is string => { + return isString(value) && value !== ''; +}; + +export const isBlob = (value: any): value is Blob => { + return value instanceof Blob; +}; + +export const isFormData = (value: unknown): value is FormData => { + return value instanceof FormData; +}; + +export const base64 = (str: string): string => { + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } +}; + +export const getQueryString = (params: Record): string => { + const qs: string[] = []; + + const append = (key: string, value: unknown) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; + + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; + } + + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { + value.forEach(v => encodePair(key, v)); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); + } + }; + + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); + + return qs.length ? `?${qs.join('&')}` : ''; +}; + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI; + + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); + + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; +}; + +export const getFormData = (options: ApiRequestOptions): FormData | undefined => { + if (options.formData) { + const formData = new FormData(); + + const process = (key: string, value: unknown) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; + + Object.entries(options.formData) + .filter(([, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); + + return formData; + } + return undefined; +}; + +type Resolver = (options: ApiRequestOptions) => Promise; + +export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; +}; + +export const getHeaders = (config: OpenAPIConfig, options: ApiRequestOptions): Observable => { + return forkJoin({ + // @ts-ignore + token: resolve(options, config.TOKEN), + // @ts-ignore + username: resolve(options, config.USERNAME), + // @ts-ignore + password: resolve(options, config.PASSWORD), + // @ts-ignore + additionalHeaders: resolve(options, config.HEADERS), + }).pipe( + map(({ token, username, password, additionalHeaders }) => { + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + }) + .filter(([, value]) => value !== undefined && value !== null) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); + + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } + + return new HttpHeaders(headers); + }), + ); +}; + +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body) { + if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { + return JSON.stringify(options.body); + } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { + return options.body; + } else { + return JSON.stringify(options.body); + } + } + return undefined; +}; + +export const sendRequest = ( + config: OpenAPIConfig, + options: ApiRequestOptions, + http: HttpClient, + url: string, + body: unknown, + formData: FormData | undefined, + headers: HttpHeaders +): Observable> => { + return http.request(options.method, url, { + headers, + body: body ?? formData, + withCredentials: config.WITH_CREDENTIALS, + observe: 'response', + }); +}; + +export const getResponseHeader = (response: HttpResponse, responseHeader?: string): string | undefined => { + if (responseHeader) { + const value = response.headers.get(responseHeader); + if (isString(value)) { + return value; + } + } + return undefined; +}; + +export const getResponseBody = (response: HttpResponse): T | undefined => { + if (response.status !== 204 && response.body !== null) { + return response.body; + } + return undefined; +}; + +export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Payload Too Large', + 414: 'URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Range Not Satisfiable', + 417: 'Expectation Failed', + 418: 'Im a teapot', + 421: 'Misdirected Request', + 422: 'Unprocessable Content', + 423: 'Locked', + 424: 'Failed Dependency', + 425: 'Too Early', + 426: 'Upgrade Required', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', + 451: 'Unavailable For Legal Reasons', + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 508: 'Loop Detected', + 510: 'Not Extended', + 511: 'Network Authentication Required', + ...options.errors, + } + + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } + + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } +}; + +/** + * Request method + * @param config The OpenAPI configuration object + * @param http The Angular HTTP client + * @param options The request options from the service + * @returns Observable + * @throws ApiError + */ +export const request = (config: OpenAPIConfig, http: HttpClient, options: ApiRequestOptions): Observable => { + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); + + return getHeaders(config, options).pipe( + switchMap(headers => { + return sendRequest(config, options, http, url, body, formData, headers); + }), + switchMap(async response => { + for (const fn of config.interceptors.response._fns) { + response = await fn(response); + } + const responseBody = getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + + let transformedBody = responseBody; + if (options.responseTransformer && response.ok) { + transformedBody = await options.responseTransformer(responseBody) + } + + return { + url, + ok: response.ok, + status: response.status, + statusText: response.statusText, + body: responseHeader ?? transformedBody, + } as ApiResult; + }), + catchError((error: HttpErrorResponse) => { + if (!error.status) { + return throwError(() => error); + } + return of({ + url, + ok: error.ok, + status: error.status, + statusText: error.statusText, + body: error.error ?? error.statusText, + } as ApiResult); + }), + map(result => { + catchErrorCodes(options, result); + return result.body as T; + }), + catchError((error: ApiError) => { + return throwError(() => error); + }), + ); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_transform/index.ts b/packages/openapi-ts-tests/test/generated/v3_angular_transform/index.ts new file mode 100644 index 000000000..3f555f4f1 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_transform/index.ts @@ -0,0 +1,5 @@ +// This file is auto-generated by @hey-api/openapi-ts +export { ApiError } from './core/ApiError'; +export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_transform/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_angular_transform/sdk.gen.ts new file mode 100644 index 000000000..272083d22 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_transform/sdk.gen.ts @@ -0,0 +1,87 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import type { Observable } from 'rxjs'; +import { OpenAPI } from './core/OpenAPI'; +import { request as __request } from './core/request'; +import { type ParentModelWithDatesResponse, type ModelWithDatesResponse, type ModelWithDatesArrayResponse, type ArrayOfDatesResponse, type DateResponse, type MultipleResponsesResponse, ParentModelWithDatesResponseTransformer, ModelWithDatesResponseTransformer, ModelWithDatesArrayResponseTransformer } from './types.gen'; + +@Injectable({ + providedIn: 'root' +}) +export class DefaultService { + constructor(public readonly http: HttpClient) { } + + /** + * @returns ParentModelWithDates Success + * @returns unknown Success + * @throws ApiError + */ + public parentModelWithDates(): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/model-with-dates', + responseTransformer: ParentModelWithDatesResponseTransformer + }); + } + + /** + * @returns ModelWithDates Success + * @throws ApiError + */ + public modelWithDates(): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/model-with-dates', + responseTransformer: ModelWithDatesResponseTransformer + }); + } + + /** + * @returns ModelWithDates Success + * @throws ApiError + */ + public modelWithDatesArray(): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/model-with-dates-array', + responseTransformer: ModelWithDatesArrayResponseTransformer + }); + } + + /** + * @returns string Success + * @throws ApiError + */ + public arrayOfDates(): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/array-of-dates' + }); + } + + /** + * @returns string Success + * @throws ApiError + */ + public date(): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/date' + }); + } + + /** + * @returns ModelWithDates Updated + * @returns SimpleModel Created + * @throws ApiError + */ + public multipleResponses(): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/multiple-responses' + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_transform/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_angular_transform/types.gen.ts new file mode 100644 index 000000000..8c9227850 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_transform/types.gen.ts @@ -0,0 +1,106 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * This is a model that contains a some dates + */ +export type ModelWithDates = { + id: number; + name: string; + readonly enabled: boolean; + readonly modified: Date; + readonly expires?: Date; +}; + +/** + * This is a model that contains a some dates and arrays + */ +export type ParentModelWithDates = { + id: number; + readonly modified?: Date; + items?: Array; + item?: ModelWithDates; + 'nullable-date'?: Array<(Date | null)>; + simpleItems?: Array; + simpleItem?: SimpleModel; + dates?: Array<(Date)>; + strings?: Array<(string)>; +}; + +/** + * This is a model that contains a some dates + */ +export type SimpleModel = { + id: number; + name: string; + readonly enabled: boolean; +}; + +export type ParentModelWithDatesResponse = (ParentModelWithDates | unknown); + +export type ModelWithDatesResponse = (ModelWithDates); + +export type ModelWithDatesArrayResponse = (Array); + +export type ArrayOfDatesResponse = (Array<(Date)>); + +export type DateResponse = (Date); + +export type MultipleResponsesResponse = (Array | Array); + +export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; + +export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; + +export type ModelWithDatesModelResponseTransformer = (data: any) => ModelWithDates; + +export const ModelWithDatesModelResponseTransformer: ModelWithDatesModelResponseTransformer = data => { + if (data?.modified) { + data.modified = new Date(data.modified); + } + if (data?.expires) { + data.expires = new Date(data.expires); + } + return data; +}; + +export const ParentModelWithDatesModelResponseTransformer: ParentModelWithDatesModelResponseTransformer = data => { + if (data?.modified) { + data.modified = new Date(data.modified); + } + if (Array.isArray(data?.items)) { + data.items.forEach(ModelWithDatesModelResponseTransformer); + } + if (data?.item) { + ModelWithDatesModelResponseTransformer(data.item); + } + if (Array.isArray(data?.['nullable-date'])) { + data['nullable-date'] = data['nullable-date'].map(item => item ? new Date(item) : item); + } + if (Array.isArray(data?.dates)) { + data.dates = data.dates.map(item => item ? new Date(item) : item); + } + return data; +}; + +export const ParentModelWithDatesResponseTransformer: ParentModelWithDatesResponseTransformer = async (data) => { + if (data) { + ParentModelWithDatesModelResponseTransformer(data); + } + return data; +}; + +export type ModelWithDatesResponseTransformer = (data: any) => Promise; + +export const ModelWithDatesResponseTransformer: ModelWithDatesResponseTransformer = async (data) => { + ModelWithDatesModelResponseTransformer(data); + return data; +}; + +export type ModelWithDatesArrayResponseTransformer = (data: any) => Promise; + +export const ModelWithDatesArrayResponseTransformer: ModelWithDatesArrayResponseTransformer = async (data) => { + if (Array.isArray(data)) { + data.forEach(ModelWithDatesModelResponseTransformer); + } + return data; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiError.ts new file mode 100644 index 000000000..36675d288 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiError.ts @@ -0,0 +1,21 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; + +export class ApiError extends Error { + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: unknown; + public readonly request: ApiRequestOptions; + + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); + + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiRequestOptions.ts new file mode 100644 index 000000000..939a0aa4c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiRequestOptions.ts @@ -0,0 +1,21 @@ +export type ApiRequestOptions = { + readonly body?: any; + readonly cookies?: Record; + readonly errors?: Record; + readonly formData?: Record | any[] | Blob | File; + readonly headers?: Record; + readonly mediaType?: string; + readonly method: + | 'DELETE' + | 'GET' + | 'HEAD' + | 'OPTIONS' + | 'PATCH' + | 'POST' + | 'PUT'; + readonly path?: Record; + readonly query?: Record; + readonly responseHeader?: string; + readonly responseTransformer?: (data: unknown) => Promise; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiResult.ts new file mode 100644 index 000000000..4c58e3913 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiResult.ts @@ -0,0 +1,7 @@ +export type ApiResult = { + readonly body: TData; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/OpenAPI.ts new file mode 100644 index 000000000..9fafe8d52 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/OpenAPI.ts @@ -0,0 +1,55 @@ +import type { HttpResponse } from '@angular/common/http'; +import type { ApiRequestOptions } from './ApiRequestOptions'; + +type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware): void { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Middleware): void { + this._fns = [...this._fns, fn]; + } +} + +export type OpenAPIConfig = { + BASE: string; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + VERSION: string; + WITH_CREDENTIALS: boolean; + interceptors: { + response: Interceptors>; + }; +}; + +export const OpenAPI: OpenAPIConfig = { + BASE: 'http://localhost:3000/base', + CREDENTIALS: 'include', + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + TOKEN: undefined, + USERNAME: undefined, + VERSION: '1.0', + WITH_CREDENTIALS: false, + interceptors: { + response: new Interceptors(), + }, +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/request.ts new file mode 100644 index 000000000..4eab34ab6 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/request.ts @@ -0,0 +1,337 @@ +import { HttpClient, HttpHeaders } from '@angular/common/http'; +import type { HttpResponse, HttpErrorResponse } from '@angular/common/http'; +import { forkJoin, of, throwError } from 'rxjs'; +import { catchError, map, switchMap } from 'rxjs/operators'; +import type { Observable } from 'rxjs'; + +import { ApiError } from './ApiError'; +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; +import type { OpenAPIConfig } from './OpenAPI'; + +export const isString = (value: unknown): value is string => { + return typeof value === 'string'; +}; + +export const isStringWithValue = (value: unknown): value is string => { + return isString(value) && value !== ''; +}; + +export const isBlob = (value: any): value is Blob => { + return value instanceof Blob; +}; + +export const isFormData = (value: unknown): value is FormData => { + return value instanceof FormData; +}; + +export const base64 = (str: string): string => { + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } +}; + +export const getQueryString = (params: Record): string => { + const qs: string[] = []; + + const append = (key: string, value: unknown) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; + + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; + } + + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { + value.forEach(v => encodePair(key, v)); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); + } + }; + + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); + + return qs.length ? `?${qs.join('&')}` : ''; +}; + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI; + + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); + + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; +}; + +export const getFormData = (options: ApiRequestOptions): FormData | undefined => { + if (options.formData) { + const formData = new FormData(); + + const process = (key: string, value: unknown) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; + + Object.entries(options.formData) + .filter(([, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); + + return formData; + } + return undefined; +}; + +type Resolver = (options: ApiRequestOptions) => Promise; + +export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; +}; + +export const getHeaders = (config: OpenAPIConfig, options: ApiRequestOptions): Observable => { + return forkJoin({ + // @ts-ignore + token: resolve(options, config.TOKEN), + // @ts-ignore + username: resolve(options, config.USERNAME), + // @ts-ignore + password: resolve(options, config.PASSWORD), + // @ts-ignore + additionalHeaders: resolve(options, config.HEADERS), + }).pipe( + map(({ token, username, password, additionalHeaders }) => { + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + }) + .filter(([, value]) => value !== undefined && value !== null) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); + + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } + + return new HttpHeaders(headers); + }), + ); +}; + +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body) { + if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { + return JSON.stringify(options.body); + } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { + return options.body; + } else { + return JSON.stringify(options.body); + } + } + return undefined; +}; + +export const sendRequest = ( + config: OpenAPIConfig, + options: ApiRequestOptions, + http: HttpClient, + url: string, + body: unknown, + formData: FormData | undefined, + headers: HttpHeaders +): Observable> => { + return http.request(options.method, url, { + headers, + body: body ?? formData, + withCredentials: config.WITH_CREDENTIALS, + observe: 'response', + }); +}; + +export const getResponseHeader = (response: HttpResponse, responseHeader?: string): string | undefined => { + if (responseHeader) { + const value = response.headers.get(responseHeader); + if (isString(value)) { + return value; + } + } + return undefined; +}; + +export const getResponseBody = (response: HttpResponse): T | undefined => { + if (response.status !== 204 && response.body !== null) { + return response.body; + } + return undefined; +}; + +export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Payload Too Large', + 414: 'URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Range Not Satisfiable', + 417: 'Expectation Failed', + 418: 'Im a teapot', + 421: 'Misdirected Request', + 422: 'Unprocessable Content', + 423: 'Locked', + 424: 'Failed Dependency', + 425: 'Too Early', + 426: 'Upgrade Required', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', + 451: 'Unavailable For Legal Reasons', + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 508: 'Loop Detected', + 510: 'Not Extended', + 511: 'Network Authentication Required', + ...options.errors, + } + + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } + + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } +}; + +/** + * Request method + * @param config The OpenAPI configuration object + * @param http The Angular HTTP client + * @param options The request options from the service + * @returns Observable + * @throws ApiError + */ +export const request = (config: OpenAPIConfig, http: HttpClient, options: ApiRequestOptions): Observable => { + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); + + return getHeaders(config, options).pipe( + switchMap(headers => { + return sendRequest(config, options, http, url, body, formData, headers); + }), + switchMap(async response => { + for (const fn of config.interceptors.response._fns) { + response = await fn(response); + } + const responseBody = getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + + let transformedBody = responseBody; + if (options.responseTransformer && response.ok) { + transformedBody = await options.responseTransformer(responseBody) + } + + return { + url, + ok: response.ok, + status: response.status, + statusText: response.statusText, + body: responseHeader ?? transformedBody, + } as ApiResult; + }), + catchError((error: HttpErrorResponse) => { + if (!error.status) { + return throwError(() => error); + } + return of({ + url, + ok: error.ok, + status: error.status, + statusText: error.statusText, + body: error.error ?? error.statusText, + } as ApiResult); + }), + map(result => { + catchErrorCodes(options, result); + return result.body as T; + }), + catchError((error: ApiError) => { + return throwError(() => error); + }), + ); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/index.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/index.ts new file mode 100644 index 000000000..3f555f4f1 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/index.ts @@ -0,0 +1,5 @@ +// This file is auto-generated by @hey-api/openapi-ts +export { ApiError } from './core/ApiError'; +export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/sdk.gen.ts new file mode 100644 index 000000000..dc89c810c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/sdk.gen.ts @@ -0,0 +1,801 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import type { Observable } from 'rxjs'; +import { OpenAPI } from './core/OpenAPI'; +import { request as __request } from './core/request'; +import type { PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, ApiVVersionODataControllerCountResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, PostApiFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, DummyAResponse, DummyBResponse, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartRequestData, MultipartResponseResponse, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderResponse, TestErrorCodeData, TestErrorCodeResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; + +/** + * @throws ApiError + */ +export const export_ = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/no+tag' + }); +}; + +/** + * @returns unknown OK + * @throws ApiError + */ +export const patchApiNoTag = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'PATCH', + url: '/api/v{api-version}/no+tag' + }); +}; + +/** + * @param data The data for the request. + * @param data.requestBody + * @returns Model_From_Zendesk Success + * @returns ModelWithReadOnlyAndWriteOnly Default success response + * @throws ApiError + */ +export const import_ = function (data: ImportData): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/no+tag', + body: data.requestBody, + mediaType: 'application/json' + }); +}; + +/** + * @returns unknown OK + * @throws ApiError + */ +export const fooWow = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/v{api-version}/no+tag' + }); +}; + +/** + * @returns Model_From_Zendesk Success + * @throws ApiError + */ +export const apiVVersionODataControllerCount = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/simple/$count' + }); +}; + +/** + * @param data The data for the request. + * @param data.fooParam foo in method + * @returns number Response is a simple number + * @throws ApiError + */ +export const getApiSimpleOperation = function (data: GetApiSimpleOperationData): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/simple:operation', + path: { + foo_param: data.fooParam + }, + errors: { + default: 'Default error response' + } + }); +}; + +/** + * @throws ApiError + */ +export const getCallWithoutParametersAndResponse = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/simple' + }); +}; + +/** + * @throws ApiError + */ +export const putCallWithoutParametersAndResponse = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/v{api-version}/simple' + }); +}; + +/** + * @throws ApiError + */ +export const postCallWithoutParametersAndResponse = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/simple' + }); +}; + +/** + * @throws ApiError + */ +export const deleteCallWithoutParametersAndResponse = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'DELETE', + url: '/api/v{api-version}/simple' + }); +}; + +/** + * @throws ApiError + */ +export const optionsCallWithoutParametersAndResponse = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'OPTIONS', + url: '/api/v{api-version}/simple' + }); +}; + +/** + * @throws ApiError + */ +export const headCallWithoutParametersAndResponse = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'HEAD', + url: '/api/v{api-version}/simple' + }); +}; + +/** + * @throws ApiError + */ +export const patchCallWithoutParametersAndResponse = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'PATCH', + url: '/api/v{api-version}/simple' + }); +}; + +/** + * @param data The data for the request. + * @param data.fooParam foo in method + * @param data.barParam bar in method + * @param data.xFooBar Parameter with illegal characters + * @throws ApiError + */ +export const deleteFoo = function (data: DeleteFooData3): Observable { + return __request(OpenAPI, this.http, { + method: 'DELETE', + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + path: { + foo_param: data.fooParam, + BarParam: data.barParam + }, + headers: { + 'x-Foo-Bar': data.xFooBar + } + }); +}; + +/** + * @param data The data for the request. + * @param data.parameterWithBreaks Testing multiline comments in string: First line + * Second line + * + * Fourth line + * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work + * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work + * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work + * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work + * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work + * @throws ApiError + */ +export const callWithDescriptions = function (data: CallWithDescriptionsData = {}): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/descriptions/', + query: { + parameterWithBreaks: data.parameterWithBreaks, + parameterWithBackticks: data.parameterWithBackticks, + parameterWithSlashes: data.parameterWithSlashes, + parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders, + parameterWithQuotes: data.parameterWithQuotes, + parameterWithReservedCharacters: data.parameterWithReservedCharacters + } + }); +}; + +/** + * @deprecated + * @param data The data for the request. + * @param data.parameter This parameter is deprecated + * @throws ApiError + */ +export const deprecatedCall = function (data: DeprecatedCallData): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/parameters/deprecated', + headers: { + parameter: data.parameter + } + }); +}; + +/** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the header + * @param data.fooAllOfEnum + * @param data.cursor This is the parameter that goes into the query params + * @param data.parameterCookie This is the parameter that goes into the cookie + * @param data.parameterPath This is the parameter that goes into the path + * @param data.requestBody This is the parameter that goes into the body + * @param data.fooRefEnum + * @throws ApiError + */ +export const callWithParameters = function (data: CallWithParametersData): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/parameters/{parameterPath}', + path: { + parameterPath: data.parameterPath + }, + cookies: { + parameterCookie: data.parameterCookie + }, + headers: { + parameterHeader: data.parameterHeader + }, + query: { + foo_ref_enum: data.fooRefEnum, + foo_all_of_enum: data.fooAllOfEnum, + cursor: data.cursor + }, + body: data.requestBody, + mediaType: 'application/json' + }); +}; + +/** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the request header + * @param data.parameterQuery This is the parameter that goes into the request query params + * @param data.parameterCookie This is the parameter that goes into the cookie + * @param data.requestBody This is the parameter that goes into the body + * @param data.parameterPath1 This is the parameter that goes into the path + * @param data.parameterPath2 This is the parameter that goes into the path + * @param data.parameterPath3 This is the parameter that goes into the path + * @param data._default This is the parameter with a reserved keyword + * @throws ApiError + */ +export const callWithWeirdParameterNames = function (data: CallWithWeirdParameterNamesData): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + path: { + 'parameter.path.1': data.parameterPath1, + 'parameter-path-2': data.parameterPath2, + 'PARAMETER-PATH-3': data.parameterPath3 + }, + cookies: { + 'PARAMETER-COOKIE': data.parameterCookie + }, + headers: { + 'parameter.header': data.parameterHeader + }, + query: { + default: data._default, + 'parameter-query': data.parameterQuery + }, + body: data.requestBody, + mediaType: 'application/json' + }); +}; + +/** + * @param data The data for the request. + * @param data.requestBody This is a required parameter + * @param data.page This is an optional parameter + * @throws ApiError + */ +export const getCallWithOptionalParam = function (data: GetCallWithOptionalParamData): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/parameters/', + query: { + page: data.page + }, + body: data.requestBody, + mediaType: 'application/json' + }); +}; + +/** + * @param data The data for the request. + * @param data.parameter This is a required parameter + * @param data.requestBody This is an optional parameter + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ +export const postCallWithOptionalParam = function (data: PostCallWithOptionalParamData): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/parameters/', + query: { + parameter: data.parameter + }, + body: data.requestBody, + mediaType: 'application/json' + }); +}; + +/** + * @param data The data for the request. + * @param data.parameter This is a reusable parameter + * @param data.foo A reusable request body + * @throws ApiError + */ +export const postApiRequestBody = function (data: PostApiRequestBodyData = {}): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/requestBody/', + query: { + parameter: data.parameter + }, + body: data.foo, + mediaType: 'application/json' + }); +}; + +/** + * @param data The data for the request. + * @param data.parameter This is a reusable parameter + * @param data.formData A reusable request body + * @throws ApiError + */ +export const postApiFormData = function (data: PostApiFormDataData = {}): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/formData/', + query: { + parameter: data.parameter + }, + formData: data.formData, + mediaType: 'multipart/form-data' + }); +}; + +/** + * @param data The data for the request. + * @param data.parameterString This is a simple string with default value + * @param data.parameterNumber This is a simple number with default value + * @param data.parameterBoolean This is a simple boolean with default value + * @param data.parameterEnum This is a simple enum with default value + * @param data.parameterModel This is a simple model with default value + * @throws ApiError + */ +export const callWithDefaultParameters = function (data: CallWithDefaultParametersData = {}): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); +}; + +/** + * @param data The data for the request. + * @param data.parameterString This is a simple string that is optional with default value + * @param data.parameterNumber This is a simple number that is optional with default value + * @param data.parameterBoolean This is a simple boolean that is optional with default value + * @param data.parameterEnum This is a simple enum that is optional with default value + * @param data.parameterModel This is a simple model that is optional with default value + * @throws ApiError + */ +export const callWithDefaultOptionalParameters = function (data: CallWithDefaultOptionalParametersData = {}): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); +}; + +/** + * @param data The data for the request. + * @param data.parameterStringWithNoDefault This is a string with no default + * @param data.parameterOptionalStringWithDefault This is a optional string with default + * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default + * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default + * @param data.parameterStringWithDefault This is a string with default + * @param data.parameterStringWithEmptyDefault This is a string with empty default + * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default + * @param data.parameterStringNullableWithDefault This is a string that can be null with default + * @throws ApiError + */ +export const callToTestOrderOfParams = function (data: CallToTestOrderOfParamsData): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/v{api-version}/defaults', + query: { + parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, + parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, + parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, + parameterStringWithDefault: data.parameterStringWithDefault, + parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, + parameterStringWithNoDefault: data.parameterStringWithNoDefault, + parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, + parameterStringNullableWithDefault: data.parameterStringNullableWithDefault + } + }); +}; + +/** + * @throws ApiError + */ +export const duplicateName = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/duplicate' + }); +}; + +/** + * @throws ApiError + */ +export const duplicateName1 = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/duplicate' + }); +}; + +/** + * @throws ApiError + */ +export const duplicateName2 = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/v{api-version}/duplicate' + }); +}; + +/** + * @throws ApiError + */ +export const duplicateName3 = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'DELETE', + url: '/api/v{api-version}/duplicate' + }); +}; + +/** + * @returns void Success + * @throws ApiError + */ +export const callWithNoContentResponse = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/no-content' + }); +}; + +/** + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ +export const callWithResponseAndNoContentResponse = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/response-and-no-content' + }); +}; + +/** + * @returns _400 + * @throws ApiError + */ +export const dummyA = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/a' + }); +}; + +/** + * @returns void Success + * @throws ApiError + */ +export const dummyB = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); +}; + +/** + * @returns import + * @throws ApiError + */ +export const callWithResponse = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/response' + }); +}; + +/** + * @returns unknown Message for 200 response + * @returns ModelWithString Message for 201 response + * @returns ModelWithString Message for 202 response + * @throws ApiError + */ +export const callWithDuplicateResponses = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/response', + errors: { + 500: 'Message for 500 error', + 501: 'Message for 501 error', + 502: 'Message for 502 error', + '4XX': 'Message for 4XX errors', + default: 'Default error response' + } + }); +}; + +/** + * @returns unknown Message for 200 response + * @returns ModelThatExtends Message for 201 response + * @returns ModelThatExtendsExtends Message for 202 response + * @throws ApiError + */ +export const callWithResponses = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/v{api-version}/response', + errors: { + 500: 'Message for 500 error', + 501: 'Message for 501 error', + 502: 'Message for 502 error', + default: 'Message for default response' + } + }); +}; + +/** + * @param data The data for the request. + * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) + * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) + * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) + * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) + * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) + * @throws ApiError + */ +export const collectionFormat = function (data: CollectionFormatData): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/collectionFormat', + query: { + parameterArrayCSV: data.parameterArrayCsv, + parameterArraySSV: data.parameterArraySsv, + parameterArrayTSV: data.parameterArrayTsv, + parameterArrayPipes: data.parameterArrayPipes, + parameterArrayMulti: data.parameterArrayMulti + } + }); +}; + +/** + * @param data The data for the request. + * @param data.parameterArray This is an array parameter + * @param data.parameterDictionary This is a dictionary parameter + * @param data.parameterEnum This is an enum parameter + * @param data.parameterTuple This is tuple parameter + * @param data.parameterNumber This is a number parameter + * @param data.parameterString This is a string parameter + * @param data.parameterBoolean This is a boolean parameter + * @param data.parameterObject This is an object parameter + * @param data.id This is a number parameter + * @returns number Response is a simple number + * @returns string Response is a simple string + * @returns boolean Response is a simple boolean + * @returns unknown Response is a simple object + * @throws ApiError + */ +export const types = function (data: TypesData): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/types', + path: { + id: data.id + }, + query: { + parameterNumber: data.parameterNumber, + parameterString: data.parameterString, + parameterBoolean: data.parameterBoolean, + parameterObject: data.parameterObject, + parameterArray: data.parameterArray, + parameterDictionary: data.parameterDictionary, + parameterEnum: data.parameterEnum, + parameterTuple: data.parameterTuple + } + }); +}; + +/** + * @param data The data for the request. + * @param data.formData + * @returns boolean + * @throws ApiError + */ +export const uploadFile = function (data: UploadFileData): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/upload', + formData: data.formData, + mediaType: 'application/x-www-form-urlencoded' + }); +}; + +/** + * @param data The data for the request. + * @param data.id + * @returns binary Success + * @throws ApiError + */ +export const fileResponse = function (data: FileResponseData): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/file/{id}', + path: { + id: data.id + } + }); +}; + +/** + * @param data The data for the request. + * @param data.parameterObject Parameter containing object + * @param data.parameterReference Parameter containing reference + * @returns ModelWithString Successful response + * @throws ApiError + */ +export const complexTypes = function (data: ComplexTypesData): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/complex', + query: { + parameterObject: data.parameterObject, + parameterReference: data.parameterReference + }, + errors: { + 400: '400 `server` error', + 500: '500 server error' + } + }); +}; + +/** + * @param data The data for the request. + * @param data.formData + * @throws ApiError + */ +export const multipartRequest = function (data: MultipartRequestData = {}): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/multipart', + formData: data.formData, + mediaType: 'multipart/form-data' + }); +}; + +/** + * @returns unknown OK + * @throws ApiError + */ +export const multipartResponse = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/v{api-version}/multipart' + }); +}; + +/** + * @param data The data for the request. + * @param data.id + * @param data.requestBody + * @returns ModelWithString Success + * @throws ApiError + */ +export const complexParams = function (data: ComplexParamsData): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/v{api-version}/complex/{id}', + path: { + id: data.id + }, + body: data.requestBody, + mediaType: 'application/json-patch+json' + }); +}; + +/** + * @returns string Successful response + * @throws ApiError + */ +export const callWithResultFromHeader = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/header', + responseHeader: 'operation-location', + errors: { + 400: '400 server error', + 500: '500 server error' + } + }); +}; + +/** + * @param data The data for the request. + * @param data.status Status code to return + * @returns unknown Custom message: Successful response + * @throws ApiError + */ +export const testErrorCode = function (data: TestErrorCodeData): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/error', + query: { + status: data.status + }, + errors: { + 500: 'Custom message: Internal Server Error', + 501: 'Custom message: Not Implemented', + 502: 'Custom message: Bad Gateway', + 503: 'Custom message: Service Unavailable' + } + }); +}; + +/** + * @param data The data for the request. + * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param + * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response + * @throws ApiError + */ +export const nonAsciiæøåÆøÅöôêÊ字符串 = function (data: NonAsciiæøåÆøÅöôêÊ字符串Data): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + query: { + 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ + } + }); +}; + +/** + * Login User + * @param data The data for the request. + * @param data.formData + * @throws ApiError + */ +export const putWithFormUrlEncoded = function (data: PutWithFormUrlEncodedData): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + formData: data.formData, + mediaType: 'application/x-www-form-urlencoded' + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/types.gen.ts new file mode 100644 index 000000000..ea3de322c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/types.gen.ts @@ -0,0 +1,1414 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _3e_num_1Период = 'Bird' | 'Dog'; + +/** + * Model with number-only name + */ +export type _400 = string; + +export type _default = { + name?: string; +}; + +/** + * Model with restricted keyword name + */ +export type _import = string; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: (number) | undefined; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AnyOfAnyAndNull = { + data?: (unknown | null); +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<({ + foo?: string; +} | { + bar?: string; +})>; +}; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<({ + foo?: string; +} | { + bar?: string; +})>; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array<(boolean)>; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array<(number)>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: camelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array<(string)>; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type camelCaseCommentWithBreaks = number; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + firstName: string; + lastname: string; + age: number; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: (({ + boolean?: boolean; +} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: (Array<(_3e_num_1Период | ConstValue)> | null); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(number | string)>; +}); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: ParameterSimpleParameter; +} | { + bar: NonAsciiStringæøåÆØÅöôêÊ字符串; +}) & { + baz: (number) | null; + qux: number; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(boolean)>; +}); +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: (boolean | { + [key: string]: (number); +}); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; + +export type ConstValue = "ConstValue"; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: (string); + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: (string | number | boolean) | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: (string); +}; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +export type File = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { + item?: boolean; + error?: (string) | null; + readonly hasError?: boolean; + data?: { + [key: string]: unknown; + }; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_String_ = { + item?: (string) | null; + error?: (string) | null; + readonly hasError?: boolean; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type Model_From_Zendesk = string; + +/** + * Circle + */ +export type ModelCircle = { + kind: 'circle'; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: 'square'; + sideLength?: number; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string; +}; + +export type ModelWithAnyOfConstantSizeArray = [ + (number | string), + (number | string), + (number | string) +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + (number & string), + (number & string) +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + ((number) | null | string), + ((number) | null | string), + ((number) | null | string) +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + (number | _import), + (number | _import) +]; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnly = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +export type ModelWithConst = { + String?: "String"; + number?: 0; + null?: null; + withType?: "Some string"; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: (string); + }; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: boolean; +}; + +/** + * This is a simple enum with strings + */ +export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + +/** + * These are the HTTP error code enums + */ +export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +export type foo_bar_baz_qux = '3.0'; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array<(string)>; + data?: (ModelWithNestedArrayEnumsData); +}; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedCompositionEnums = { + foo?: (ModelWithNestedArrayEnumsDataFoo); +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: ('Success' | 'Warning' | 'Error'); + }; + dictionaryWithEnumFromDescription?: { + [key: string]: (number); + }; + arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; + arrayWithDescription?: Array<(number)>; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedProperties = { + readonly first: { + readonly second: { + readonly third: (string) | null; + } | null; + } | null; +}; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: (string) | null; + /** + * This is a simple string property + */ + nullableProp2?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: (string) | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Период + */ +export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; + +export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { + baz: (number) | null; + qux: number; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + (string), + (string) + ]; + foo: 'Corge'; +}; + +export type foo = 'Bar'; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPattern = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + (number | string), + string +]; + +/** + * This is a model with one nested property + */ +export type ModelWithProperties = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: (string) | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +export type ModelWithReadOnlyAndWriteOnly = { + foo: string; + readonly bar: string; + baz: string; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReference = { + prop?: ModelWithProperties; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: (Array<(string | boolean)> | null); +}; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array<(string)>; +}; + +/** + * This is a reusable parameter + */ +export type ParameterSimpleParameter = string; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Parameter with illegal characters + */ +export type Parameterx_Foo_Bar = ModelWithString; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<({ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; +})>; +}; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple file + */ +export type SimpleFile = (Blob | File); + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = (string) | null; + +export type PatchApiNoTagResponse = (unknown); + +export type ImportData = { + requestBody: (ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly); +}; + +export type ImportResponse = (Model_From_Zendesk | ModelWithReadOnlyAndWriteOnly); + +export type FooWowResponse = (unknown); + +export type ApiVVersionODataControllerCountResponse = (Model_From_Zendesk); + +export type GetApiSimpleOperationData = { + /** + * foo in method + */ + fooParam: string; +}; + +export type GetApiSimpleOperationResponse = (number); + +export type DeleteFooData3 = { + /** + * bar in method + */ + barParam: string; + /** + * foo in method + */ + fooParam: string; + /** + * Parameter with illegal characters + */ + xFooBar: ModelWithString; +}; + +export type CallWithDescriptionsData = { + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: unknown; + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: unknown; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: unknown; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: unknown; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: unknown; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: unknown; +}; + +export type DeprecatedCallData = { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: (DeprecatedModel) | null; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the query params + */ + cursor: (string) | null; + fooAllOfEnum: (ModelWithNestedArrayEnumsDataFoo); + fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the cookie + */ + parameterCookie: (string) | null; + /** + * This is the parameter that goes into the header + */ + parameterHeader: (string) | null; + /** + * This is the parameter that goes into the path + */ + parameterPath: (string) | null; + /** + * This is the parameter that goes into the body + */ + requestBody: { + [key: string]: unknown; + } | null; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter with a reserved keyword + */ + _default?: string; + /** + * This is the parameter that goes into the cookie + */ + parameterCookie: (string) | null; + /** + * This is the parameter that goes into the request header + */ + parameterHeader: (string) | null; + /** + * This is the parameter that goes into the path + */ + parameterPath1?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath2?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath3?: string; + /** + * This is the parameter that goes into the request query params + */ + parameterQuery: (string) | null; + /** + * This is the parameter that goes into the body + */ + requestBody: (ModelWithString) | null; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + page?: number; + /** + * This is a required parameter + */ + requestBody: ModelWithOneOfEnum; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is a required parameter + */ + parameter: Pageable; + /** + * This is an optional parameter + */ + requestBody?: { + offset?: (number) | null; + }; +}; + +export type PostCallWithOptionalParamResponse = (number | void); + +export type PostApiRequestBodyData = { + /** + * A reusable request body + */ + foo?: ModelWithString; + /** + * This is a reusable parameter + */ + parameter?: string; +}; + +export type PostApiFormDataData = { + /** + * A reusable request body + */ + formData?: ModelWithString; + /** + * This is a reusable parameter + */ + parameter?: string; +}; + +export type CallWithDefaultParametersData = { + /** + * This is a simple boolean with default value + */ + parameterBoolean?: (boolean) | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: (ModelWithString) | null; + /** + * This is a simple number with default value + */ + parameterNumber?: (number) | null; + /** + * This is a simple string with default value + */ + parameterString?: (string) | null; +}; + +export type CallWithDefaultOptionalParametersData = { + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; +}; + +export type CallToTestOrderOfParamsData = { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: (string) | null; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: (string) | null; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; +}; + +export type CallWithNoContentResponseResponse = (void); + +export type CallWithResponseAndNoContentResponseResponse = (number | void); + +export type DummyAResponse = (_400); + +export type DummyBResponse = (void); + +export type CallWithResponseResponse = (_import); + +export type CallWithDuplicateResponsesResponse = ((ModelWithBoolean & ModelWithInteger) | ModelWithString); + +export type CallWithResponsesResponse = ({ + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; +} | ModelThatExtends | ModelThatExtendsExtends); + +export type CollectionFormatData = { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCsv: Array<(string)> | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array<(string)> | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array<(string)> | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySsv: Array<(string)> | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTsv: Array<(string)> | null; +}; + +export type TypesData = { + /** + * This is a number parameter + */ + id?: number; + /** + * This is an array parameter + */ + parameterArray: Array<(string)> | null; + /** + * This is a boolean parameter + */ + parameterBoolean: (boolean) | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: ('Success' | 'Warning' | 'Error') | null; + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is a string parameter + */ + parameterString: (string) | null; + /** + * This is tuple parameter + */ + parameterTuple: [ + number, + number, + number, + number + ]; +}; + +export type TypesResponse = (number | string | boolean | { + [key: string]: unknown; +}); + +export type UploadFileData = { + formData: (Blob | File); +}; + +export type UploadFileResponse = (boolean); + +export type FileResponseData = { + id: string; +}; + +export type FileResponseResponse = ((Blob | File)); + +export type ComplexTypesData = { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; +}; + +export type ComplexTypesResponse = (Array); + +export type MultipartRequestData = { + formData?: { + content?: (Blob | File); + data?: ((ModelWithString) | null); + }; +}; + +export type MultipartResponseResponse = ({ + file?: (Blob | File); + metadata?: { + foo?: string; + bar?: string; + }; +}); + +export type ComplexParamsData = { + id: number; + requestBody?: { + readonly key: (string) | null; + name: (string) | null; + enabled?: boolean; + readonly type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array<(string)> | null; + parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); + readonly user?: { + readonly id?: number; + readonly name?: (string) | null; + }; + }; +}; + +export type ComplexParamsResponse = (ModelWithString); + +export type CallWithResultFromHeaderResponse = (string); + +export type TestErrorCodeData = { + /** + * Status code to return + */ + status: number; +}; + +export type TestErrorCodeResponse = (unknown); + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + /** + * Dummy input param + */ + nonAsciiParamæøåÆøÅöôêÊ: number; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = (Array); + +export type PutWithFormUrlEncodedData = { + formData: ArrayWithStrings; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiError.ts new file mode 100644 index 000000000..36675d288 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiError.ts @@ -0,0 +1,21 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; + +export class ApiError extends Error { + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: unknown; + public readonly request: ApiRequestOptions; + + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); + + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiRequestOptions.ts new file mode 100644 index 000000000..939a0aa4c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiRequestOptions.ts @@ -0,0 +1,21 @@ +export type ApiRequestOptions = { + readonly body?: any; + readonly cookies?: Record; + readonly errors?: Record; + readonly formData?: Record | any[] | Blob | File; + readonly headers?: Record; + readonly mediaType?: string; + readonly method: + | 'DELETE' + | 'GET' + | 'HEAD' + | 'OPTIONS' + | 'PATCH' + | 'POST' + | 'PUT'; + readonly path?: Record; + readonly query?: Record; + readonly responseHeader?: string; + readonly responseTransformer?: (data: unknown) => Promise; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiResult.ts new file mode 100644 index 000000000..4c58e3913 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiResult.ts @@ -0,0 +1,7 @@ +export type ApiResult = { + readonly body: TData; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/OpenAPI.ts new file mode 100644 index 000000000..9fafe8d52 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/OpenAPI.ts @@ -0,0 +1,55 @@ +import type { HttpResponse } from '@angular/common/http'; +import type { ApiRequestOptions } from './ApiRequestOptions'; + +type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware): void { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Middleware): void { + this._fns = [...this._fns, fn]; + } +} + +export type OpenAPIConfig = { + BASE: string; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + VERSION: string; + WITH_CREDENTIALS: boolean; + interceptors: { + response: Interceptors>; + }; +}; + +export const OpenAPI: OpenAPIConfig = { + BASE: 'http://localhost:3000/base', + CREDENTIALS: 'include', + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + TOKEN: undefined, + USERNAME: undefined, + VERSION: '1.0', + WITH_CREDENTIALS: false, + interceptors: { + response: new Interceptors(), + }, +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/request.ts new file mode 100644 index 000000000..4eab34ab6 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/request.ts @@ -0,0 +1,337 @@ +import { HttpClient, HttpHeaders } from '@angular/common/http'; +import type { HttpResponse, HttpErrorResponse } from '@angular/common/http'; +import { forkJoin, of, throwError } from 'rxjs'; +import { catchError, map, switchMap } from 'rxjs/operators'; +import type { Observable } from 'rxjs'; + +import { ApiError } from './ApiError'; +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; +import type { OpenAPIConfig } from './OpenAPI'; + +export const isString = (value: unknown): value is string => { + return typeof value === 'string'; +}; + +export const isStringWithValue = (value: unknown): value is string => { + return isString(value) && value !== ''; +}; + +export const isBlob = (value: any): value is Blob => { + return value instanceof Blob; +}; + +export const isFormData = (value: unknown): value is FormData => { + return value instanceof FormData; +}; + +export const base64 = (str: string): string => { + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } +}; + +export const getQueryString = (params: Record): string => { + const qs: string[] = []; + + const append = (key: string, value: unknown) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; + + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; + } + + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { + value.forEach(v => encodePair(key, v)); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); + } + }; + + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); + + return qs.length ? `?${qs.join('&')}` : ''; +}; + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI; + + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); + + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; +}; + +export const getFormData = (options: ApiRequestOptions): FormData | undefined => { + if (options.formData) { + const formData = new FormData(); + + const process = (key: string, value: unknown) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; + + Object.entries(options.formData) + .filter(([, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); + + return formData; + } + return undefined; +}; + +type Resolver = (options: ApiRequestOptions) => Promise; + +export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; +}; + +export const getHeaders = (config: OpenAPIConfig, options: ApiRequestOptions): Observable => { + return forkJoin({ + // @ts-ignore + token: resolve(options, config.TOKEN), + // @ts-ignore + username: resolve(options, config.USERNAME), + // @ts-ignore + password: resolve(options, config.PASSWORD), + // @ts-ignore + additionalHeaders: resolve(options, config.HEADERS), + }).pipe( + map(({ token, username, password, additionalHeaders }) => { + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + }) + .filter(([, value]) => value !== undefined && value !== null) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); + + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } + + return new HttpHeaders(headers); + }), + ); +}; + +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body) { + if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { + return JSON.stringify(options.body); + } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { + return options.body; + } else { + return JSON.stringify(options.body); + } + } + return undefined; +}; + +export const sendRequest = ( + config: OpenAPIConfig, + options: ApiRequestOptions, + http: HttpClient, + url: string, + body: unknown, + formData: FormData | undefined, + headers: HttpHeaders +): Observable> => { + return http.request(options.method, url, { + headers, + body: body ?? formData, + withCredentials: config.WITH_CREDENTIALS, + observe: 'response', + }); +}; + +export const getResponseHeader = (response: HttpResponse, responseHeader?: string): string | undefined => { + if (responseHeader) { + const value = response.headers.get(responseHeader); + if (isString(value)) { + return value; + } + } + return undefined; +}; + +export const getResponseBody = (response: HttpResponse): T | undefined => { + if (response.status !== 204 && response.body !== null) { + return response.body; + } + return undefined; +}; + +export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Payload Too Large', + 414: 'URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Range Not Satisfiable', + 417: 'Expectation Failed', + 418: 'Im a teapot', + 421: 'Misdirected Request', + 422: 'Unprocessable Content', + 423: 'Locked', + 424: 'Failed Dependency', + 425: 'Too Early', + 426: 'Upgrade Required', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', + 451: 'Unavailable For Legal Reasons', + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 508: 'Loop Detected', + 510: 'Not Extended', + 511: 'Network Authentication Required', + ...options.errors, + } + + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } + + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } +}; + +/** + * Request method + * @param config The OpenAPI configuration object + * @param http The Angular HTTP client + * @param options The request options from the service + * @returns Observable + * @throws ApiError + */ +export const request = (config: OpenAPIConfig, http: HttpClient, options: ApiRequestOptions): Observable => { + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); + + return getHeaders(config, options).pipe( + switchMap(headers => { + return sendRequest(config, options, http, url, body, formData, headers); + }), + switchMap(async response => { + for (const fn of config.interceptors.response._fns) { + response = await fn(response); + } + const responseBody = getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + + let transformedBody = responseBody; + if (options.responseTransformer && response.ok) { + transformedBody = await options.responseTransformer(responseBody) + } + + return { + url, + ok: response.ok, + status: response.status, + statusText: response.statusText, + body: responseHeader ?? transformedBody, + } as ApiResult; + }), + catchError((error: HttpErrorResponse) => { + if (!error.status) { + return throwError(() => error); + } + return of({ + url, + ok: error.ok, + status: error.status, + statusText: error.statusText, + body: error.error ?? error.statusText, + } as ApiResult); + }), + map(result => { + catchErrorCodes(options, result); + return result.body as T; + }), + catchError((error: ApiError) => { + return throwError(() => error); + }), + ); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/index.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/index.ts new file mode 100644 index 000000000..3f555f4f1 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/index.ts @@ -0,0 +1,5 @@ +// This file is auto-generated by @hey-api/openapi-ts +export { ApiError } from './core/ApiError'; +export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/sdk.gen.ts new file mode 100644 index 000000000..109822a09 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/sdk.gen.ts @@ -0,0 +1,79 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import type { Observable } from 'rxjs'; +import { OpenAPI } from './core/OpenAPI'; +import { request as __request } from './core/request'; +import { type ParentModelWithDatesResponse, type ModelWithDatesResponse, type ModelWithDatesArrayResponse, type ArrayOfDatesResponse, type DateResponse, type MultipleResponsesResponse, ParentModelWithDatesResponseTransformer, ModelWithDatesResponseTransformer, ModelWithDatesArrayResponseTransformer } from './types.gen'; + +/** + * @returns ParentModelWithDates Success + * @returns unknown Success + * @throws ApiError + */ +export const parentModelWithDates = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/model-with-dates', + responseTransformer: ParentModelWithDatesResponseTransformer + }); +}; + +/** + * @returns ModelWithDates Success + * @throws ApiError + */ +export const modelWithDates = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/model-with-dates', + responseTransformer: ModelWithDatesResponseTransformer + }); +}; + +/** + * @returns ModelWithDates Success + * @throws ApiError + */ +export const modelWithDatesArray = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/model-with-dates-array', + responseTransformer: ModelWithDatesArrayResponseTransformer + }); +}; + +/** + * @returns string Success + * @throws ApiError + */ +export const arrayOfDates = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/array-of-dates' + }); +}; + +/** + * @returns string Success + * @throws ApiError + */ +export const date = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/date' + }); +}; + +/** + * @returns ModelWithDates Updated + * @returns SimpleModel Created + * @throws ApiError + */ +export const multipleResponses = function (): Observable { + return __request(OpenAPI, this.http, { + method: 'PUT', + url: '/api/multiple-responses' + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/types.gen.ts new file mode 100644 index 000000000..8c9227850 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/types.gen.ts @@ -0,0 +1,106 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * This is a model that contains a some dates + */ +export type ModelWithDates = { + id: number; + name: string; + readonly enabled: boolean; + readonly modified: Date; + readonly expires?: Date; +}; + +/** + * This is a model that contains a some dates and arrays + */ +export type ParentModelWithDates = { + id: number; + readonly modified?: Date; + items?: Array; + item?: ModelWithDates; + 'nullable-date'?: Array<(Date | null)>; + simpleItems?: Array; + simpleItem?: SimpleModel; + dates?: Array<(Date)>; + strings?: Array<(string)>; +}; + +/** + * This is a model that contains a some dates + */ +export type SimpleModel = { + id: number; + name: string; + readonly enabled: boolean; +}; + +export type ParentModelWithDatesResponse = (ParentModelWithDates | unknown); + +export type ModelWithDatesResponse = (ModelWithDates); + +export type ModelWithDatesArrayResponse = (Array); + +export type ArrayOfDatesResponse = (Array<(Date)>); + +export type DateResponse = (Date); + +export type MultipleResponsesResponse = (Array | Array); + +export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; + +export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; + +export type ModelWithDatesModelResponseTransformer = (data: any) => ModelWithDates; + +export const ModelWithDatesModelResponseTransformer: ModelWithDatesModelResponseTransformer = data => { + if (data?.modified) { + data.modified = new Date(data.modified); + } + if (data?.expires) { + data.expires = new Date(data.expires); + } + return data; +}; + +export const ParentModelWithDatesModelResponseTransformer: ParentModelWithDatesModelResponseTransformer = data => { + if (data?.modified) { + data.modified = new Date(data.modified); + } + if (Array.isArray(data?.items)) { + data.items.forEach(ModelWithDatesModelResponseTransformer); + } + if (data?.item) { + ModelWithDatesModelResponseTransformer(data.item); + } + if (Array.isArray(data?.['nullable-date'])) { + data['nullable-date'] = data['nullable-date'].map(item => item ? new Date(item) : item); + } + if (Array.isArray(data?.dates)) { + data.dates = data.dates.map(item => item ? new Date(item) : item); + } + return data; +}; + +export const ParentModelWithDatesResponseTransformer: ParentModelWithDatesResponseTransformer = async (data) => { + if (data) { + ParentModelWithDatesModelResponseTransformer(data); + } + return data; +}; + +export type ModelWithDatesResponseTransformer = (data: any) => Promise; + +export const ModelWithDatesResponseTransformer: ModelWithDatesResponseTransformer = async (data) => { + ModelWithDatesModelResponseTransformer(data); + return data; +}; + +export type ModelWithDatesArrayResponseTransformer = (data: any) => Promise; + +export const ModelWithDatesArrayResponseTransformer: ModelWithDatesArrayResponseTransformer = async (data) => { + if (Array.isArray(data)) { + data.forEach(ModelWithDatesModelResponseTransformer); + } + return data; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_axios/core/ApiError.ts new file mode 100644 index 000000000..36675d288 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_axios/core/ApiError.ts @@ -0,0 +1,21 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; + +export class ApiError extends Error { + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: unknown; + public readonly request: ApiRequestOptions; + + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); + + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_axios/core/ApiRequestOptions.ts new file mode 100644 index 000000000..939a0aa4c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_axios/core/ApiRequestOptions.ts @@ -0,0 +1,21 @@ +export type ApiRequestOptions = { + readonly body?: any; + readonly cookies?: Record; + readonly errors?: Record; + readonly formData?: Record | any[] | Blob | File; + readonly headers?: Record; + readonly mediaType?: string; + readonly method: + | 'DELETE' + | 'GET' + | 'HEAD' + | 'OPTIONS' + | 'PATCH' + | 'POST' + | 'PUT'; + readonly path?: Record; + readonly query?: Record; + readonly responseHeader?: string; + readonly responseTransformer?: (data: unknown) => Promise; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_axios/core/ApiResult.ts new file mode 100644 index 000000000..4c58e3913 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_axios/core/ApiResult.ts @@ -0,0 +1,7 @@ +export type ApiResult = { + readonly body: TData; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_axios/core/CancelablePromise.ts new file mode 100644 index 000000000..ccc082e8f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_axios/core/CancelablePromise.ts @@ -0,0 +1,126 @@ +export class CancelError extends Error { + constructor(message: string) { + super(message); + this.name = 'CancelError'; + } + + public get isCancelled(): boolean { + return true; + } +} + +export interface OnCancel { + readonly isResolved: boolean; + readonly isRejected: boolean; + readonly isCancelled: boolean; + + (cancelHandler: () => void): void; +} + +export class CancelablePromise implements Promise { + private _isResolved: boolean; + private _isRejected: boolean; + private _isCancelled: boolean; + readonly cancelHandlers: (() => void)[]; + readonly promise: Promise; + private _resolve?: (value: T | PromiseLike) => void; + private _reject?: (reason?: unknown) => void; + + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason?: unknown) => void, + onCancel: OnCancel + ) => void + ) { + this._isResolved = false; + this._isRejected = false; + this._isCancelled = false; + this.cancelHandlers = []; + this.promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + + const onResolve = (value: T | PromiseLike): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isResolved = true; + if (this._resolve) this._resolve(value); + }; + + const onReject = (reason?: unknown): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isRejected = true; + if (this._reject) this._reject(reason); + }; + + const onCancel = (cancelHandler: () => void): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this.cancelHandlers.push(cancelHandler); + }; + + Object.defineProperty(onCancel, 'isResolved', { + get: (): boolean => this._isResolved, + }); + + Object.defineProperty(onCancel, 'isRejected', { + get: (): boolean => this._isRejected, + }); + + Object.defineProperty(onCancel, 'isCancelled', { + get: (): boolean => this._isCancelled, + }); + + return executor(onResolve, onReject, onCancel as OnCancel); + }); + } + + get [Symbol.toStringTag]() { + return "Cancellable Promise"; + } + + public then( + onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null + ): Promise { + return this.promise.then(onFulfilled, onRejected); + } + + public catch( + onRejected?: ((reason: unknown) => TResult | PromiseLike) | null + ): Promise { + return this.promise.catch(onRejected); + } + + public finally(onFinally?: (() => void) | null): Promise { + return this.promise.finally(onFinally); + } + + public cancel(): void { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isCancelled = true; + if (this.cancelHandlers.length) { + try { + for (const cancelHandler of this.cancelHandlers) { + cancelHandler(); + } + } catch (error) { + console.warn('Cancellation threw an error', error); + return; + } + } + this.cancelHandlers.length = 0; + if (this._reject) this._reject(new CancelError('Request aborted')); + } + + public get isCancelled(): boolean { + return this._isCancelled; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_axios/core/OpenAPI.ts new file mode 100644 index 000000000..cb7b23cb7 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_axios/core/OpenAPI.ts @@ -0,0 +1,57 @@ +import type { AxiosRequestConfig, AxiosResponse } from 'axios'; +import type { ApiRequestOptions } from './ApiRequestOptions'; + +type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware): void { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Middleware): void { + this._fns = [...this._fns, fn]; + } +} + +export type OpenAPIConfig = { + BASE: string; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + VERSION: string; + WITH_CREDENTIALS: boolean; + interceptors: { + request: Interceptors; + response: Interceptors; + }; +}; + +export const OpenAPI: OpenAPIConfig = { + BASE: 'http://localhost:3000/base', + CREDENTIALS: 'include', + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + TOKEN: undefined, + USERNAME: undefined, + VERSION: '1.0', + WITH_CREDENTIALS: false, + interceptors: { + request: new Interceptors(), + response: new Interceptors(), + }, +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_axios/core/request.ts new file mode 100644 index 000000000..ecc2e393c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_axios/core/request.ts @@ -0,0 +1,347 @@ +import axios from 'axios'; +import type { AxiosError, AxiosRequestConfig, AxiosResponse, AxiosInstance } from 'axios'; + +import { ApiError } from './ApiError'; +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; +import { CancelablePromise } from './CancelablePromise'; +import type { OnCancel } from './CancelablePromise'; +import type { OpenAPIConfig } from './OpenAPI'; + +export const isString = (value: unknown): value is string => { + return typeof value === 'string'; +}; + +export const isStringWithValue = (value: unknown): value is string => { + return isString(value) && value !== ''; +}; + +export const isBlob = (value: any): value is Blob => { + return value instanceof Blob; +}; + +export const isFormData = (value: unknown): value is FormData => { + return value instanceof FormData; +}; + +export const isSuccess = (status: number): boolean => { + return status >= 200 && status < 300; +}; + +export const base64 = (str: string): string => { + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } +}; + +export const getQueryString = (params: Record): string => { + const qs: string[] = []; + + const append = (key: string, value: unknown) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; + + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; + } + + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { + value.forEach(v => encodePair(key, v)); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); + } + }; + + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); + + return qs.length ? `?${qs.join('&')}` : ''; +}; + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI; + + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); + + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; +}; + +export const getFormData = (options: ApiRequestOptions): FormData | undefined => { + if (options.formData) { + const formData = new FormData(); + + const process = (key: string, value: unknown) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; + + Object.entries(options.formData) + .filter(([, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); + + return formData; + } + return undefined; +}; + +type Resolver = (options: ApiRequestOptions) => Promise; + +export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; +}; + +export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise> => { + const [token, username, password, additionalHeaders] = await Promise.all([ + // @ts-ignore + resolve(options, config.TOKEN), + // @ts-ignore + resolve(options, config.USERNAME), + // @ts-ignore + resolve(options, config.PASSWORD), + // @ts-ignore + resolve(options, config.HEADERS), + ]); + + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + }) + .filter(([, value]) => value !== undefined && value !== null) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); + + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } else if (options.formData !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } + } + + return headers; +}; + +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body) { + return options.body; + } + return undefined; +}; + +export const sendRequest = async ( + config: OpenAPIConfig, + options: ApiRequestOptions, + url: string, + body: unknown, + formData: FormData | undefined, + headers: Record, + onCancel: OnCancel, + axiosClient: AxiosInstance +): Promise> => { + const controller = new AbortController(); + + let requestConfig: AxiosRequestConfig = { + data: body ?? formData, + headers, + method: options.method, + signal: controller.signal, + url, + withCredentials: config.WITH_CREDENTIALS, + }; + + onCancel(() => controller.abort()); + + for (const fn of config.interceptors.request._fns) { + requestConfig = await fn(requestConfig); + } + + try { + return await axiosClient.request(requestConfig); + } catch (error) { + const axiosError = error as AxiosError; + if (axiosError.response) { + return axiosError.response; + } + throw error; + } +}; + +export const getResponseHeader = (response: AxiosResponse, responseHeader?: string): string | undefined => { + if (responseHeader) { + const content = response.headers[responseHeader]; + if (isString(content)) { + return content; + } + } + return undefined; +}; + +export const getResponseBody = (response: AxiosResponse): unknown => { + if (response.status !== 204) { + return response.data; + } + return undefined; +}; + +export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Payload Too Large', + 414: 'URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Range Not Satisfiable', + 417: 'Expectation Failed', + 418: 'Im a teapot', + 421: 'Misdirected Request', + 422: 'Unprocessable Content', + 423: 'Locked', + 424: 'Failed Dependency', + 425: 'Too Early', + 426: 'Upgrade Required', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', + 451: 'Unavailable For Legal Reasons', + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 508: 'Loop Detected', + 510: 'Not Extended', + 511: 'Network Authentication Required', + ...options.errors, + } + + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } + + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } +}; + +/** + * Request method + * @param config The OpenAPI configuration object + * @param options The request options from the service + * @param axiosClient The axios client instance to use + * @returns CancelablePromise + * @throws ApiError + */ +export const request = (config: OpenAPIConfig, options: ApiRequestOptions, axiosClient: AxiosInstance = axios): CancelablePromise => { + return new CancelablePromise(async (resolve, reject, onCancel) => { + try { + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); + const headers = await getHeaders(config, options); + + if (!onCancel.isCancelled) { + let response = await sendRequest(config, options, url, body, formData, headers, onCancel, axiosClient); + + for (const fn of config.interceptors.response._fns) { + response = await fn(response); + } + + const responseBody = getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + + let transformedBody = responseBody; + if (options.responseTransformer && isSuccess(response.status)) { + transformedBody = await options.responseTransformer(responseBody) + } + + const result: ApiResult = { + url, + ok: isSuccess(response.status), + status: response.status, + statusText: response.statusText, + body: responseHeader ?? transformedBody, + }; + + catchErrorCodes(options, result); + + resolve(result.body); + } + } catch (error) { + reject(error); + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios/index.ts b/packages/openapi-ts-tests/test/generated/v3_axios/index.ts new file mode 100644 index 000000000..50a1dd734 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_axios/index.ts @@ -0,0 +1,6 @@ +// This file is auto-generated by @hey-api/openapi-ts +export { ApiError } from './core/ApiError'; +export { CancelablePromise, CancelError } from './core/CancelablePromise'; +export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_axios/sdk.gen.ts new file mode 100644 index 000000000..f62288bcf --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_axios/sdk.gen.ts @@ -0,0 +1,913 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CancelablePromise } from './core/CancelablePromise'; +import { OpenAPI } from './core/OpenAPI'; +import { request as __request } from './core/request'; +import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; + +export class CollectionFormatService { + /** + * @param data The data for the request. + * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) + * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) + * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) + * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) + * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) + * @throws ApiError + */ + public static collectionFormat(data: CollectionFormatData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/collectionFormat', + query: { + parameterArrayCSV: data.parameterArrayCsv, + parameterArraySSV: data.parameterArraySsv, + parameterArrayTSV: data.parameterArrayTsv, + parameterArrayPipes: data.parameterArrayPipes, + parameterArrayMulti: data.parameterArrayMulti + } + }); + } + +} + +export class ComplexService { + /** + * @param data The data for the request. + * @param data.parameterObject Parameter containing object + * @param data.parameterReference Parameter containing reference + * @returns ModelWithString Successful response + * @throws ApiError + */ + public static complexTypes(data: ComplexTypesData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/complex', + query: { + parameterObject: data.parameterObject, + parameterReference: data.parameterReference + }, + errors: { + 400: '400 `server` error', + 500: '500 server error' + } + }); + } + + /** + * @param data The data for the request. + * @param data.id + * @param data.requestBody + * @returns ModelWithString Success + * @throws ApiError + */ + public static complexParams(data: ComplexParamsData): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/complex/{id}', + path: { + id: data.id + }, + body: data.requestBody, + mediaType: 'application/json-patch+json' + }); + } + +} + +export class DefaultService { + /** + * @throws ApiError + */ + public static export(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public static patchApiNoTag(): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @param data The data for the request. + * @param data.requestBody + * @returns Model_From_Zendesk Success + * @returns ModelWithReadOnlyAndWriteOnly Default success response + * @throws ApiError + */ + public static import(data: ImportData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/no+tag', + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public static fooWow(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @param data The data for the request. + * @param data.fooParam foo in method + * @returns number Response is a simple number + * @throws ApiError + */ + public static getApiSimpleOperation(data: GetApiSimpleOperationData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple:operation', + path: { + foo_param: data.fooParam + }, + errors: { + default: 'Default error response' + } + }); + } + +} + +export class DefaultsService { + /** + * @param data The data for the request. + * @param data.parameterString This is a simple string with default value + * @param data.parameterNumber This is a simple number with default value + * @param data.parameterBoolean This is a simple boolean with default value + * @param data.parameterEnum This is a simple enum with default value + * @param data.parameterModel This is a simple model with default value + * @throws ApiError + */ + public static callWithDefaultParameters(data: CallWithDefaultParametersData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterString This is a simple string that is optional with default value + * @param data.parameterNumber This is a simple number that is optional with default value + * @param data.parameterBoolean This is a simple boolean that is optional with default value + * @param data.parameterEnum This is a simple enum that is optional with default value + * @param data.parameterModel This is a simple model that is optional with default value + * @throws ApiError + */ + public static callWithDefaultOptionalParameters(data: CallWithDefaultOptionalParametersData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterStringWithNoDefault This is a string with no default + * @param data.parameterOptionalStringWithDefault This is a optional string with default + * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default + * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default + * @param data.parameterStringWithDefault This is a string with default + * @param data.parameterStringWithEmptyDefault This is a string with empty default + * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default + * @param data.parameterStringNullableWithDefault This is a string that can be null with default + * @throws ApiError + */ + public static callToTestOrderOfParams(data: CallToTestOrderOfParamsData): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/defaults', + query: { + parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, + parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, + parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, + parameterStringWithDefault: data.parameterStringWithDefault, + parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, + parameterStringWithNoDefault: data.parameterStringWithNoDefault, + parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, + parameterStringNullableWithDefault: data.parameterStringNullableWithDefault + } + }); + } + +} + +export class DeprecatedService { + /** + * @deprecated + * @param data The data for the request. + * @param data.parameter This parameter is deprecated + * @throws ApiError + */ + public static deprecatedCall(data: DeprecatedCallData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/deprecated', + headers: { + parameter: data.parameter + } + }); + } + +} + +export class DescriptionsService { + /** + * @param data The data for the request. + * @param data.parameterWithBreaks Testing multiline comments in string: First line + * Second line + * + * Fourth line + * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work + * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work + * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work + * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work + * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work + * @throws ApiError + */ + public static callWithDescriptions(data: CallWithDescriptionsData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/descriptions/', + query: { + parameterWithBreaks: data.parameterWithBreaks, + parameterWithBackticks: data.parameterWithBackticks, + parameterWithSlashes: data.parameterWithSlashes, + parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders, + parameterWithQuotes: data.parameterWithQuotes, + parameterWithReservedCharacters: data.parameterWithReservedCharacters + } + }); + } + +} + +export class DuplicateService { + /** + * @throws ApiError + */ + public static duplicateName(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public static duplicateName1(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public static duplicateName2(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public static duplicateName3(): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/duplicate' + }); + } + +} + +export class ErrorService { + /** + * @param data The data for the request. + * @param data.status Status code to return + * @returns unknown Custom message: Successful response + * @throws ApiError + */ + public static testErrorCode(data: TestErrorCodeData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/error', + query: { + status: data.status + }, + errors: { + 500: 'Custom message: Internal Server Error', + 501: 'Custom message: Not Implemented', + 502: 'Custom message: Bad Gateway', + 503: 'Custom message: Service Unavailable' + } + }); + } + +} + +export class FileResponseService { + /** + * @param data The data for the request. + * @param data.id + * @returns binary Success + * @throws ApiError + */ + public static fileResponse(data: FileResponseData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/file/{id}', + path: { + id: data.id + } + }); + } + +} + +export class FormDataService { + /** + * @param data The data for the request. + * @param data.parameter This is a reusable parameter + * @param data.formData A reusable request body + * @throws ApiError + */ + public static postApiFormData(data: PostApiFormDataData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/formData/', + query: { + parameter: data.parameter + }, + formData: data.formData, + mediaType: 'multipart/form-data' + }); + } + +} + +export class HeaderService { + /** + * @returns string Successful response + * @throws ApiError + */ + public static callWithResultFromHeader(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/header', + responseHeader: 'operation-location', + errors: { + 400: '400 server error', + 500: '500 server error' + } + }); + } + +} + +export class MultipartService { + /** + * @param data The data for the request. + * @param data.formData + * @throws ApiError + */ + public static multipartRequest(data: MultipartRequestData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/multipart', + formData: data.formData, + mediaType: 'multipart/form-data' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public static multipartResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multipart' + }); + } + +} + +export class MultipleTags1Service { + /** + * @returns _400 + * @throws ApiError + */ + public static dummyA(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/a' + }); + } + + /** + * @returns void Success + * @throws ApiError + */ + public static dummyB(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class MultipleTags2Service { + /** + * @returns _400 + * @throws ApiError + */ + public static dummyA(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/a' + }); + } + + /** + * @returns void Success + * @throws ApiError + */ + public static dummyB(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class MultipleTags3Service { + /** + * @returns void Success + * @throws ApiError + */ + public static dummyB(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class NoContentService { + /** + * @returns void Success + * @throws ApiError + */ + public static callWithNoContentResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/no-content' + }); + } + + /** + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public static callWithResponseAndNoContentResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/response-and-no-content' + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + /** + * @param data The data for the request. + * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param + * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response + * @throws ApiError + */ + public static nonAsciiæøåÆøÅöôêÊ字符串(data: NonAsciiæøåÆøÅöôêÊ字符串Data): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + query: { + 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ + } + }); + } + + /** + * Login User + * @param data The data for the request. + * @param data.formData + * @throws ApiError + */ + public static putWithFormUrlEncoded(data: PutWithFormUrlEncodedData): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + formData: data.formData, + mediaType: 'application/x-www-form-urlencoded' + }); + } + +} + +export class ParametersService { + /** + * @param data The data for the request. + * @param data.fooParam foo in method + * @param data.barParam bar in method + * @param data.xFooBar Parameter with illegal characters + * @throws ApiError + */ + public static deleteFoo(data: DeleteFooData3): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + path: { + foo_param: data.fooParam, + BarParam: data.barParam + }, + headers: { + 'x-Foo-Bar': data.xFooBar + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the header + * @param data.fooAllOfEnum + * @param data.cursor This is the parameter that goes into the query params + * @param data.parameterCookie This is the parameter that goes into the cookie + * @param data.parameterPath This is the parameter that goes into the path + * @param data.requestBody This is the parameter that goes into the body + * @param data.fooRefEnum + * @throws ApiError + */ + public static callWithParameters(data: CallWithParametersData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/{parameterPath}', + path: { + parameterPath: data.parameterPath + }, + cookies: { + parameterCookie: data.parameterCookie + }, + headers: { + parameterHeader: data.parameterHeader + }, + query: { + foo_ref_enum: data.fooRefEnum, + foo_all_of_enum: data.fooAllOfEnum, + cursor: data.cursor + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the request header + * @param data.parameterQuery This is the parameter that goes into the request query params + * @param data.parameterCookie This is the parameter that goes into the cookie + * @param data.requestBody This is the parameter that goes into the body + * @param data.parameterPath1 This is the parameter that goes into the path + * @param data.parameterPath2 This is the parameter that goes into the path + * @param data.parameterPath3 This is the parameter that goes into the path + * @param data._default This is the parameter with a reserved keyword + * @throws ApiError + */ + public static callWithWeirdParameterNames(data: CallWithWeirdParameterNamesData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + path: { + 'parameter.path.1': data.parameterPath1, + 'parameter-path-2': data.parameterPath2, + 'PARAMETER-PATH-3': data.parameterPath3 + }, + cookies: { + 'PARAMETER-COOKIE': data.parameterCookie + }, + headers: { + 'parameter.header': data.parameterHeader + }, + query: { + default: data._default, + 'parameter-query': data.parameterQuery + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.requestBody This is a required parameter + * @param data.page This is an optional parameter + * @throws ApiError + */ + public static getCallWithOptionalParam(data: GetCallWithOptionalParamData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/parameters/', + query: { + page: data.page + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.parameter This is a required parameter + * @param data.requestBody This is an optional parameter + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public static postCallWithOptionalParam(data: PostCallWithOptionalParamData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/', + query: { + parameter: data.parameter + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + +} + +export class RequestBodyService { + /** + * @param data The data for the request. + * @param data.parameter This is a reusable parameter + * @param data.foo A reusable request body + * @throws ApiError + */ + public static postApiRequestBody(data: PostApiRequestBodyData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/requestBody/', + query: { + parameter: data.parameter + }, + body: data.foo, + mediaType: 'application/json' + }); + } + +} + +export class ResponseService { + /** + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public static callWithResponseAndNoContentResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/response-and-no-content' + }); + } + + /** + * @returns import + * @throws ApiError + */ + public static callWithResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/response' + }); + } + + /** + * @returns unknown Message for 200 response + * @returns ModelWithString Message for 201 response + * @returns ModelWithString Message for 202 response + * @throws ApiError + */ + public static callWithDuplicateResponses(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/response', + errors: { + 500: 'Message for 500 error', + 501: 'Message for 501 error', + 502: 'Message for 502 error', + '4XX': 'Message for 4XX errors', + default: 'Default error response' + } + }); + } + + /** + * @returns unknown Message for 200 response + * @returns ModelThatExtends Message for 201 response + * @returns ModelThatExtendsExtends Message for 202 response + * @throws ApiError + */ + public static callWithResponses(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/response', + errors: { + 500: 'Message for 500 error', + 501: 'Message for 501 error', + 502: 'Message for 502 error', + default: 'Message for default response' + } + }); + } + +} + +export class SimpleService { + /** + * @returns Model_From_Zendesk Success + * @throws ApiError + */ + public static apiVVersionODataControllerCount(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple/$count' + }); + } + + /** + * @throws ApiError + */ + public static getCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static putCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static postCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static deleteCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static optionsCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'OPTIONS', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static headCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'HEAD', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static patchCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v{api-version}/simple' + }); + } + +} + +export class TypesService { + /** + * @param data The data for the request. + * @param data.parameterArray This is an array parameter + * @param data.parameterDictionary This is a dictionary parameter + * @param data.parameterEnum This is an enum parameter + * @param data.parameterTuple This is tuple parameter + * @param data.parameterNumber This is a number parameter + * @param data.parameterString This is a string parameter + * @param data.parameterBoolean This is a boolean parameter + * @param data.parameterObject This is an object parameter + * @param data.id This is a number parameter + * @returns number Response is a simple number + * @returns string Response is a simple string + * @returns boolean Response is a simple boolean + * @returns unknown Response is a simple object + * @throws ApiError + */ + public static types(data: TypesData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/types', + path: { + id: data.id + }, + query: { + parameterNumber: data.parameterNumber, + parameterString: data.parameterString, + parameterBoolean: data.parameterBoolean, + parameterObject: data.parameterObject, + parameterArray: data.parameterArray, + parameterDictionary: data.parameterDictionary, + parameterEnum: data.parameterEnum, + parameterTuple: data.parameterTuple + } + }); + } + +} + +export class UploadService { + /** + * @param data The data for the request. + * @param data.formData + * @returns boolean + * @throws ApiError + */ + public static uploadFile(data: UploadFileData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/upload', + formData: data.formData, + mediaType: 'application/x-www-form-urlencoded' + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_axios/types.gen.ts new file mode 100644 index 000000000..d20c92660 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_axios/types.gen.ts @@ -0,0 +1,1537 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _3e_num_1Период = 'Bird' | 'Dog'; + +export const _3e_num_1Период = { + BIRD: 'Bird', + DOG: 'Dog' +} as const; + +/** + * Model with number-only name + */ +export type _400 = string; + +export type _default = { + name?: string; +}; + +/** + * Model with restricted keyword name + */ +export type _import = string; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: (number) | undefined; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AnyOfAnyAndNull = { + data?: (unknown | null); +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<({ + foo?: string; +} | { + bar?: string; +})>; +}; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<({ + foo?: string; +} | { + bar?: string; +})>; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array<(boolean)>; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array<(number)>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: camelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array<(string)>; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type camelCaseCommentWithBreaks = number; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + firstName: string; + lastname: string; + age: number; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: (({ + boolean?: boolean; +} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: (Array<(_3e_num_1Период | ConstValue)> | null); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(number | string)>; +}); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: ParameterSimpleParameter; +} | { + bar: NonAsciiStringæøåÆØÅöôêÊ字符串; +}) & { + baz: (number) | null; + qux: number; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(boolean)>; +}); +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: (boolean | { + [key: string]: (number); +}); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; + +export type ConstValue = "ConstValue"; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: (string); + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: (string | number | boolean) | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: (string); +}; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple enum with numbers + */ +export const EnumWithExtensions = { + /** + * Used when the status of something is successful + */ + CUSTOM_SUCCESS: 200, + /** + * Used when the status of something has a warning + */ + CUSTOM_WARNING: 400, + /** + * Used when the status of something has an error + */ + CUSTOM_ERROR: 500 +} as const; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * This is a simple enum with numbers + */ +export const EnumWithNumbers = { + '_1': 1, + '_2': 2, + '_3': 3, + '_1.1': 1.1, + '_1.2': 1.2, + '_1.3': 1.3, + '_100': 100, + '_200': 200, + '_300': 300, + '_-100': -100, + '_-200': -200, + '_-300': -300, + '_-1.1': -1.1, + '_-1.2': -1.2, + '_-1.3': -1.3 +} as const; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +export const EnumWithReplacedCharacters = { + _SINGLE_QUOTE_: "'Single Quote'", + _DOUBLE_QUOTES_: '"Double Quotes"', + 'ØÆÅÔÖ_ØÆÅÔÖ字符串': 'øæåôöØÆÅÔÖ字符串', + '_3.1': 3.1, + EMPTY_STRING: '' +} as const; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with strings + */ +export const EnumWithStrings = { + SUCCESS: 'Success', + WARNING: 'Warning', + ERROR: 'Error', + _SINGLE_QUOTE_: "'Single Quote'", + _DOUBLE_QUOTES_: '"Double Quotes"', + 'NON_ASCII__ØÆÅÔÖ_ØÆÅÔÖ字符串': 'Non-ascii: øæåôöØÆÅÔÖ字符串' +} as const; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +export const EnumWithXEnumNames = { + zero: 0, + one: 1, + two: 2 +} as const; + +export type File = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { + item?: boolean; + error?: (string) | null; + readonly hasError?: boolean; + data?: { + [key: string]: unknown; + }; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_String_ = { + item?: (string) | null; + error?: (string) | null; + readonly hasError?: boolean; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type Model_From_Zendesk = string; + +/** + * Circle + */ +export type ModelCircle = { + kind: 'circle'; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: 'square'; + sideLength?: number; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string; +}; + +export type ModelWithAnyOfConstantSizeArray = [ + (number | string), + (number | string), + (number | string) +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + (number & string), + (number & string) +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + ((number) | null | string), + ((number) | null | string), + ((number) | null | string) +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + (number | _import), + (number | _import) +]; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnly = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +export type ModelWithConst = { + String?: "String"; + number?: 0; + null?: null; + withType?: "Some string"; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: (string); + }; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: boolean; +}; + +/** + * This is a simple enum with strings + */ +export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + +/** + * This is a simple enum with strings + */ +export const foo_bar_enum = { + SUCCESS: 'Success', + WARNING: 'Warning', + ERROR: 'Error', + 'ØÆÅ字符串': 'ØÆÅ字符串' +} as const; + +/** + * These are the HTTP error code enums + */ +export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + +/** + * These are the HTTP error code enums + */ +export const statusCode = { + _100: '100', + _200_FOO: '200 FOO', + _300_FOO_BAR: '300 FOO_BAR', + _400_FOO_BAR: '400 foo-bar', + _500_FOO_BAR: '500 foo.bar', + _600_FOO_BAR: '600 foo&bar' +} as const; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +export type foo_bar_baz_qux = '3.0'; + +export const foo_bar_baz_qux = { + _3_0: '3.0' +} as const; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array<(string)>; + data?: (ModelWithNestedArrayEnumsData); +}; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export const ModelWithNestedArrayEnumsDataBar = { + BAZ: 'baz', + QUX: 'qux' +} as const; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export const ModelWithNestedArrayEnumsDataFoo = { + FOO: 'foo', + BAR: 'bar' +} as const; + +export type ModelWithNestedCompositionEnums = { + foo?: (ModelWithNestedArrayEnumsDataFoo); +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: ('Success' | 'Warning' | 'Error'); + }; + dictionaryWithEnumFromDescription?: { + [key: string]: (number); + }; + arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; + arrayWithDescription?: Array<(number)>; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedProperties = { + readonly first: { + readonly second: { + readonly third: (string) | null; + } | null; + } | null; +}; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: (string) | null; + /** + * This is a simple string property + */ + nullableProp2?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: (string) | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Период + */ +export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; + +/** + * Период + */ +export const value = { + '_-10': -10, + '_-1': -1, + '_0': 0, + '_1': 1, + '_3': 3, + '_6': 6, + '_12': 12 +} as const; + +export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { + baz: (number) | null; + qux: number; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + (string), + (string) + ]; + foo: 'Corge'; +}; + +export type foo = 'Bar'; + +export const foo = { + BAR: 'Bar' +} as const; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPattern = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + (number | string), + string +]; + +/** + * This is a model with one nested property + */ +export type ModelWithProperties = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: (string) | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +export type ModelWithReadOnlyAndWriteOnly = { + foo: string; + readonly bar: string; + baz: string; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReference = { + prop?: ModelWithProperties; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: (Array<(string | boolean)> | null); +}; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array<(string)>; +}; + +/** + * This is a reusable parameter + */ +export type ParameterSimpleParameter = string; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Parameter with illegal characters + */ +export type Parameterx_Foo_Bar = ModelWithString; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<({ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; +})>; +}; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple file + */ +export type SimpleFile = (Blob | File); + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = (string) | null; + +export type CollectionFormatData = { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCsv: Array<(string)> | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array<(string)> | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array<(string)> | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySsv: Array<(string)> | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTsv: Array<(string)> | null; +}; + +export type ComplexTypesData = { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; +}; + +export type ComplexTypesResponse = (Array); + +export type ComplexParamsData = { + id: number; + requestBody?: { + readonly key: (string) | null; + name: (string) | null; + enabled?: boolean; + readonly type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array<(string)> | null; + parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); + readonly user?: { + readonly id?: number; + readonly name?: (string) | null; + }; + }; +}; + +export type ComplexParamsResponse = (ModelWithString); + +export type PatchApiNoTagResponse = (unknown); + +export type ImportData = { + requestBody: (ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly); +}; + +export type ImportResponse = (Model_From_Zendesk | ModelWithReadOnlyAndWriteOnly); + +export type FooWowResponse = (unknown); + +export type GetApiSimpleOperationData = { + /** + * foo in method + */ + fooParam: string; +}; + +export type GetApiSimpleOperationResponse = (number); + +export type CallWithDefaultParametersData = { + /** + * This is a simple boolean with default value + */ + parameterBoolean?: (boolean) | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: (ModelWithString) | null; + /** + * This is a simple number with default value + */ + parameterNumber?: (number) | null; + /** + * This is a simple string with default value + */ + parameterString?: (string) | null; +}; + +export type CallWithDefaultOptionalParametersData = { + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; +}; + +export type CallToTestOrderOfParamsData = { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: (string) | null; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: (string) | null; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; +}; + +export type DeprecatedCallData = { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: (DeprecatedModel) | null; +}; + +export type CallWithDescriptionsData = { + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: unknown; + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: unknown; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: unknown; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: unknown; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: unknown; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: unknown; +}; + +export type TestErrorCodeData = { + /** + * Status code to return + */ + status: number; +}; + +export type TestErrorCodeResponse = (unknown); + +export type FileResponseData = { + id: string; +}; + +export type FileResponseResponse = ((Blob | File)); + +export type PostApiFormDataData = { + /** + * A reusable request body + */ + formData?: ModelWithString; + /** + * This is a reusable parameter + */ + parameter?: string; +}; + +export type CallWithResultFromHeaderResponse = (string); + +export type MultipartRequestData = { + formData?: { + content?: (Blob | File); + data?: ((ModelWithString) | null); + }; +}; + +export type MultipartResponseResponse = ({ + file?: (Blob | File); + metadata?: { + foo?: string; + bar?: string; + }; +}); + +export type DummyAResponse = (_400); + +export type DummyBResponse = (void); + +export type CallWithNoContentResponseResponse = (void); + +export type CallWithResponseAndNoContentResponseResponse = (number | void); + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + /** + * Dummy input param + */ + nonAsciiParamæøåÆøÅöôêÊ: number; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = (Array); + +export type PutWithFormUrlEncodedData = { + formData: ArrayWithStrings; +}; + +export type DeleteFooData3 = { + /** + * bar in method + */ + barParam: string; + /** + * foo in method + */ + fooParam: string; + /** + * Parameter with illegal characters + */ + xFooBar: ModelWithString; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the query params + */ + cursor: (string) | null; + fooAllOfEnum: (ModelWithNestedArrayEnumsDataFoo); + fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the cookie + */ + parameterCookie: (string) | null; + /** + * This is the parameter that goes into the header + */ + parameterHeader: (string) | null; + /** + * This is the parameter that goes into the path + */ + parameterPath: (string) | null; + /** + * This is the parameter that goes into the body + */ + requestBody: { + [key: string]: unknown; + } | null; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter with a reserved keyword + */ + _default?: string; + /** + * This is the parameter that goes into the cookie + */ + parameterCookie: (string) | null; + /** + * This is the parameter that goes into the request header + */ + parameterHeader: (string) | null; + /** + * This is the parameter that goes into the path + */ + parameterPath1?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath2?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath3?: string; + /** + * This is the parameter that goes into the request query params + */ + parameterQuery: (string) | null; + /** + * This is the parameter that goes into the body + */ + requestBody: (ModelWithString) | null; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + page?: number; + /** + * This is a required parameter + */ + requestBody: ModelWithOneOfEnum; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is a required parameter + */ + parameter: Pageable; + /** + * This is an optional parameter + */ + requestBody?: { + offset?: (number) | null; + }; +}; + +export type PostCallWithOptionalParamResponse = (number | void); + +export type PostApiRequestBodyData = { + /** + * A reusable request body + */ + foo?: ModelWithString; + /** + * This is a reusable parameter + */ + parameter?: string; +}; + +export type CallWithResponseResponse = (_import); + +export type CallWithDuplicateResponsesResponse = ((ModelWithBoolean & ModelWithInteger) | ModelWithString); + +export type CallWithResponsesResponse = ({ + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; +} | ModelThatExtends | ModelThatExtendsExtends); + +export type ApiVVersionODataControllerCountResponse = (Model_From_Zendesk); + +export type TypesData = { + /** + * This is a number parameter + */ + id?: number; + /** + * This is an array parameter + */ + parameterArray: Array<(string)> | null; + /** + * This is a boolean parameter + */ + parameterBoolean: (boolean) | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: ('Success' | 'Warning' | 'Error') | null; + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is a string parameter + */ + parameterString: (string) | null; + /** + * This is tuple parameter + */ + parameterTuple: [ + number, + number, + number, + number + ]; +}; + +export type TypesResponse = (number | string | boolean | { + [key: string]: unknown; +}); + +export type UploadFileData = { + formData: (Blob | File); +}; + +export type UploadFileResponse = (boolean); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiError.ts new file mode 100644 index 000000000..36675d288 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiError.ts @@ -0,0 +1,21 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; + +export class ApiError extends Error { + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: unknown; + public readonly request: ApiRequestOptions; + + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); + + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiRequestOptions.ts new file mode 100644 index 000000000..939a0aa4c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiRequestOptions.ts @@ -0,0 +1,21 @@ +export type ApiRequestOptions = { + readonly body?: any; + readonly cookies?: Record; + readonly errors?: Record; + readonly formData?: Record | any[] | Blob | File; + readonly headers?: Record; + readonly mediaType?: string; + readonly method: + | 'DELETE' + | 'GET' + | 'HEAD' + | 'OPTIONS' + | 'PATCH' + | 'POST' + | 'PUT'; + readonly path?: Record; + readonly query?: Record; + readonly responseHeader?: string; + readonly responseTransformer?: (data: unknown) => Promise; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiResult.ts new file mode 100644 index 000000000..4c58e3913 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiResult.ts @@ -0,0 +1,7 @@ +export type ApiResult = { + readonly body: TData; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/CancelablePromise.ts new file mode 100644 index 000000000..ccc082e8f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/CancelablePromise.ts @@ -0,0 +1,126 @@ +export class CancelError extends Error { + constructor(message: string) { + super(message); + this.name = 'CancelError'; + } + + public get isCancelled(): boolean { + return true; + } +} + +export interface OnCancel { + readonly isResolved: boolean; + readonly isRejected: boolean; + readonly isCancelled: boolean; + + (cancelHandler: () => void): void; +} + +export class CancelablePromise implements Promise { + private _isResolved: boolean; + private _isRejected: boolean; + private _isCancelled: boolean; + readonly cancelHandlers: (() => void)[]; + readonly promise: Promise; + private _resolve?: (value: T | PromiseLike) => void; + private _reject?: (reason?: unknown) => void; + + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason?: unknown) => void, + onCancel: OnCancel + ) => void + ) { + this._isResolved = false; + this._isRejected = false; + this._isCancelled = false; + this.cancelHandlers = []; + this.promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + + const onResolve = (value: T | PromiseLike): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isResolved = true; + if (this._resolve) this._resolve(value); + }; + + const onReject = (reason?: unknown): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isRejected = true; + if (this._reject) this._reject(reason); + }; + + const onCancel = (cancelHandler: () => void): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this.cancelHandlers.push(cancelHandler); + }; + + Object.defineProperty(onCancel, 'isResolved', { + get: (): boolean => this._isResolved, + }); + + Object.defineProperty(onCancel, 'isRejected', { + get: (): boolean => this._isRejected, + }); + + Object.defineProperty(onCancel, 'isCancelled', { + get: (): boolean => this._isCancelled, + }); + + return executor(onResolve, onReject, onCancel as OnCancel); + }); + } + + get [Symbol.toStringTag]() { + return "Cancellable Promise"; + } + + public then( + onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null + ): Promise { + return this.promise.then(onFulfilled, onRejected); + } + + public catch( + onRejected?: ((reason: unknown) => TResult | PromiseLike) | null + ): Promise { + return this.promise.catch(onRejected); + } + + public finally(onFinally?: (() => void) | null): Promise { + return this.promise.finally(onFinally); + } + + public cancel(): void { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isCancelled = true; + if (this.cancelHandlers.length) { + try { + for (const cancelHandler of this.cancelHandlers) { + cancelHandler(); + } + } catch (error) { + console.warn('Cancellation threw an error', error); + return; + } + } + this.cancelHandlers.length = 0; + if (this._reject) this._reject(new CancelError('Request aborted')); + } + + public get isCancelled(): boolean { + return this._isCancelled; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/OpenAPI.ts new file mode 100644 index 000000000..cb7b23cb7 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/OpenAPI.ts @@ -0,0 +1,57 @@ +import type { AxiosRequestConfig, AxiosResponse } from 'axios'; +import type { ApiRequestOptions } from './ApiRequestOptions'; + +type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware): void { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Middleware): void { + this._fns = [...this._fns, fn]; + } +} + +export type OpenAPIConfig = { + BASE: string; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + VERSION: string; + WITH_CREDENTIALS: boolean; + interceptors: { + request: Interceptors; + response: Interceptors; + }; +}; + +export const OpenAPI: OpenAPIConfig = { + BASE: 'http://localhost:3000/base', + CREDENTIALS: 'include', + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + TOKEN: undefined, + USERNAME: undefined, + VERSION: '1.0', + WITH_CREDENTIALS: false, + interceptors: { + request: new Interceptors(), + response: new Interceptors(), + }, +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/request.ts new file mode 100644 index 000000000..ecc2e393c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/request.ts @@ -0,0 +1,347 @@ +import axios from 'axios'; +import type { AxiosError, AxiosRequestConfig, AxiosResponse, AxiosInstance } from 'axios'; + +import { ApiError } from './ApiError'; +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; +import { CancelablePromise } from './CancelablePromise'; +import type { OnCancel } from './CancelablePromise'; +import type { OpenAPIConfig } from './OpenAPI'; + +export const isString = (value: unknown): value is string => { + return typeof value === 'string'; +}; + +export const isStringWithValue = (value: unknown): value is string => { + return isString(value) && value !== ''; +}; + +export const isBlob = (value: any): value is Blob => { + return value instanceof Blob; +}; + +export const isFormData = (value: unknown): value is FormData => { + return value instanceof FormData; +}; + +export const isSuccess = (status: number): boolean => { + return status >= 200 && status < 300; +}; + +export const base64 = (str: string): string => { + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } +}; + +export const getQueryString = (params: Record): string => { + const qs: string[] = []; + + const append = (key: string, value: unknown) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; + + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; + } + + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { + value.forEach(v => encodePair(key, v)); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); + } + }; + + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); + + return qs.length ? `?${qs.join('&')}` : ''; +}; + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI; + + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); + + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; +}; + +export const getFormData = (options: ApiRequestOptions): FormData | undefined => { + if (options.formData) { + const formData = new FormData(); + + const process = (key: string, value: unknown) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; + + Object.entries(options.formData) + .filter(([, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); + + return formData; + } + return undefined; +}; + +type Resolver = (options: ApiRequestOptions) => Promise; + +export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; +}; + +export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise> => { + const [token, username, password, additionalHeaders] = await Promise.all([ + // @ts-ignore + resolve(options, config.TOKEN), + // @ts-ignore + resolve(options, config.USERNAME), + // @ts-ignore + resolve(options, config.PASSWORD), + // @ts-ignore + resolve(options, config.HEADERS), + ]); + + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + }) + .filter(([, value]) => value !== undefined && value !== null) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); + + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } else if (options.formData !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } + } + + return headers; +}; + +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body) { + return options.body; + } + return undefined; +}; + +export const sendRequest = async ( + config: OpenAPIConfig, + options: ApiRequestOptions, + url: string, + body: unknown, + formData: FormData | undefined, + headers: Record, + onCancel: OnCancel, + axiosClient: AxiosInstance +): Promise> => { + const controller = new AbortController(); + + let requestConfig: AxiosRequestConfig = { + data: body ?? formData, + headers, + method: options.method, + signal: controller.signal, + url, + withCredentials: config.WITH_CREDENTIALS, + }; + + onCancel(() => controller.abort()); + + for (const fn of config.interceptors.request._fns) { + requestConfig = await fn(requestConfig); + } + + try { + return await axiosClient.request(requestConfig); + } catch (error) { + const axiosError = error as AxiosError; + if (axiosError.response) { + return axiosError.response; + } + throw error; + } +}; + +export const getResponseHeader = (response: AxiosResponse, responseHeader?: string): string | undefined => { + if (responseHeader) { + const content = response.headers[responseHeader]; + if (isString(content)) { + return content; + } + } + return undefined; +}; + +export const getResponseBody = (response: AxiosResponse): unknown => { + if (response.status !== 204) { + return response.data; + } + return undefined; +}; + +export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Payload Too Large', + 414: 'URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Range Not Satisfiable', + 417: 'Expectation Failed', + 418: 'Im a teapot', + 421: 'Misdirected Request', + 422: 'Unprocessable Content', + 423: 'Locked', + 424: 'Failed Dependency', + 425: 'Too Early', + 426: 'Upgrade Required', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', + 451: 'Unavailable For Legal Reasons', + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 508: 'Loop Detected', + 510: 'Not Extended', + 511: 'Network Authentication Required', + ...options.errors, + } + + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } + + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } +}; + +/** + * Request method + * @param config The OpenAPI configuration object + * @param options The request options from the service + * @param axiosClient The axios client instance to use + * @returns CancelablePromise + * @throws ApiError + */ +export const request = (config: OpenAPIConfig, options: ApiRequestOptions, axiosClient: AxiosInstance = axios): CancelablePromise => { + return new CancelablePromise(async (resolve, reject, onCancel) => { + try { + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); + const headers = await getHeaders(config, options); + + if (!onCancel.isCancelled) { + let response = await sendRequest(config, options, url, body, formData, headers, onCancel, axiosClient); + + for (const fn of config.interceptors.response._fns) { + response = await fn(response); + } + + const responseBody = getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + + let transformedBody = responseBody; + if (options.responseTransformer && isSuccess(response.status)) { + transformedBody = await options.responseTransformer(responseBody) + } + + const result: ApiResult = { + url, + ok: isSuccess(response.status), + status: response.status, + statusText: response.statusText, + body: responseHeader ?? transformedBody, + }; + + catchErrorCodes(options, result); + + resolve(result.body); + } + } catch (error) { + reject(error); + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios_transform/index.ts b/packages/openapi-ts-tests/test/generated/v3_axios_transform/index.ts new file mode 100644 index 000000000..50a1dd734 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_axios_transform/index.ts @@ -0,0 +1,6 @@ +// This file is auto-generated by @hey-api/openapi-ts +export { ApiError } from './core/ApiError'; +export { CancelablePromise, CancelError } from './core/CancelablePromise'; +export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios_transform/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_axios_transform/sdk.gen.ts new file mode 100644 index 000000000..5211e9979 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_axios_transform/sdk.gen.ts @@ -0,0 +1,80 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CancelablePromise } from './core/CancelablePromise'; +import { OpenAPI } from './core/OpenAPI'; +import { request as __request } from './core/request'; +import { type ParentModelWithDatesResponse, type ModelWithDatesResponse, type ModelWithDatesArrayResponse, type ArrayOfDatesResponse, type DateResponse, type MultipleResponsesResponse, ParentModelWithDatesResponseTransformer, ModelWithDatesResponseTransformer, ModelWithDatesArrayResponseTransformer } from './types.gen'; + +export class DefaultService { + /** + * @returns ParentModelWithDates Success + * @returns unknown Success + * @throws ApiError + */ + public static parentModelWithDates(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/model-with-dates', + responseTransformer: ParentModelWithDatesResponseTransformer + }); + } + + /** + * @returns ModelWithDates Success + * @throws ApiError + */ + public static modelWithDates(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/model-with-dates', + responseTransformer: ModelWithDatesResponseTransformer + }); + } + + /** + * @returns ModelWithDates Success + * @throws ApiError + */ + public static modelWithDatesArray(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/model-with-dates-array', + responseTransformer: ModelWithDatesArrayResponseTransformer + }); + } + + /** + * @returns string Success + * @throws ApiError + */ + public static arrayOfDates(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/array-of-dates' + }); + } + + /** + * @returns string Success + * @throws ApiError + */ + public static date(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/date' + }); + } + + /** + * @returns ModelWithDates Updated + * @returns SimpleModel Created + * @throws ApiError + */ + public static multipleResponses(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/multiple-responses' + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios_transform/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_axios_transform/types.gen.ts new file mode 100644 index 000000000..8c9227850 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_axios_transform/types.gen.ts @@ -0,0 +1,106 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * This is a model that contains a some dates + */ +export type ModelWithDates = { + id: number; + name: string; + readonly enabled: boolean; + readonly modified: Date; + readonly expires?: Date; +}; + +/** + * This is a model that contains a some dates and arrays + */ +export type ParentModelWithDates = { + id: number; + readonly modified?: Date; + items?: Array; + item?: ModelWithDates; + 'nullable-date'?: Array<(Date | null)>; + simpleItems?: Array; + simpleItem?: SimpleModel; + dates?: Array<(Date)>; + strings?: Array<(string)>; +}; + +/** + * This is a model that contains a some dates + */ +export type SimpleModel = { + id: number; + name: string; + readonly enabled: boolean; +}; + +export type ParentModelWithDatesResponse = (ParentModelWithDates | unknown); + +export type ModelWithDatesResponse = (ModelWithDates); + +export type ModelWithDatesArrayResponse = (Array); + +export type ArrayOfDatesResponse = (Array<(Date)>); + +export type DateResponse = (Date); + +export type MultipleResponsesResponse = (Array | Array); + +export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; + +export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; + +export type ModelWithDatesModelResponseTransformer = (data: any) => ModelWithDates; + +export const ModelWithDatesModelResponseTransformer: ModelWithDatesModelResponseTransformer = data => { + if (data?.modified) { + data.modified = new Date(data.modified); + } + if (data?.expires) { + data.expires = new Date(data.expires); + } + return data; +}; + +export const ParentModelWithDatesModelResponseTransformer: ParentModelWithDatesModelResponseTransformer = data => { + if (data?.modified) { + data.modified = new Date(data.modified); + } + if (Array.isArray(data?.items)) { + data.items.forEach(ModelWithDatesModelResponseTransformer); + } + if (data?.item) { + ModelWithDatesModelResponseTransformer(data.item); + } + if (Array.isArray(data?.['nullable-date'])) { + data['nullable-date'] = data['nullable-date'].map(item => item ? new Date(item) : item); + } + if (Array.isArray(data?.dates)) { + data.dates = data.dates.map(item => item ? new Date(item) : item); + } + return data; +}; + +export const ParentModelWithDatesResponseTransformer: ParentModelWithDatesResponseTransformer = async (data) => { + if (data) { + ParentModelWithDatesModelResponseTransformer(data); + } + return data; +}; + +export type ModelWithDatesResponseTransformer = (data: any) => Promise; + +export const ModelWithDatesResponseTransformer: ModelWithDatesResponseTransformer = async (data) => { + ModelWithDatesModelResponseTransformer(data); + return data; +}; + +export type ModelWithDatesArrayResponseTransformer = (data: any) => Promise; + +export const ModelWithDatesArrayResponseTransformer: ModelWithDatesArrayResponseTransformer = async (data) => { + if (Array.isArray(data)) { + data.forEach(ModelWithDatesModelResponseTransformer); + } + return data; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client/ApiClient.ts b/packages/openapi-ts-tests/test/generated/v3_client/ApiClient.ts new file mode 100644 index 000000000..b864adbea --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client/ApiClient.ts @@ -0,0 +1,101 @@ +import type { BaseHttpRequest } from './core/BaseHttpRequest'; +import type { OpenAPIConfig } from './core/OpenAPI'; +import { Interceptors } from './core/OpenAPI'; +import { FetchHttpRequest } from './core/FetchHttpRequest'; + +import { CollectionFormatService } from './sdk.gen'; +import { ComplexService } from './sdk.gen'; +import { DefaultService } from './sdk.gen'; +import { DefaultsService } from './sdk.gen'; +import { DeprecatedService } from './sdk.gen'; +import { DescriptionsService } from './sdk.gen'; +import { DuplicateService } from './sdk.gen'; +import { ErrorService } from './sdk.gen'; +import { FileResponseService } from './sdk.gen'; +import { FormDataService } from './sdk.gen'; +import { HeaderService } from './sdk.gen'; +import { MultipartService } from './sdk.gen'; +import { MultipleTags1Service } from './sdk.gen'; +import { MultipleTags2Service } from './sdk.gen'; +import { MultipleTags3Service } from './sdk.gen'; +import { NoContentService } from './sdk.gen'; +import { NonAsciiÆøåÆøÅöôêÊService } from './sdk.gen'; +import { ParametersService } from './sdk.gen'; +import { RequestBodyService } from './sdk.gen'; +import { ResponseService } from './sdk.gen'; +import { SimpleService } from './sdk.gen'; +import { TypesService } from './sdk.gen'; +import { UploadService } from './sdk.gen'; + +type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest; + +export class ApiClient { + + public readonly collectionFormat: CollectionFormatService; + public readonly complex: ComplexService; + public readonly default: DefaultService; + public readonly defaults: DefaultsService; + public readonly deprecated: DeprecatedService; + public readonly descriptions: DescriptionsService; + public readonly duplicate: DuplicateService; + public readonly error: ErrorService; + public readonly fileResponse: FileResponseService; + public readonly formData: FormDataService; + public readonly header: HeaderService; + public readonly multipart: MultipartService; + public readonly multipleTags1: MultipleTags1Service; + public readonly multipleTags2: MultipleTags2Service; + public readonly multipleTags3: MultipleTags3Service; + public readonly noContent: NoContentService; + public readonly nonAsciiÆøåÆøÅöôêÊ: NonAsciiÆøåÆøÅöôêÊService; + public readonly parameters: ParametersService; + public readonly requestBody: RequestBodyService; + public readonly response: ResponseService; + public readonly simple: SimpleService; + public readonly types: TypesService; + public readonly upload: UploadService; + + public readonly request: BaseHttpRequest; + + constructor(config?: Partial, HttpRequest: HttpRequestConstructor = FetchHttpRequest) { + this.request = new HttpRequest({ + BASE: config?.BASE ?? 'http://localhost:3000/base', + VERSION: config?.VERSION ?? '1.0', + WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false, + CREDENTIALS: config?.CREDENTIALS ?? 'include', + TOKEN: config?.TOKEN, + USERNAME: config?.USERNAME, + PASSWORD: config?.PASSWORD, + HEADERS: config?.HEADERS, + ENCODE_PATH: config?.ENCODE_PATH, + interceptors: { + request: config?.interceptors?.request ?? new Interceptors(), + response: config?.interceptors?.response ?? new Interceptors(), + }, + }); + + this.collectionFormat = new CollectionFormatService(this.request); + this.complex = new ComplexService(this.request); + this.default = new DefaultService(this.request); + this.defaults = new DefaultsService(this.request); + this.deprecated = new DeprecatedService(this.request); + this.descriptions = new DescriptionsService(this.request); + this.duplicate = new DuplicateService(this.request); + this.error = new ErrorService(this.request); + this.fileResponse = new FileResponseService(this.request); + this.formData = new FormDataService(this.request); + this.header = new HeaderService(this.request); + this.multipart = new MultipartService(this.request); + this.multipleTags1 = new MultipleTags1Service(this.request); + this.multipleTags2 = new MultipleTags2Service(this.request); + this.multipleTags3 = new MultipleTags3Service(this.request); + this.noContent = new NoContentService(this.request); + this.nonAsciiÆøåÆøÅöôêÊ = new NonAsciiÆøåÆøÅöôêÊService(this.request); + this.parameters = new ParametersService(this.request); + this.requestBody = new RequestBodyService(this.request); + this.response = new ResponseService(this.request); + this.simple = new SimpleService(this.request); + this.types = new TypesService(this.request); + this.upload = new UploadService(this.request); + } +} diff --git a/packages/openapi-ts-tests/test/generated/v3_client/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_client/core/ApiError.ts new file mode 100644 index 000000000..36675d288 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client/core/ApiError.ts @@ -0,0 +1,21 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; + +export class ApiError extends Error { + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: unknown; + public readonly request: ApiRequestOptions; + + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); + + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_client/core/ApiRequestOptions.ts new file mode 100644 index 000000000..939a0aa4c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client/core/ApiRequestOptions.ts @@ -0,0 +1,21 @@ +export type ApiRequestOptions = { + readonly body?: any; + readonly cookies?: Record; + readonly errors?: Record; + readonly formData?: Record | any[] | Blob | File; + readonly headers?: Record; + readonly mediaType?: string; + readonly method: + | 'DELETE' + | 'GET' + | 'HEAD' + | 'OPTIONS' + | 'PATCH' + | 'POST' + | 'PUT'; + readonly path?: Record; + readonly query?: Record; + readonly responseHeader?: string; + readonly responseTransformer?: (data: unknown) => Promise; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_client/core/ApiResult.ts new file mode 100644 index 000000000..4c58e3913 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client/core/ApiResult.ts @@ -0,0 +1,7 @@ +export type ApiResult = { + readonly body: TData; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client/core/BaseHttpRequest.ts b/packages/openapi-ts-tests/test/generated/v3_client/core/BaseHttpRequest.ts new file mode 100644 index 000000000..ee28b8164 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client/core/BaseHttpRequest.ts @@ -0,0 +1,10 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { CancelablePromise } from './CancelablePromise'; +import type { OpenAPIConfig } from './OpenAPI'; + +export abstract class BaseHttpRequest { + + constructor(public readonly config: OpenAPIConfig) {} + + public abstract request(options: ApiRequestOptions): CancelablePromise; +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_client/core/CancelablePromise.ts new file mode 100644 index 000000000..ccc082e8f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client/core/CancelablePromise.ts @@ -0,0 +1,126 @@ +export class CancelError extends Error { + constructor(message: string) { + super(message); + this.name = 'CancelError'; + } + + public get isCancelled(): boolean { + return true; + } +} + +export interface OnCancel { + readonly isResolved: boolean; + readonly isRejected: boolean; + readonly isCancelled: boolean; + + (cancelHandler: () => void): void; +} + +export class CancelablePromise implements Promise { + private _isResolved: boolean; + private _isRejected: boolean; + private _isCancelled: boolean; + readonly cancelHandlers: (() => void)[]; + readonly promise: Promise; + private _resolve?: (value: T | PromiseLike) => void; + private _reject?: (reason?: unknown) => void; + + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason?: unknown) => void, + onCancel: OnCancel + ) => void + ) { + this._isResolved = false; + this._isRejected = false; + this._isCancelled = false; + this.cancelHandlers = []; + this.promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + + const onResolve = (value: T | PromiseLike): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isResolved = true; + if (this._resolve) this._resolve(value); + }; + + const onReject = (reason?: unknown): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isRejected = true; + if (this._reject) this._reject(reason); + }; + + const onCancel = (cancelHandler: () => void): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this.cancelHandlers.push(cancelHandler); + }; + + Object.defineProperty(onCancel, 'isResolved', { + get: (): boolean => this._isResolved, + }); + + Object.defineProperty(onCancel, 'isRejected', { + get: (): boolean => this._isRejected, + }); + + Object.defineProperty(onCancel, 'isCancelled', { + get: (): boolean => this._isCancelled, + }); + + return executor(onResolve, onReject, onCancel as OnCancel); + }); + } + + get [Symbol.toStringTag]() { + return "Cancellable Promise"; + } + + public then( + onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null + ): Promise { + return this.promise.then(onFulfilled, onRejected); + } + + public catch( + onRejected?: ((reason: unknown) => TResult | PromiseLike) | null + ): Promise { + return this.promise.catch(onRejected); + } + + public finally(onFinally?: (() => void) | null): Promise { + return this.promise.finally(onFinally); + } + + public cancel(): void { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isCancelled = true; + if (this.cancelHandlers.length) { + try { + for (const cancelHandler of this.cancelHandlers) { + cancelHandler(); + } + } catch (error) { + console.warn('Cancellation threw an error', error); + return; + } + } + this.cancelHandlers.length = 0; + if (this._reject) this._reject(new CancelError('Request aborted')); + } + + public get isCancelled(): boolean { + return this._isCancelled; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client/core/FetchHttpRequest.ts b/packages/openapi-ts-tests/test/generated/v3_client/core/FetchHttpRequest.ts new file mode 100644 index 000000000..e7c4bd5a9 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client/core/FetchHttpRequest.ts @@ -0,0 +1,22 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import { BaseHttpRequest } from './BaseHttpRequest'; +import type { CancelablePromise } from './CancelablePromise'; +import type { OpenAPIConfig } from './OpenAPI'; +import { request as __request } from './request'; + +export class FetchHttpRequest extends BaseHttpRequest { + + constructor(config: OpenAPIConfig) { + super(config); + } + + /** + * Request method + * @param options The request options from the service + * @returns CancelablePromise + * @throws ApiError + */ + public override request(options: ApiRequestOptions): CancelablePromise { + return __request(this.config, options); + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_client/core/OpenAPI.ts new file mode 100644 index 000000000..144e25744 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client/core/OpenAPI.ts @@ -0,0 +1,56 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; + +type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware): void { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Middleware): void { + this._fns = [...this._fns, fn]; + } +} + +export type OpenAPIConfig = { + BASE: string; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + VERSION: string; + WITH_CREDENTIALS: boolean; + interceptors: { + request: Interceptors; + response: Interceptors; + }; +}; + +export const OpenAPI: OpenAPIConfig = { + BASE: 'http://localhost:3000/base', + CREDENTIALS: 'include', + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + TOKEN: undefined, + USERNAME: undefined, + VERSION: '1.0', + WITH_CREDENTIALS: false, + interceptors: { + request: new Interceptors(), + response: new Interceptors(), + }, +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_client/core/request.ts new file mode 100644 index 000000000..5458a2899 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client/core/request.ts @@ -0,0 +1,350 @@ +import { ApiError } from './ApiError'; +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; +import { CancelablePromise } from './CancelablePromise'; +import type { OnCancel } from './CancelablePromise'; +import type { OpenAPIConfig } from './OpenAPI'; + +export const isString = (value: unknown): value is string => { + return typeof value === 'string'; +}; + +export const isStringWithValue = (value: unknown): value is string => { + return isString(value) && value !== ''; +}; + +export const isBlob = (value: any): value is Blob => { + return value instanceof Blob; +}; + +export const isFormData = (value: unknown): value is FormData => { + return value instanceof FormData; +}; + +export const base64 = (str: string): string => { + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } +}; + +export const getQueryString = (params: Record): string => { + const qs: string[] = []; + + const append = (key: string, value: unknown) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; + + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; + } + + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { + value.forEach(v => encodePair(key, v)); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); + } + }; + + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); + + return qs.length ? `?${qs.join('&')}` : ''; +}; + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI; + + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); + + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; +}; + +export const getFormData = (options: ApiRequestOptions): FormData | undefined => { + if (options.formData) { + const formData = new FormData(); + + const process = (key: string, value: unknown) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; + + Object.entries(options.formData) + .filter(([, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); + + return formData; + } + return undefined; +}; + +type Resolver = (options: ApiRequestOptions) => Promise; + +export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; +}; + +export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { + const [token, username, password, additionalHeaders] = await Promise.all([ + // @ts-ignore + resolve(options, config.TOKEN), + // @ts-ignore + resolve(options, config.USERNAME), + // @ts-ignore + resolve(options, config.PASSWORD), + // @ts-ignore + resolve(options, config.HEADERS), + ]); + + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + }) + .filter(([, value]) => value !== undefined && value !== null) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); + + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } + + return new Headers(headers); +}; + +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body !== undefined) { + if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { + return JSON.stringify(options.body); + } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { + return options.body; + } else { + return JSON.stringify(options.body); + } + } + return undefined; +}; + +export const sendRequest = async ( + config: OpenAPIConfig, + options: ApiRequestOptions, + url: string, + body: any, + formData: FormData | undefined, + headers: Headers, + onCancel: OnCancel +): Promise => { + const controller = new AbortController(); + + let request: RequestInit = { + headers, + body: body ?? formData, + method: options.method, + signal: controller.signal, + }; + + if (config.WITH_CREDENTIALS) { + request.credentials = config.CREDENTIALS; + } + + for (const fn of config.interceptors.request._fns) { + request = await fn(request); + } + + onCancel(() => controller.abort()); + + return await fetch(url, request); +}; + +export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { + if (responseHeader) { + const content = response.headers.get(responseHeader); + if (isString(content)) { + return content; + } + } + return undefined; +}; + +export const getResponseBody = async (response: Response): Promise => { + if (response.status !== 204) { + try { + const contentType = response.headers.get('Content-Type'); + if (contentType) { + const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; + if (contentType.includes('application/json') || contentType.includes('+json')) { + return await response.json(); + } else if (binaryTypes.some(type => contentType.includes(type))) { + return await response.blob(); + } else if (contentType.includes('multipart/form-data')) { + return await response.formData(); + } else if (contentType.includes('text/')) { + return await response.text(); + } + } + } catch (error) { + console.error(error); + } + } + return undefined; +}; + +export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Payload Too Large', + 414: 'URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Range Not Satisfiable', + 417: 'Expectation Failed', + 418: 'Im a teapot', + 421: 'Misdirected Request', + 422: 'Unprocessable Content', + 423: 'Locked', + 424: 'Failed Dependency', + 425: 'Too Early', + 426: 'Upgrade Required', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', + 451: 'Unavailable For Legal Reasons', + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 508: 'Loop Detected', + 510: 'Not Extended', + 511: 'Network Authentication Required', + ...options.errors, + } + + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } + + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } +}; + +/** + * Request method + * @param config The OpenAPI configuration object + * @param options The request options from the service + * @returns CancelablePromise + * @throws ApiError + */ +export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { + return new CancelablePromise(async (resolve, reject, onCancel) => { + try { + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); + const headers = await getHeaders(config, options); + + if (!onCancel.isCancelled) { + let response = await sendRequest(config, options, url, body, formData, headers, onCancel); + + for (const fn of config.interceptors.response._fns) { + response = await fn(response); + } + + const responseBody = await getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + + let transformedBody = responseBody; + if (options.responseTransformer && response.ok) { + transformedBody = await options.responseTransformer(responseBody) + } + + const result: ApiResult = { + url, + ok: response.ok, + status: response.status, + statusText: response.statusText, + body: responseHeader ?? transformedBody, + }; + + catchErrorCodes(options, result); + + resolve(result.body); + } + } catch (error) { + reject(error); + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client/index.ts b/packages/openapi-ts-tests/test/generated/v3_client/index.ts new file mode 100644 index 000000000..7e12dd663 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client/index.ts @@ -0,0 +1,8 @@ +// This file is auto-generated by @hey-api/openapi-ts +export { ApiClient } from './ApiClient'; +export { ApiError } from './core/ApiError'; +export { BaseHttpRequest } from './core/BaseHttpRequest'; +export { CancelablePromise, CancelError } from './core/CancelablePromise'; +export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_client/sdk.gen.ts new file mode 100644 index 000000000..ca0f0d5c1 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client/sdk.gen.ts @@ -0,0 +1,958 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CancelablePromise } from './core/CancelablePromise'; +import type { BaseHttpRequest } from './core/BaseHttpRequest'; +import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; + +export class CollectionFormatService { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @param data The data for the request. + * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) + * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) + * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) + * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) + * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) + * @throws ApiError + */ + public collectionFormat(data: CollectionFormatData): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/api/v{api-version}/collectionFormat', + query: { + parameterArrayCSV: data.parameterArrayCsv, + parameterArraySSV: data.parameterArraySsv, + parameterArrayTSV: data.parameterArrayTsv, + parameterArrayPipes: data.parameterArrayPipes, + parameterArrayMulti: data.parameterArrayMulti + } + }); + } + +} + +export class ComplexService { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @param data The data for the request. + * @param data.parameterObject Parameter containing object + * @param data.parameterReference Parameter containing reference + * @returns ModelWithString Successful response + * @throws ApiError + */ + public complexTypes(data: ComplexTypesData): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/api/v{api-version}/complex', + query: { + parameterObject: data.parameterObject, + parameterReference: data.parameterReference + }, + errors: { + 400: '400 `server` error', + 500: '500 server error' + } + }); + } + + /** + * @param data The data for the request. + * @param data.id + * @param data.requestBody + * @returns ModelWithString Success + * @throws ApiError + */ + public complexParams(data: ComplexParamsData): CancelablePromise { + return this.httpRequest.request({ + method: 'PUT', + url: '/api/v{api-version}/complex/{id}', + path: { + id: data.id + }, + body: data.requestBody, + mediaType: 'application/json-patch+json' + }); + } + +} + +export class DefaultService { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @throws ApiError + */ + public export(): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public patchApiNoTag(): CancelablePromise { + return this.httpRequest.request({ + method: 'PATCH', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @param data The data for the request. + * @param data.requestBody + * @returns Model_From_Zendesk Success + * @returns ModelWithReadOnlyAndWriteOnly Default success response + * @throws ApiError + */ + public import(data: ImportData): CancelablePromise { + return this.httpRequest.request({ + method: 'POST', + url: '/api/v{api-version}/no+tag', + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public fooWow(): CancelablePromise { + return this.httpRequest.request({ + method: 'PUT', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @param data The data for the request. + * @param data.fooParam foo in method + * @returns number Response is a simple number + * @throws ApiError + */ + public getApiSimpleOperation(data: GetApiSimpleOperationData): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/api/v{api-version}/simple:operation', + path: { + foo_param: data.fooParam + }, + errors: { + default: 'Default error response' + } + }); + } + +} + +export class DefaultsService { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @param data The data for the request. + * @param data.parameterString This is a simple string with default value + * @param data.parameterNumber This is a simple number with default value + * @param data.parameterBoolean This is a simple boolean with default value + * @param data.parameterEnum This is a simple enum with default value + * @param data.parameterModel This is a simple model with default value + * @throws ApiError + */ + public callWithDefaultParameters(data: CallWithDefaultParametersData = {}): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterString This is a simple string that is optional with default value + * @param data.parameterNumber This is a simple number that is optional with default value + * @param data.parameterBoolean This is a simple boolean that is optional with default value + * @param data.parameterEnum This is a simple enum that is optional with default value + * @param data.parameterModel This is a simple model that is optional with default value + * @throws ApiError + */ + public callWithDefaultOptionalParameters(data: CallWithDefaultOptionalParametersData = {}): CancelablePromise { + return this.httpRequest.request({ + method: 'POST', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterStringWithNoDefault This is a string with no default + * @param data.parameterOptionalStringWithDefault This is a optional string with default + * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default + * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default + * @param data.parameterStringWithDefault This is a string with default + * @param data.parameterStringWithEmptyDefault This is a string with empty default + * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default + * @param data.parameterStringNullableWithDefault This is a string that can be null with default + * @throws ApiError + */ + public callToTestOrderOfParams(data: CallToTestOrderOfParamsData): CancelablePromise { + return this.httpRequest.request({ + method: 'PUT', + url: '/api/v{api-version}/defaults', + query: { + parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, + parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, + parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, + parameterStringWithDefault: data.parameterStringWithDefault, + parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, + parameterStringWithNoDefault: data.parameterStringWithNoDefault, + parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, + parameterStringNullableWithDefault: data.parameterStringNullableWithDefault + } + }); + } + +} + +export class DeprecatedService { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @deprecated + * @param data The data for the request. + * @param data.parameter This parameter is deprecated + * @throws ApiError + */ + public deprecatedCall(data: DeprecatedCallData): CancelablePromise { + return this.httpRequest.request({ + method: 'POST', + url: '/api/v{api-version}/parameters/deprecated', + headers: { + parameter: data.parameter + } + }); + } + +} + +export class DescriptionsService { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @param data The data for the request. + * @param data.parameterWithBreaks Testing multiline comments in string: First line + * Second line + * + * Fourth line + * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work + * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work + * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work + * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work + * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work + * @throws ApiError + */ + public callWithDescriptions(data: CallWithDescriptionsData = {}): CancelablePromise { + return this.httpRequest.request({ + method: 'POST', + url: '/api/v{api-version}/descriptions/', + query: { + parameterWithBreaks: data.parameterWithBreaks, + parameterWithBackticks: data.parameterWithBackticks, + parameterWithSlashes: data.parameterWithSlashes, + parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders, + parameterWithQuotes: data.parameterWithQuotes, + parameterWithReservedCharacters: data.parameterWithReservedCharacters + } + }); + } + +} + +export class DuplicateService { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @throws ApiError + */ + public duplicateName(): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public duplicateName1(): CancelablePromise { + return this.httpRequest.request({ + method: 'POST', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public duplicateName2(): CancelablePromise { + return this.httpRequest.request({ + method: 'PUT', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public duplicateName3(): CancelablePromise { + return this.httpRequest.request({ + method: 'DELETE', + url: '/api/v{api-version}/duplicate' + }); + } + +} + +export class ErrorService { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @param data The data for the request. + * @param data.status Status code to return + * @returns unknown Custom message: Successful response + * @throws ApiError + */ + public testErrorCode(data: TestErrorCodeData): CancelablePromise { + return this.httpRequest.request({ + method: 'POST', + url: '/api/v{api-version}/error', + query: { + status: data.status + }, + errors: { + 500: 'Custom message: Internal Server Error', + 501: 'Custom message: Not Implemented', + 502: 'Custom message: Bad Gateway', + 503: 'Custom message: Service Unavailable' + } + }); + } + +} + +export class FileResponseService { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @param data The data for the request. + * @param data.id + * @returns binary Success + * @throws ApiError + */ + public fileResponse(data: FileResponseData): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/api/v{api-version}/file/{id}', + path: { + id: data.id + } + }); + } + +} + +export class FormDataService { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @param data The data for the request. + * @param data.parameter This is a reusable parameter + * @param data.formData A reusable request body + * @throws ApiError + */ + public postApiFormData(data: PostApiFormDataData = {}): CancelablePromise { + return this.httpRequest.request({ + method: 'POST', + url: '/api/v{api-version}/formData/', + query: { + parameter: data.parameter + }, + formData: data.formData, + mediaType: 'multipart/form-data' + }); + } + +} + +export class HeaderService { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @returns string Successful response + * @throws ApiError + */ + public callWithResultFromHeader(): CancelablePromise { + return this.httpRequest.request({ + method: 'POST', + url: '/api/v{api-version}/header', + responseHeader: 'operation-location', + errors: { + 400: '400 server error', + 500: '500 server error' + } + }); + } + +} + +export class MultipartService { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @param data The data for the request. + * @param data.formData + * @throws ApiError + */ + public multipartRequest(data: MultipartRequestData = {}): CancelablePromise { + return this.httpRequest.request({ + method: 'POST', + url: '/api/v{api-version}/multipart', + formData: data.formData, + mediaType: 'multipart/form-data' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public multipartResponse(): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/api/v{api-version}/multipart' + }); + } + +} + +export class MultipleTags1Service { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @returns _400 + * @throws ApiError + */ + public dummyA(): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/api/v{api-version}/multiple-tags/a' + }); + } + + /** + * @returns void Success + * @throws ApiError + */ + public dummyB(): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class MultipleTags2Service { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @returns _400 + * @throws ApiError + */ + public dummyA(): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/api/v{api-version}/multiple-tags/a' + }); + } + + /** + * @returns void Success + * @throws ApiError + */ + public dummyB(): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class MultipleTags3Service { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @returns void Success + * @throws ApiError + */ + public dummyB(): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class NoContentService { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @returns void Success + * @throws ApiError + */ + public callWithNoContentResponse(): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/api/v{api-version}/no-content' + }); + } + + /** + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public callWithResponseAndNoContentResponse(): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/api/v{api-version}/multiple-tags/response-and-no-content' + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @param data The data for the request. + * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param + * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response + * @throws ApiError + */ + public nonAsciiæøåÆøÅöôêÊ字符串(data: NonAsciiæøåÆøÅöôêÊ字符串Data): CancelablePromise { + return this.httpRequest.request({ + method: 'POST', + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + query: { + 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ + } + }); + } + + /** + * Login User + * @param data The data for the request. + * @param data.formData + * @throws ApiError + */ + public putWithFormUrlEncoded(data: PutWithFormUrlEncodedData): CancelablePromise { + return this.httpRequest.request({ + method: 'PUT', + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + formData: data.formData, + mediaType: 'application/x-www-form-urlencoded' + }); + } + +} + +export class ParametersService { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @param data The data for the request. + * @param data.fooParam foo in method + * @param data.barParam bar in method + * @param data.xFooBar Parameter with illegal characters + * @throws ApiError + */ + public deleteFoo(data: DeleteFooData3): CancelablePromise { + return this.httpRequest.request({ + method: 'DELETE', + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + path: { + foo_param: data.fooParam, + BarParam: data.barParam + }, + headers: { + 'x-Foo-Bar': data.xFooBar + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the header + * @param data.fooAllOfEnum + * @param data.cursor This is the parameter that goes into the query params + * @param data.parameterCookie This is the parameter that goes into the cookie + * @param data.parameterPath This is the parameter that goes into the path + * @param data.requestBody This is the parameter that goes into the body + * @param data.fooRefEnum + * @throws ApiError + */ + public callWithParameters(data: CallWithParametersData): CancelablePromise { + return this.httpRequest.request({ + method: 'POST', + url: '/api/v{api-version}/parameters/{parameterPath}', + path: { + parameterPath: data.parameterPath + }, + cookies: { + parameterCookie: data.parameterCookie + }, + headers: { + parameterHeader: data.parameterHeader + }, + query: { + foo_ref_enum: data.fooRefEnum, + foo_all_of_enum: data.fooAllOfEnum, + cursor: data.cursor + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the request header + * @param data.parameterQuery This is the parameter that goes into the request query params + * @param data.parameterCookie This is the parameter that goes into the cookie + * @param data.requestBody This is the parameter that goes into the body + * @param data.parameterPath1 This is the parameter that goes into the path + * @param data.parameterPath2 This is the parameter that goes into the path + * @param data.parameterPath3 This is the parameter that goes into the path + * @param data._default This is the parameter with a reserved keyword + * @throws ApiError + */ + public callWithWeirdParameterNames(data: CallWithWeirdParameterNamesData): CancelablePromise { + return this.httpRequest.request({ + method: 'POST', + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + path: { + 'parameter.path.1': data.parameterPath1, + 'parameter-path-2': data.parameterPath2, + 'PARAMETER-PATH-3': data.parameterPath3 + }, + cookies: { + 'PARAMETER-COOKIE': data.parameterCookie + }, + headers: { + 'parameter.header': data.parameterHeader + }, + query: { + default: data._default, + 'parameter-query': data.parameterQuery + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.requestBody This is a required parameter + * @param data.page This is an optional parameter + * @throws ApiError + */ + public getCallWithOptionalParam(data: GetCallWithOptionalParamData): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/api/v{api-version}/parameters/', + query: { + page: data.page + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.parameter This is a required parameter + * @param data.requestBody This is an optional parameter + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public postCallWithOptionalParam(data: PostCallWithOptionalParamData): CancelablePromise { + return this.httpRequest.request({ + method: 'POST', + url: '/api/v{api-version}/parameters/', + query: { + parameter: data.parameter + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + +} + +export class RequestBodyService { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @param data The data for the request. + * @param data.parameter This is a reusable parameter + * @param data.foo A reusable request body + * @throws ApiError + */ + public postApiRequestBody(data: PostApiRequestBodyData = {}): CancelablePromise { + return this.httpRequest.request({ + method: 'POST', + url: '/api/v{api-version}/requestBody/', + query: { + parameter: data.parameter + }, + body: data.foo, + mediaType: 'application/json' + }); + } + +} + +export class ResponseService { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public callWithResponseAndNoContentResponse(): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/api/v{api-version}/multiple-tags/response-and-no-content' + }); + } + + /** + * @returns import + * @throws ApiError + */ + public callWithResponse(): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/api/v{api-version}/response' + }); + } + + /** + * @returns unknown Message for 200 response + * @returns ModelWithString Message for 201 response + * @returns ModelWithString Message for 202 response + * @throws ApiError + */ + public callWithDuplicateResponses(): CancelablePromise { + return this.httpRequest.request({ + method: 'POST', + url: '/api/v{api-version}/response', + errors: { + 500: 'Message for 500 error', + 501: 'Message for 501 error', + 502: 'Message for 502 error', + '4XX': 'Message for 4XX errors', + default: 'Default error response' + } + }); + } + + /** + * @returns unknown Message for 200 response + * @returns ModelThatExtends Message for 201 response + * @returns ModelThatExtendsExtends Message for 202 response + * @throws ApiError + */ + public callWithResponses(): CancelablePromise { + return this.httpRequest.request({ + method: 'PUT', + url: '/api/v{api-version}/response', + errors: { + 500: 'Message for 500 error', + 501: 'Message for 501 error', + 502: 'Message for 502 error', + default: 'Message for default response' + } + }); + } + +} + +export class SimpleService { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @returns Model_From_Zendesk Success + * @throws ApiError + */ + public apiVVersionODataControllerCount(): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/api/v{api-version}/simple/$count' + }); + } + + /** + * @throws ApiError + */ + public getCallWithoutParametersAndResponse(): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public putCallWithoutParametersAndResponse(): CancelablePromise { + return this.httpRequest.request({ + method: 'PUT', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public postCallWithoutParametersAndResponse(): CancelablePromise { + return this.httpRequest.request({ + method: 'POST', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public deleteCallWithoutParametersAndResponse(): CancelablePromise { + return this.httpRequest.request({ + method: 'DELETE', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public optionsCallWithoutParametersAndResponse(): CancelablePromise { + return this.httpRequest.request({ + method: 'OPTIONS', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public headCallWithoutParametersAndResponse(): CancelablePromise { + return this.httpRequest.request({ + method: 'HEAD', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public patchCallWithoutParametersAndResponse(): CancelablePromise { + return this.httpRequest.request({ + method: 'PATCH', + url: '/api/v{api-version}/simple' + }); + } + +} + +export class TypesService { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @param data The data for the request. + * @param data.parameterArray This is an array parameter + * @param data.parameterDictionary This is a dictionary parameter + * @param data.parameterEnum This is an enum parameter + * @param data.parameterTuple This is tuple parameter + * @param data.parameterNumber This is a number parameter + * @param data.parameterString This is a string parameter + * @param data.parameterBoolean This is a boolean parameter + * @param data.parameterObject This is an object parameter + * @param data.id This is a number parameter + * @returns number Response is a simple number + * @returns string Response is a simple string + * @returns boolean Response is a simple boolean + * @returns unknown Response is a simple object + * @throws ApiError + */ + public types(data: TypesData): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/api/v{api-version}/types', + path: { + id: data.id + }, + query: { + parameterNumber: data.parameterNumber, + parameterString: data.parameterString, + parameterBoolean: data.parameterBoolean, + parameterObject: data.parameterObject, + parameterArray: data.parameterArray, + parameterDictionary: data.parameterDictionary, + parameterEnum: data.parameterEnum, + parameterTuple: data.parameterTuple + } + }); + } + +} + +export class UploadService { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @param data The data for the request. + * @param data.formData + * @returns boolean + * @throws ApiError + */ + public uploadFile(data: UploadFileData): CancelablePromise { + return this.httpRequest.request({ + method: 'POST', + url: '/api/v{api-version}/upload', + formData: data.formData, + mediaType: 'application/x-www-form-urlencoded' + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_client/types.gen.ts new file mode 100644 index 000000000..df8f9dece --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client/types.gen.ts @@ -0,0 +1,1414 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _3e_num_1Период = 'Bird' | 'Dog'; + +/** + * Model with number-only name + */ +export type _400 = string; + +export type _default = { + name?: string; +}; + +/** + * Model with restricted keyword name + */ +export type _import = string; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: (number) | undefined; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AnyOfAnyAndNull = { + data?: (unknown | null); +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<({ + foo?: string; +} | { + bar?: string; +})>; +}; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<({ + foo?: string; +} | { + bar?: string; +})>; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array<(boolean)>; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array<(number)>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: camelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array<(string)>; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type camelCaseCommentWithBreaks = number; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + firstName: string; + lastname: string; + age: number; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: (({ + boolean?: boolean; +} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: (Array<(_3e_num_1Период | ConstValue)> | null); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(number | string)>; +}); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: ParameterSimpleParameter; +} | { + bar: NonAsciiStringæøåÆØÅöôêÊ字符串; +}) & { + baz: (number) | null; + qux: number; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(boolean)>; +}); +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: (boolean | { + [key: string]: (number); +}); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; + +export type ConstValue = "ConstValue"; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: (string); + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: (string | number | boolean) | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: (string); +}; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +export type File = { + readonly id?: string; + readonly updated_at?: Date; + readonly created_at?: Date; + mime: string; + readonly file?: string; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { + item?: boolean; + error?: (string) | null; + readonly hasError?: boolean; + data?: { + [key: string]: unknown; + }; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_String_ = { + item?: (string) | null; + error?: (string) | null; + readonly hasError?: boolean; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type Model_From_Zendesk = string; + +/** + * Circle + */ +export type ModelCircle = { + kind: 'circle'; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: 'square'; + sideLength?: number; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string; +}; + +export type ModelWithAnyOfConstantSizeArray = [ + (number | string), + (number | string), + (number | string) +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + (number & string), + (number & string) +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + ((number) | null | string), + ((number) | null | string), + ((number) | null | string) +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + (number | _import), + (number | _import) +]; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnly = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +export type ModelWithConst = { + String?: "String"; + number?: 0; + null?: null; + withType?: "Some string"; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: (string); + }; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: boolean; +}; + +/** + * This is a simple enum with strings + */ +export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + +/** + * These are the HTTP error code enums + */ +export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +export type foo_bar_baz_qux = '3.0'; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array<(string)>; + data?: (ModelWithNestedArrayEnumsData); +}; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedCompositionEnums = { + foo?: (ModelWithNestedArrayEnumsDataFoo); +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: ('Success' | 'Warning' | 'Error'); + }; + dictionaryWithEnumFromDescription?: { + [key: string]: (number); + }; + arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; + arrayWithDescription?: Array<(number)>; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedProperties = { + readonly first: { + readonly second: { + readonly third: (string) | null; + } | null; + } | null; +}; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: (string) | null; + /** + * This is a simple string property + */ + nullableProp2?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: (string) | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Период + */ +export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; + +export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { + baz: (number) | null; + qux: number; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: Date; + foo: 'Quux'; +} | { + content: [ + (Date | string), + (Date | string) + ]; + foo: 'Corge'; +}; + +export type foo = 'Bar'; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPattern = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: Date; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + (number | string), + string +]; + +/** + * This is a model with one nested property + */ +export type ModelWithProperties = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: (string) | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +export type ModelWithReadOnlyAndWriteOnly = { + foo: string; + readonly bar: string; + baz: string; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReference = { + prop?: ModelWithProperties; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: (Array<(string | boolean)> | null); +}; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array<(string)>; +}; + +/** + * This is a reusable parameter + */ +export type ParameterSimpleParameter = string; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Parameter with illegal characters + */ +export type Parameterx_Foo_Bar = ModelWithString; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<({ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; +})>; +}; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple file + */ +export type SimpleFile = (Blob | File); + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = (string) | null; + +export type CollectionFormatData = { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCsv: Array<(string)> | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array<(string)> | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array<(string)> | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySsv: Array<(string)> | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTsv: Array<(string)> | null; +}; + +export type ComplexTypesData = { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; +}; + +export type ComplexTypesResponse = (Array); + +export type ComplexParamsData = { + id: number; + requestBody?: { + readonly key: (string) | null; + name: (string) | null; + enabled?: boolean; + readonly type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array<(string)> | null; + parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); + readonly user?: { + readonly id?: number; + readonly name?: (string) | null; + }; + }; +}; + +export type ComplexParamsResponse = (ModelWithString); + +export type PatchApiNoTagResponse = (unknown); + +export type ImportData = { + requestBody: (ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly); +}; + +export type ImportResponse = (Model_From_Zendesk | ModelWithReadOnlyAndWriteOnly); + +export type FooWowResponse = (unknown); + +export type GetApiSimpleOperationData = { + /** + * foo in method + */ + fooParam: string; +}; + +export type GetApiSimpleOperationResponse = (number); + +export type CallWithDefaultParametersData = { + /** + * This is a simple boolean with default value + */ + parameterBoolean?: (boolean) | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: (ModelWithString) | null; + /** + * This is a simple number with default value + */ + parameterNumber?: (number) | null; + /** + * This is a simple string with default value + */ + parameterString?: (string) | null; +}; + +export type CallWithDefaultOptionalParametersData = { + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; +}; + +export type CallToTestOrderOfParamsData = { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: (string) | null; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: (string) | null; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; +}; + +export type DeprecatedCallData = { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: (DeprecatedModel) | null; +}; + +export type CallWithDescriptionsData = { + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: unknown; + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: unknown; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: unknown; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: unknown; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: unknown; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: unknown; +}; + +export type TestErrorCodeData = { + /** + * Status code to return + */ + status: number; +}; + +export type TestErrorCodeResponse = (unknown); + +export type FileResponseData = { + id: string; +}; + +export type FileResponseResponse = ((Blob | File)); + +export type PostApiFormDataData = { + /** + * A reusable request body + */ + formData?: ModelWithString; + /** + * This is a reusable parameter + */ + parameter?: string; +}; + +export type CallWithResultFromHeaderResponse = (string); + +export type MultipartRequestData = { + formData?: { + content?: (Blob | File); + data?: ((ModelWithString) | null); + }; +}; + +export type MultipartResponseResponse = ({ + file?: (Blob | File); + metadata?: { + foo?: string; + bar?: string; + }; +}); + +export type DummyAResponse = (_400); + +export type DummyBResponse = (void); + +export type CallWithNoContentResponseResponse = (void); + +export type CallWithResponseAndNoContentResponseResponse = (number | void); + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + /** + * Dummy input param + */ + nonAsciiParamæøåÆøÅöôêÊ: number; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = (Array); + +export type PutWithFormUrlEncodedData = { + formData: ArrayWithStrings; +}; + +export type DeleteFooData3 = { + /** + * bar in method + */ + barParam: string; + /** + * foo in method + */ + fooParam: string; + /** + * Parameter with illegal characters + */ + xFooBar: ModelWithString; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the query params + */ + cursor: (string) | null; + fooAllOfEnum: (ModelWithNestedArrayEnumsDataFoo); + fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the cookie + */ + parameterCookie: (string) | null; + /** + * This is the parameter that goes into the header + */ + parameterHeader: (string) | null; + /** + * This is the parameter that goes into the path + */ + parameterPath: (string) | null; + /** + * This is the parameter that goes into the body + */ + requestBody: { + [key: string]: unknown; + } | null; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter with a reserved keyword + */ + _default?: string; + /** + * This is the parameter that goes into the cookie + */ + parameterCookie: (string) | null; + /** + * This is the parameter that goes into the request header + */ + parameterHeader: (string) | null; + /** + * This is the parameter that goes into the path + */ + parameterPath1?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath2?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath3?: string; + /** + * This is the parameter that goes into the request query params + */ + parameterQuery: (string) | null; + /** + * This is the parameter that goes into the body + */ + requestBody: (ModelWithString) | null; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + page?: number; + /** + * This is a required parameter + */ + requestBody: ModelWithOneOfEnum; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is a required parameter + */ + parameter: Pageable; + /** + * This is an optional parameter + */ + requestBody?: { + offset?: (number) | null; + }; +}; + +export type PostCallWithOptionalParamResponse = (number | void); + +export type PostApiRequestBodyData = { + /** + * A reusable request body + */ + foo?: ModelWithString; + /** + * This is a reusable parameter + */ + parameter?: string; +}; + +export type CallWithResponseResponse = (_import); + +export type CallWithDuplicateResponsesResponse = ((ModelWithBoolean & ModelWithInteger) | ModelWithString); + +export type CallWithResponsesResponse = ({ + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; +} | ModelThatExtends | ModelThatExtendsExtends); + +export type ApiVVersionODataControllerCountResponse = (Model_From_Zendesk); + +export type TypesData = { + /** + * This is a number parameter + */ + id?: number; + /** + * This is an array parameter + */ + parameterArray: Array<(string)> | null; + /** + * This is a boolean parameter + */ + parameterBoolean: (boolean) | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: ('Success' | 'Warning' | 'Error') | null; + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is a string parameter + */ + parameterString: (string) | null; + /** + * This is tuple parameter + */ + parameterTuple: [ + number, + number, + number, + number + ]; +}; + +export type TypesResponse = (number | string | boolean | { + [key: string]: unknown; +}); + +export type UploadFileData = { + formData: (Blob | File); +}; + +export type UploadFileResponse = (boolean); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/ApiClient.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/ApiClient.ts new file mode 100644 index 000000000..6b14fbb1a --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client_transform/ApiClient.ts @@ -0,0 +1,35 @@ +import type { BaseHttpRequest } from './core/BaseHttpRequest'; +import type { OpenAPIConfig } from './core/OpenAPI'; +import { Interceptors } from './core/OpenAPI'; +import { FetchHttpRequest } from './core/FetchHttpRequest'; + +import { DefaultService } from './sdk.gen'; + +type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest; + +export class ApiClient { + + public readonly default: DefaultService; + + public readonly request: BaseHttpRequest; + + constructor(config?: Partial, HttpRequest: HttpRequestConstructor = FetchHttpRequest) { + this.request = new HttpRequest({ + BASE: config?.BASE ?? 'http://localhost:3000/base', + VERSION: config?.VERSION ?? '1.0', + WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false, + CREDENTIALS: config?.CREDENTIALS ?? 'include', + TOKEN: config?.TOKEN, + USERNAME: config?.USERNAME, + PASSWORD: config?.PASSWORD, + HEADERS: config?.HEADERS, + ENCODE_PATH: config?.ENCODE_PATH, + interceptors: { + request: config?.interceptors?.request ?? new Interceptors(), + response: config?.interceptors?.response ?? new Interceptors(), + }, + }); + + this.default = new DefaultService(this.request); + } +} diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiError.ts new file mode 100644 index 000000000..36675d288 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiError.ts @@ -0,0 +1,21 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; + +export class ApiError extends Error { + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: unknown; + public readonly request: ApiRequestOptions; + + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); + + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiRequestOptions.ts new file mode 100644 index 000000000..939a0aa4c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiRequestOptions.ts @@ -0,0 +1,21 @@ +export type ApiRequestOptions = { + readonly body?: any; + readonly cookies?: Record; + readonly errors?: Record; + readonly formData?: Record | any[] | Blob | File; + readonly headers?: Record; + readonly mediaType?: string; + readonly method: + | 'DELETE' + | 'GET' + | 'HEAD' + | 'OPTIONS' + | 'PATCH' + | 'POST' + | 'PUT'; + readonly path?: Record; + readonly query?: Record; + readonly responseHeader?: string; + readonly responseTransformer?: (data: unknown) => Promise; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiResult.ts new file mode 100644 index 000000000..4c58e3913 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiResult.ts @@ -0,0 +1,7 @@ +export type ApiResult = { + readonly body: TData; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/BaseHttpRequest.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/BaseHttpRequest.ts new file mode 100644 index 000000000..ee28b8164 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/BaseHttpRequest.ts @@ -0,0 +1,10 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { CancelablePromise } from './CancelablePromise'; +import type { OpenAPIConfig } from './OpenAPI'; + +export abstract class BaseHttpRequest { + + constructor(public readonly config: OpenAPIConfig) {} + + public abstract request(options: ApiRequestOptions): CancelablePromise; +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/CancelablePromise.ts new file mode 100644 index 000000000..ccc082e8f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/CancelablePromise.ts @@ -0,0 +1,126 @@ +export class CancelError extends Error { + constructor(message: string) { + super(message); + this.name = 'CancelError'; + } + + public get isCancelled(): boolean { + return true; + } +} + +export interface OnCancel { + readonly isResolved: boolean; + readonly isRejected: boolean; + readonly isCancelled: boolean; + + (cancelHandler: () => void): void; +} + +export class CancelablePromise implements Promise { + private _isResolved: boolean; + private _isRejected: boolean; + private _isCancelled: boolean; + readonly cancelHandlers: (() => void)[]; + readonly promise: Promise; + private _resolve?: (value: T | PromiseLike) => void; + private _reject?: (reason?: unknown) => void; + + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason?: unknown) => void, + onCancel: OnCancel + ) => void + ) { + this._isResolved = false; + this._isRejected = false; + this._isCancelled = false; + this.cancelHandlers = []; + this.promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + + const onResolve = (value: T | PromiseLike): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isResolved = true; + if (this._resolve) this._resolve(value); + }; + + const onReject = (reason?: unknown): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isRejected = true; + if (this._reject) this._reject(reason); + }; + + const onCancel = (cancelHandler: () => void): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this.cancelHandlers.push(cancelHandler); + }; + + Object.defineProperty(onCancel, 'isResolved', { + get: (): boolean => this._isResolved, + }); + + Object.defineProperty(onCancel, 'isRejected', { + get: (): boolean => this._isRejected, + }); + + Object.defineProperty(onCancel, 'isCancelled', { + get: (): boolean => this._isCancelled, + }); + + return executor(onResolve, onReject, onCancel as OnCancel); + }); + } + + get [Symbol.toStringTag]() { + return "Cancellable Promise"; + } + + public then( + onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null + ): Promise { + return this.promise.then(onFulfilled, onRejected); + } + + public catch( + onRejected?: ((reason: unknown) => TResult | PromiseLike) | null + ): Promise { + return this.promise.catch(onRejected); + } + + public finally(onFinally?: (() => void) | null): Promise { + return this.promise.finally(onFinally); + } + + public cancel(): void { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isCancelled = true; + if (this.cancelHandlers.length) { + try { + for (const cancelHandler of this.cancelHandlers) { + cancelHandler(); + } + } catch (error) { + console.warn('Cancellation threw an error', error); + return; + } + } + this.cancelHandlers.length = 0; + if (this._reject) this._reject(new CancelError('Request aborted')); + } + + public get isCancelled(): boolean { + return this._isCancelled; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/FetchHttpRequest.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/FetchHttpRequest.ts new file mode 100644 index 000000000..e7c4bd5a9 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/FetchHttpRequest.ts @@ -0,0 +1,22 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import { BaseHttpRequest } from './BaseHttpRequest'; +import type { CancelablePromise } from './CancelablePromise'; +import type { OpenAPIConfig } from './OpenAPI'; +import { request as __request } from './request'; + +export class FetchHttpRequest extends BaseHttpRequest { + + constructor(config: OpenAPIConfig) { + super(config); + } + + /** + * Request method + * @param options The request options from the service + * @returns CancelablePromise + * @throws ApiError + */ + public override request(options: ApiRequestOptions): CancelablePromise { + return __request(this.config, options); + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/OpenAPI.ts new file mode 100644 index 000000000..144e25744 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/OpenAPI.ts @@ -0,0 +1,56 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; + +type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware): void { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Middleware): void { + this._fns = [...this._fns, fn]; + } +} + +export type OpenAPIConfig = { + BASE: string; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + VERSION: string; + WITH_CREDENTIALS: boolean; + interceptors: { + request: Interceptors; + response: Interceptors; + }; +}; + +export const OpenAPI: OpenAPIConfig = { + BASE: 'http://localhost:3000/base', + CREDENTIALS: 'include', + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + TOKEN: undefined, + USERNAME: undefined, + VERSION: '1.0', + WITH_CREDENTIALS: false, + interceptors: { + request: new Interceptors(), + response: new Interceptors(), + }, +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/request.ts new file mode 100644 index 000000000..5458a2899 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/request.ts @@ -0,0 +1,350 @@ +import { ApiError } from './ApiError'; +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; +import { CancelablePromise } from './CancelablePromise'; +import type { OnCancel } from './CancelablePromise'; +import type { OpenAPIConfig } from './OpenAPI'; + +export const isString = (value: unknown): value is string => { + return typeof value === 'string'; +}; + +export const isStringWithValue = (value: unknown): value is string => { + return isString(value) && value !== ''; +}; + +export const isBlob = (value: any): value is Blob => { + return value instanceof Blob; +}; + +export const isFormData = (value: unknown): value is FormData => { + return value instanceof FormData; +}; + +export const base64 = (str: string): string => { + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } +}; + +export const getQueryString = (params: Record): string => { + const qs: string[] = []; + + const append = (key: string, value: unknown) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; + + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; + } + + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { + value.forEach(v => encodePair(key, v)); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); + } + }; + + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); + + return qs.length ? `?${qs.join('&')}` : ''; +}; + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI; + + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); + + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; +}; + +export const getFormData = (options: ApiRequestOptions): FormData | undefined => { + if (options.formData) { + const formData = new FormData(); + + const process = (key: string, value: unknown) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; + + Object.entries(options.formData) + .filter(([, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); + + return formData; + } + return undefined; +}; + +type Resolver = (options: ApiRequestOptions) => Promise; + +export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; +}; + +export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { + const [token, username, password, additionalHeaders] = await Promise.all([ + // @ts-ignore + resolve(options, config.TOKEN), + // @ts-ignore + resolve(options, config.USERNAME), + // @ts-ignore + resolve(options, config.PASSWORD), + // @ts-ignore + resolve(options, config.HEADERS), + ]); + + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + }) + .filter(([, value]) => value !== undefined && value !== null) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); + + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } + + return new Headers(headers); +}; + +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body !== undefined) { + if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { + return JSON.stringify(options.body); + } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { + return options.body; + } else { + return JSON.stringify(options.body); + } + } + return undefined; +}; + +export const sendRequest = async ( + config: OpenAPIConfig, + options: ApiRequestOptions, + url: string, + body: any, + formData: FormData | undefined, + headers: Headers, + onCancel: OnCancel +): Promise => { + const controller = new AbortController(); + + let request: RequestInit = { + headers, + body: body ?? formData, + method: options.method, + signal: controller.signal, + }; + + if (config.WITH_CREDENTIALS) { + request.credentials = config.CREDENTIALS; + } + + for (const fn of config.interceptors.request._fns) { + request = await fn(request); + } + + onCancel(() => controller.abort()); + + return await fetch(url, request); +}; + +export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { + if (responseHeader) { + const content = response.headers.get(responseHeader); + if (isString(content)) { + return content; + } + } + return undefined; +}; + +export const getResponseBody = async (response: Response): Promise => { + if (response.status !== 204) { + try { + const contentType = response.headers.get('Content-Type'); + if (contentType) { + const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; + if (contentType.includes('application/json') || contentType.includes('+json')) { + return await response.json(); + } else if (binaryTypes.some(type => contentType.includes(type))) { + return await response.blob(); + } else if (contentType.includes('multipart/form-data')) { + return await response.formData(); + } else if (contentType.includes('text/')) { + return await response.text(); + } + } + } catch (error) { + console.error(error); + } + } + return undefined; +}; + +export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Payload Too Large', + 414: 'URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Range Not Satisfiable', + 417: 'Expectation Failed', + 418: 'Im a teapot', + 421: 'Misdirected Request', + 422: 'Unprocessable Content', + 423: 'Locked', + 424: 'Failed Dependency', + 425: 'Too Early', + 426: 'Upgrade Required', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', + 451: 'Unavailable For Legal Reasons', + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 508: 'Loop Detected', + 510: 'Not Extended', + 511: 'Network Authentication Required', + ...options.errors, + } + + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } + + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } +}; + +/** + * Request method + * @param config The OpenAPI configuration object + * @param options The request options from the service + * @returns CancelablePromise + * @throws ApiError + */ +export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { + return new CancelablePromise(async (resolve, reject, onCancel) => { + try { + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); + const headers = await getHeaders(config, options); + + if (!onCancel.isCancelled) { + let response = await sendRequest(config, options, url, body, formData, headers, onCancel); + + for (const fn of config.interceptors.response._fns) { + response = await fn(response); + } + + const responseBody = await getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + + let transformedBody = responseBody; + if (options.responseTransformer && response.ok) { + transformedBody = await options.responseTransformer(responseBody) + } + + const result: ApiResult = { + url, + ok: response.ok, + status: response.status, + statusText: response.statusText, + body: responseHeader ?? transformedBody, + }; + + catchErrorCodes(options, result); + + resolve(result.body); + } + } catch (error) { + reject(error); + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/index.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/index.ts new file mode 100644 index 000000000..7e12dd663 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client_transform/index.ts @@ -0,0 +1,8 @@ +// This file is auto-generated by @hey-api/openapi-ts +export { ApiClient } from './ApiClient'; +export { ApiError } from './core/ApiError'; +export { BaseHttpRequest } from './core/BaseHttpRequest'; +export { CancelablePromise, CancelError } from './core/CancelablePromise'; +export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/sdk.gen.ts new file mode 100644 index 000000000..e83516e47 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client_transform/sdk.gen.ts @@ -0,0 +1,81 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CancelablePromise } from './core/CancelablePromise'; +import type { BaseHttpRequest } from './core/BaseHttpRequest'; +import { type ParentModelWithDatesResponse, type ModelWithDatesResponse, type ModelWithDatesArrayResponse, type ArrayOfDatesResponse, type DateResponse, type MultipleResponsesResponse, ParentModelWithDatesResponseTransformer, ModelWithDatesResponseTransformer, ModelWithDatesArrayResponseTransformer } from './types.gen'; + +export class DefaultService { + constructor(public readonly httpRequest: BaseHttpRequest) { } + + /** + * @returns ParentModelWithDates Success + * @returns unknown Success + * @throws ApiError + */ + public parentModelWithDates(): CancelablePromise { + return this.httpRequest.request({ + method: 'POST', + url: '/api/model-with-dates', + responseTransformer: ParentModelWithDatesResponseTransformer + }); + } + + /** + * @returns ModelWithDates Success + * @throws ApiError + */ + public modelWithDates(): CancelablePromise { + return this.httpRequest.request({ + method: 'PUT', + url: '/api/model-with-dates', + responseTransformer: ModelWithDatesResponseTransformer + }); + } + + /** + * @returns ModelWithDates Success + * @throws ApiError + */ + public modelWithDatesArray(): CancelablePromise { + return this.httpRequest.request({ + method: 'PUT', + url: '/api/model-with-dates-array', + responseTransformer: ModelWithDatesArrayResponseTransformer + }); + } + + /** + * @returns string Success + * @throws ApiError + */ + public arrayOfDates(): CancelablePromise { + return this.httpRequest.request({ + method: 'PUT', + url: '/api/array-of-dates' + }); + } + + /** + * @returns string Success + * @throws ApiError + */ + public date(): CancelablePromise { + return this.httpRequest.request({ + method: 'PUT', + url: '/api/date' + }); + } + + /** + * @returns ModelWithDates Updated + * @returns SimpleModel Created + * @throws ApiError + */ + public multipleResponses(): CancelablePromise { + return this.httpRequest.request({ + method: 'PUT', + url: '/api/multiple-responses' + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/types.gen.ts new file mode 100644 index 000000000..8c9227850 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_client_transform/types.gen.ts @@ -0,0 +1,106 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * This is a model that contains a some dates + */ +export type ModelWithDates = { + id: number; + name: string; + readonly enabled: boolean; + readonly modified: Date; + readonly expires?: Date; +}; + +/** + * This is a model that contains a some dates and arrays + */ +export type ParentModelWithDates = { + id: number; + readonly modified?: Date; + items?: Array; + item?: ModelWithDates; + 'nullable-date'?: Array<(Date | null)>; + simpleItems?: Array; + simpleItem?: SimpleModel; + dates?: Array<(Date)>; + strings?: Array<(string)>; +}; + +/** + * This is a model that contains a some dates + */ +export type SimpleModel = { + id: number; + name: string; + readonly enabled: boolean; +}; + +export type ParentModelWithDatesResponse = (ParentModelWithDates | unknown); + +export type ModelWithDatesResponse = (ModelWithDates); + +export type ModelWithDatesArrayResponse = (Array); + +export type ArrayOfDatesResponse = (Array<(Date)>); + +export type DateResponse = (Date); + +export type MultipleResponsesResponse = (Array | Array); + +export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; + +export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; + +export type ModelWithDatesModelResponseTransformer = (data: any) => ModelWithDates; + +export const ModelWithDatesModelResponseTransformer: ModelWithDatesModelResponseTransformer = data => { + if (data?.modified) { + data.modified = new Date(data.modified); + } + if (data?.expires) { + data.expires = new Date(data.expires); + } + return data; +}; + +export const ParentModelWithDatesModelResponseTransformer: ParentModelWithDatesModelResponseTransformer = data => { + if (data?.modified) { + data.modified = new Date(data.modified); + } + if (Array.isArray(data?.items)) { + data.items.forEach(ModelWithDatesModelResponseTransformer); + } + if (data?.item) { + ModelWithDatesModelResponseTransformer(data.item); + } + if (Array.isArray(data?.['nullable-date'])) { + data['nullable-date'] = data['nullable-date'].map(item => item ? new Date(item) : item); + } + if (Array.isArray(data?.dates)) { + data.dates = data.dates.map(item => item ? new Date(item) : item); + } + return data; +}; + +export const ParentModelWithDatesResponseTransformer: ParentModelWithDatesResponseTransformer = async (data) => { + if (data) { + ParentModelWithDatesModelResponseTransformer(data); + } + return data; +}; + +export type ModelWithDatesResponseTransformer = (data: any) => Promise; + +export const ModelWithDatesResponseTransformer: ModelWithDatesResponseTransformer = async (data) => { + ModelWithDatesModelResponseTransformer(data); + return data; +}; + +export type ModelWithDatesArrayResponseTransformer = (data: any) => Promise; + +export const ModelWithDatesArrayResponseTransformer: ModelWithDatesArrayResponseTransformer = async (data) => { + if (Array.isArray(data)) { + data.forEach(ModelWithDatesModelResponseTransformer); + } + return data; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_date/index.ts b/packages/openapi-ts-tests/test/generated/v3_date/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_date/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_date/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_date/types.gen.ts new file mode 100644 index 000000000..19860aec8 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_date/types.gen.ts @@ -0,0 +1,967 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _3e_num_1Период = 'Bird' | 'Dog'; + +/** + * Model with number-only name + */ +export type _400 = string; + +export type _default = { + name?: string; +}; + +/** + * Model with restricted keyword name + */ +export type _import = string; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: (number) | undefined; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AnyOfAnyAndNull = { + data?: (unknown | null); +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<({ + foo?: string; +} | { + bar?: string; +})>; +}; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<({ + foo?: string; +} | { + bar?: string; +})>; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array<(boolean)>; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array<(number)>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: camelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array<(string)>; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type camelCaseCommentWithBreaks = number; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + firstName: string; + lastname: string; + age: number; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: (({ + boolean?: boolean; +} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: (Array<(_3e_num_1Период | ConstValue)> | null); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(number | string)>; +}); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: ParameterSimpleParameter; +} | { + bar: NonAsciiStringæøåÆØÅöôêÊ字符串; +}) & { + baz: (number) | null; + qux: number; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(boolean)>; +}); +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: (boolean | { + [key: string]: (number); +}); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; + +export type ConstValue = "ConstValue"; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: (string); + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: (string | number | boolean) | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: (string); +}; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +export type File = { + readonly id?: string; + readonly updated_at?: Date; + readonly created_at?: Date; + mime: string; + readonly file?: string; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { + item?: boolean; + error?: (string) | null; + readonly hasError?: boolean; + data?: { + [key: string]: unknown; + }; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_String_ = { + item?: (string) | null; + error?: (string) | null; + readonly hasError?: boolean; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type Model_From_Zendesk = string; + +/** + * Circle + */ +export type ModelCircle = { + kind: 'circle'; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: 'square'; + sideLength?: number; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string; +}; + +export type ModelWithAnyOfConstantSizeArray = [ + (number | string), + (number | string), + (number | string) +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + (number & string), + (number & string) +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + ((number) | null | string), + ((number) | null | string), + ((number) | null | string) +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + (number | _import), + (number | _import) +]; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnly = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +export type ModelWithConst = { + String?: "String"; + number?: 0; + null?: null; + withType?: "Some string"; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: (string); + }; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: boolean; +}; + +/** + * This is a simple enum with strings + */ +export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + +/** + * These are the HTTP error code enums + */ +export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +export type foo_bar_baz_qux = '3.0'; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array<(string)>; + data?: (ModelWithNestedArrayEnumsData); +}; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedCompositionEnums = { + foo?: (ModelWithNestedArrayEnumsDataFoo); +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: ('Success' | 'Warning' | 'Error'); + }; + dictionaryWithEnumFromDescription?: { + [key: string]: (number); + }; + arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; + arrayWithDescription?: Array<(number)>; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedProperties = { + readonly first: { + readonly second: { + readonly third: (string) | null; + } | null; + } | null; +}; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: (string) | null; + /** + * This is a simple string property + */ + nullableProp2?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: (string) | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Период + */ +export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; + +export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { + baz: (number) | null; + qux: number; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: Date; + foo: 'Quux'; +} | { + content: [ + (Date | string), + (Date | string) + ]; + foo: 'Corge'; +}; + +export type foo = 'Bar'; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPattern = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: Date; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + (number | string), + string +]; + +/** + * This is a model with one nested property + */ +export type ModelWithProperties = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: (string) | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +export type ModelWithReadOnlyAndWriteOnly = { + foo: string; + readonly bar: string; + baz: string; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReference = { + prop?: ModelWithProperties; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: (Array<(string | boolean)> | null); +}; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array<(string)>; +}; + +/** + * This is a reusable parameter + */ +export type ParameterSimpleParameter = string; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Parameter with illegal characters + */ +export type Parameterx_Foo_Bar = ModelWithString; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<({ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; +})>; +}; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple file + */ +export type SimpleFile = (Blob | File); + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = (string) | null; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiError.ts new file mode 100644 index 000000000..36675d288 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiError.ts @@ -0,0 +1,21 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; + +export class ApiError extends Error { + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: unknown; + public readonly request: ApiRequestOptions; + + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); + + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiRequestOptions.ts new file mode 100644 index 000000000..939a0aa4c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiRequestOptions.ts @@ -0,0 +1,21 @@ +export type ApiRequestOptions = { + readonly body?: any; + readonly cookies?: Record; + readonly errors?: Record; + readonly formData?: Record | any[] | Blob | File; + readonly headers?: Record; + readonly mediaType?: string; + readonly method: + | 'DELETE' + | 'GET' + | 'HEAD' + | 'OPTIONS' + | 'PATCH' + | 'POST' + | 'PUT'; + readonly path?: Record; + readonly query?: Record; + readonly responseHeader?: string; + readonly responseTransformer?: (data: unknown) => Promise; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiResult.ts new file mode 100644 index 000000000..4c58e3913 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiResult.ts @@ -0,0 +1,7 @@ +export type ApiResult = { + readonly body: TData; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/CancelablePromise.ts new file mode 100644 index 000000000..ccc082e8f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/CancelablePromise.ts @@ -0,0 +1,126 @@ +export class CancelError extends Error { + constructor(message: string) { + super(message); + this.name = 'CancelError'; + } + + public get isCancelled(): boolean { + return true; + } +} + +export interface OnCancel { + readonly isResolved: boolean; + readonly isRejected: boolean; + readonly isCancelled: boolean; + + (cancelHandler: () => void): void; +} + +export class CancelablePromise implements Promise { + private _isResolved: boolean; + private _isRejected: boolean; + private _isCancelled: boolean; + readonly cancelHandlers: (() => void)[]; + readonly promise: Promise; + private _resolve?: (value: T | PromiseLike) => void; + private _reject?: (reason?: unknown) => void; + + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason?: unknown) => void, + onCancel: OnCancel + ) => void + ) { + this._isResolved = false; + this._isRejected = false; + this._isCancelled = false; + this.cancelHandlers = []; + this.promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + + const onResolve = (value: T | PromiseLike): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isResolved = true; + if (this._resolve) this._resolve(value); + }; + + const onReject = (reason?: unknown): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isRejected = true; + if (this._reject) this._reject(reason); + }; + + const onCancel = (cancelHandler: () => void): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this.cancelHandlers.push(cancelHandler); + }; + + Object.defineProperty(onCancel, 'isResolved', { + get: (): boolean => this._isResolved, + }); + + Object.defineProperty(onCancel, 'isRejected', { + get: (): boolean => this._isRejected, + }); + + Object.defineProperty(onCancel, 'isCancelled', { + get: (): boolean => this._isCancelled, + }); + + return executor(onResolve, onReject, onCancel as OnCancel); + }); + } + + get [Symbol.toStringTag]() { + return "Cancellable Promise"; + } + + public then( + onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null + ): Promise { + return this.promise.then(onFulfilled, onRejected); + } + + public catch( + onRejected?: ((reason: unknown) => TResult | PromiseLike) | null + ): Promise { + return this.promise.catch(onRejected); + } + + public finally(onFinally?: (() => void) | null): Promise { + return this.promise.finally(onFinally); + } + + public cancel(): void { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isCancelled = true; + if (this.cancelHandlers.length) { + try { + for (const cancelHandler of this.cancelHandlers) { + cancelHandler(); + } + } catch (error) { + console.warn('Cancellation threw an error', error); + return; + } + } + this.cancelHandlers.length = 0; + if (this._reject) this._reject(new CancelError('Request aborted')); + } + + public get isCancelled(): boolean { + return this._isCancelled; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/OpenAPI.ts new file mode 100644 index 000000000..144e25744 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/OpenAPI.ts @@ -0,0 +1,56 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; + +type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware): void { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Middleware): void { + this._fns = [...this._fns, fn]; + } +} + +export type OpenAPIConfig = { + BASE: string; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + VERSION: string; + WITH_CREDENTIALS: boolean; + interceptors: { + request: Interceptors; + response: Interceptors; + }; +}; + +export const OpenAPI: OpenAPIConfig = { + BASE: 'http://localhost:3000/base', + CREDENTIALS: 'include', + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + TOKEN: undefined, + USERNAME: undefined, + VERSION: '1.0', + WITH_CREDENTIALS: false, + interceptors: { + request: new Interceptors(), + response: new Interceptors(), + }, +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/request.ts new file mode 100644 index 000000000..5458a2899 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/request.ts @@ -0,0 +1,350 @@ +import { ApiError } from './ApiError'; +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; +import { CancelablePromise } from './CancelablePromise'; +import type { OnCancel } from './CancelablePromise'; +import type { OpenAPIConfig } from './OpenAPI'; + +export const isString = (value: unknown): value is string => { + return typeof value === 'string'; +}; + +export const isStringWithValue = (value: unknown): value is string => { + return isString(value) && value !== ''; +}; + +export const isBlob = (value: any): value is Blob => { + return value instanceof Blob; +}; + +export const isFormData = (value: unknown): value is FormData => { + return value instanceof FormData; +}; + +export const base64 = (str: string): string => { + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } +}; + +export const getQueryString = (params: Record): string => { + const qs: string[] = []; + + const append = (key: string, value: unknown) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; + + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; + } + + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { + value.forEach(v => encodePair(key, v)); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); + } + }; + + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); + + return qs.length ? `?${qs.join('&')}` : ''; +}; + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI; + + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); + + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; +}; + +export const getFormData = (options: ApiRequestOptions): FormData | undefined => { + if (options.formData) { + const formData = new FormData(); + + const process = (key: string, value: unknown) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; + + Object.entries(options.formData) + .filter(([, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); + + return formData; + } + return undefined; +}; + +type Resolver = (options: ApiRequestOptions) => Promise; + +export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; +}; + +export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { + const [token, username, password, additionalHeaders] = await Promise.all([ + // @ts-ignore + resolve(options, config.TOKEN), + // @ts-ignore + resolve(options, config.USERNAME), + // @ts-ignore + resolve(options, config.PASSWORD), + // @ts-ignore + resolve(options, config.HEADERS), + ]); + + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + }) + .filter(([, value]) => value !== undefined && value !== null) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); + + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } + + return new Headers(headers); +}; + +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body !== undefined) { + if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { + return JSON.stringify(options.body); + } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { + return options.body; + } else { + return JSON.stringify(options.body); + } + } + return undefined; +}; + +export const sendRequest = async ( + config: OpenAPIConfig, + options: ApiRequestOptions, + url: string, + body: any, + formData: FormData | undefined, + headers: Headers, + onCancel: OnCancel +): Promise => { + const controller = new AbortController(); + + let request: RequestInit = { + headers, + body: body ?? formData, + method: options.method, + signal: controller.signal, + }; + + if (config.WITH_CREDENTIALS) { + request.credentials = config.CREDENTIALS; + } + + for (const fn of config.interceptors.request._fns) { + request = await fn(request); + } + + onCancel(() => controller.abort()); + + return await fetch(url, request); +}; + +export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { + if (responseHeader) { + const content = response.headers.get(responseHeader); + if (isString(content)) { + return content; + } + } + return undefined; +}; + +export const getResponseBody = async (response: Response): Promise => { + if (response.status !== 204) { + try { + const contentType = response.headers.get('Content-Type'); + if (contentType) { + const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; + if (contentType.includes('application/json') || contentType.includes('+json')) { + return await response.json(); + } else if (binaryTypes.some(type => contentType.includes(type))) { + return await response.blob(); + } else if (contentType.includes('multipart/form-data')) { + return await response.formData(); + } else if (contentType.includes('text/')) { + return await response.text(); + } + } + } catch (error) { + console.error(error); + } + } + return undefined; +}; + +export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Payload Too Large', + 414: 'URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Range Not Satisfiable', + 417: 'Expectation Failed', + 418: 'Im a teapot', + 421: 'Misdirected Request', + 422: 'Unprocessable Content', + 423: 'Locked', + 424: 'Failed Dependency', + 425: 'Too Early', + 426: 'Upgrade Required', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', + 451: 'Unavailable For Legal Reasons', + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 508: 'Loop Detected', + 510: 'Not Extended', + 511: 'Network Authentication Required', + ...options.errors, + } + + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } + + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } +}; + +/** + * Request method + * @param config The OpenAPI configuration object + * @param options The request options from the service + * @returns CancelablePromise + * @throws ApiError + */ +export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { + return new CancelablePromise(async (resolve, reject, onCancel) => { + try { + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); + const headers = await getHeaders(config, options); + + if (!onCancel.isCancelled) { + let response = await sendRequest(config, options, url, body, formData, headers, onCancel); + + for (const fn of config.interceptors.response._fns) { + response = await fn(response); + } + + const responseBody = await getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + + let transformedBody = responseBody; + if (options.responseTransformer && response.ok) { + transformedBody = await options.responseTransformer(responseBody) + } + + const result: ApiResult = { + url, + ok: response.ok, + status: response.status, + statusText: response.statusText, + body: responseHeader ?? transformedBody, + }; + + catchErrorCodes(options, result); + + resolve(result.body); + } + } catch (error) { + reject(error); + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/index.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/index.ts new file mode 100644 index 000000000..50a1dd734 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/index.ts @@ -0,0 +1,6 @@ +// This file is auto-generated by @hey-api/openapi-ts +export { ApiError } from './core/ApiError'; +export { CancelablePromise, CancelError } from './core/CancelablePromise'; +export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/sdk.gen.ts new file mode 100644 index 000000000..f62288bcf --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/sdk.gen.ts @@ -0,0 +1,913 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CancelablePromise } from './core/CancelablePromise'; +import { OpenAPI } from './core/OpenAPI'; +import { request as __request } from './core/request'; +import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; + +export class CollectionFormatService { + /** + * @param data The data for the request. + * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) + * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) + * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) + * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) + * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) + * @throws ApiError + */ + public static collectionFormat(data: CollectionFormatData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/collectionFormat', + query: { + parameterArrayCSV: data.parameterArrayCsv, + parameterArraySSV: data.parameterArraySsv, + parameterArrayTSV: data.parameterArrayTsv, + parameterArrayPipes: data.parameterArrayPipes, + parameterArrayMulti: data.parameterArrayMulti + } + }); + } + +} + +export class ComplexService { + /** + * @param data The data for the request. + * @param data.parameterObject Parameter containing object + * @param data.parameterReference Parameter containing reference + * @returns ModelWithString Successful response + * @throws ApiError + */ + public static complexTypes(data: ComplexTypesData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/complex', + query: { + parameterObject: data.parameterObject, + parameterReference: data.parameterReference + }, + errors: { + 400: '400 `server` error', + 500: '500 server error' + } + }); + } + + /** + * @param data The data for the request. + * @param data.id + * @param data.requestBody + * @returns ModelWithString Success + * @throws ApiError + */ + public static complexParams(data: ComplexParamsData): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/complex/{id}', + path: { + id: data.id + }, + body: data.requestBody, + mediaType: 'application/json-patch+json' + }); + } + +} + +export class DefaultService { + /** + * @throws ApiError + */ + public static export(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public static patchApiNoTag(): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @param data The data for the request. + * @param data.requestBody + * @returns Model_From_Zendesk Success + * @returns ModelWithReadOnlyAndWriteOnly Default success response + * @throws ApiError + */ + public static import(data: ImportData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/no+tag', + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public static fooWow(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @param data The data for the request. + * @param data.fooParam foo in method + * @returns number Response is a simple number + * @throws ApiError + */ + public static getApiSimpleOperation(data: GetApiSimpleOperationData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple:operation', + path: { + foo_param: data.fooParam + }, + errors: { + default: 'Default error response' + } + }); + } + +} + +export class DefaultsService { + /** + * @param data The data for the request. + * @param data.parameterString This is a simple string with default value + * @param data.parameterNumber This is a simple number with default value + * @param data.parameterBoolean This is a simple boolean with default value + * @param data.parameterEnum This is a simple enum with default value + * @param data.parameterModel This is a simple model with default value + * @throws ApiError + */ + public static callWithDefaultParameters(data: CallWithDefaultParametersData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterString This is a simple string that is optional with default value + * @param data.parameterNumber This is a simple number that is optional with default value + * @param data.parameterBoolean This is a simple boolean that is optional with default value + * @param data.parameterEnum This is a simple enum that is optional with default value + * @param data.parameterModel This is a simple model that is optional with default value + * @throws ApiError + */ + public static callWithDefaultOptionalParameters(data: CallWithDefaultOptionalParametersData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterStringWithNoDefault This is a string with no default + * @param data.parameterOptionalStringWithDefault This is a optional string with default + * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default + * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default + * @param data.parameterStringWithDefault This is a string with default + * @param data.parameterStringWithEmptyDefault This is a string with empty default + * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default + * @param data.parameterStringNullableWithDefault This is a string that can be null with default + * @throws ApiError + */ + public static callToTestOrderOfParams(data: CallToTestOrderOfParamsData): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/defaults', + query: { + parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, + parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, + parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, + parameterStringWithDefault: data.parameterStringWithDefault, + parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, + parameterStringWithNoDefault: data.parameterStringWithNoDefault, + parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, + parameterStringNullableWithDefault: data.parameterStringNullableWithDefault + } + }); + } + +} + +export class DeprecatedService { + /** + * @deprecated + * @param data The data for the request. + * @param data.parameter This parameter is deprecated + * @throws ApiError + */ + public static deprecatedCall(data: DeprecatedCallData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/deprecated', + headers: { + parameter: data.parameter + } + }); + } + +} + +export class DescriptionsService { + /** + * @param data The data for the request. + * @param data.parameterWithBreaks Testing multiline comments in string: First line + * Second line + * + * Fourth line + * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work + * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work + * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work + * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work + * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work + * @throws ApiError + */ + public static callWithDescriptions(data: CallWithDescriptionsData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/descriptions/', + query: { + parameterWithBreaks: data.parameterWithBreaks, + parameterWithBackticks: data.parameterWithBackticks, + parameterWithSlashes: data.parameterWithSlashes, + parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders, + parameterWithQuotes: data.parameterWithQuotes, + parameterWithReservedCharacters: data.parameterWithReservedCharacters + } + }); + } + +} + +export class DuplicateService { + /** + * @throws ApiError + */ + public static duplicateName(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public static duplicateName1(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public static duplicateName2(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public static duplicateName3(): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/duplicate' + }); + } + +} + +export class ErrorService { + /** + * @param data The data for the request. + * @param data.status Status code to return + * @returns unknown Custom message: Successful response + * @throws ApiError + */ + public static testErrorCode(data: TestErrorCodeData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/error', + query: { + status: data.status + }, + errors: { + 500: 'Custom message: Internal Server Error', + 501: 'Custom message: Not Implemented', + 502: 'Custom message: Bad Gateway', + 503: 'Custom message: Service Unavailable' + } + }); + } + +} + +export class FileResponseService { + /** + * @param data The data for the request. + * @param data.id + * @returns binary Success + * @throws ApiError + */ + public static fileResponse(data: FileResponseData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/file/{id}', + path: { + id: data.id + } + }); + } + +} + +export class FormDataService { + /** + * @param data The data for the request. + * @param data.parameter This is a reusable parameter + * @param data.formData A reusable request body + * @throws ApiError + */ + public static postApiFormData(data: PostApiFormDataData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/formData/', + query: { + parameter: data.parameter + }, + formData: data.formData, + mediaType: 'multipart/form-data' + }); + } + +} + +export class HeaderService { + /** + * @returns string Successful response + * @throws ApiError + */ + public static callWithResultFromHeader(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/header', + responseHeader: 'operation-location', + errors: { + 400: '400 server error', + 500: '500 server error' + } + }); + } + +} + +export class MultipartService { + /** + * @param data The data for the request. + * @param data.formData + * @throws ApiError + */ + public static multipartRequest(data: MultipartRequestData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/multipart', + formData: data.formData, + mediaType: 'multipart/form-data' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public static multipartResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multipart' + }); + } + +} + +export class MultipleTags1Service { + /** + * @returns _400 + * @throws ApiError + */ + public static dummyA(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/a' + }); + } + + /** + * @returns void Success + * @throws ApiError + */ + public static dummyB(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class MultipleTags2Service { + /** + * @returns _400 + * @throws ApiError + */ + public static dummyA(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/a' + }); + } + + /** + * @returns void Success + * @throws ApiError + */ + public static dummyB(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class MultipleTags3Service { + /** + * @returns void Success + * @throws ApiError + */ + public static dummyB(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class NoContentService { + /** + * @returns void Success + * @throws ApiError + */ + public static callWithNoContentResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/no-content' + }); + } + + /** + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public static callWithResponseAndNoContentResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/response-and-no-content' + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + /** + * @param data The data for the request. + * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param + * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response + * @throws ApiError + */ + public static nonAsciiæøåÆøÅöôêÊ字符串(data: NonAsciiæøåÆøÅöôêÊ字符串Data): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + query: { + 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ + } + }); + } + + /** + * Login User + * @param data The data for the request. + * @param data.formData + * @throws ApiError + */ + public static putWithFormUrlEncoded(data: PutWithFormUrlEncodedData): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + formData: data.formData, + mediaType: 'application/x-www-form-urlencoded' + }); + } + +} + +export class ParametersService { + /** + * @param data The data for the request. + * @param data.fooParam foo in method + * @param data.barParam bar in method + * @param data.xFooBar Parameter with illegal characters + * @throws ApiError + */ + public static deleteFoo(data: DeleteFooData3): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + path: { + foo_param: data.fooParam, + BarParam: data.barParam + }, + headers: { + 'x-Foo-Bar': data.xFooBar + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the header + * @param data.fooAllOfEnum + * @param data.cursor This is the parameter that goes into the query params + * @param data.parameterCookie This is the parameter that goes into the cookie + * @param data.parameterPath This is the parameter that goes into the path + * @param data.requestBody This is the parameter that goes into the body + * @param data.fooRefEnum + * @throws ApiError + */ + public static callWithParameters(data: CallWithParametersData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/{parameterPath}', + path: { + parameterPath: data.parameterPath + }, + cookies: { + parameterCookie: data.parameterCookie + }, + headers: { + parameterHeader: data.parameterHeader + }, + query: { + foo_ref_enum: data.fooRefEnum, + foo_all_of_enum: data.fooAllOfEnum, + cursor: data.cursor + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the request header + * @param data.parameterQuery This is the parameter that goes into the request query params + * @param data.parameterCookie This is the parameter that goes into the cookie + * @param data.requestBody This is the parameter that goes into the body + * @param data.parameterPath1 This is the parameter that goes into the path + * @param data.parameterPath2 This is the parameter that goes into the path + * @param data.parameterPath3 This is the parameter that goes into the path + * @param data._default This is the parameter with a reserved keyword + * @throws ApiError + */ + public static callWithWeirdParameterNames(data: CallWithWeirdParameterNamesData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + path: { + 'parameter.path.1': data.parameterPath1, + 'parameter-path-2': data.parameterPath2, + 'PARAMETER-PATH-3': data.parameterPath3 + }, + cookies: { + 'PARAMETER-COOKIE': data.parameterCookie + }, + headers: { + 'parameter.header': data.parameterHeader + }, + query: { + default: data._default, + 'parameter-query': data.parameterQuery + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.requestBody This is a required parameter + * @param data.page This is an optional parameter + * @throws ApiError + */ + public static getCallWithOptionalParam(data: GetCallWithOptionalParamData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/parameters/', + query: { + page: data.page + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.parameter This is a required parameter + * @param data.requestBody This is an optional parameter + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public static postCallWithOptionalParam(data: PostCallWithOptionalParamData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/', + query: { + parameter: data.parameter + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + +} + +export class RequestBodyService { + /** + * @param data The data for the request. + * @param data.parameter This is a reusable parameter + * @param data.foo A reusable request body + * @throws ApiError + */ + public static postApiRequestBody(data: PostApiRequestBodyData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/requestBody/', + query: { + parameter: data.parameter + }, + body: data.foo, + mediaType: 'application/json' + }); + } + +} + +export class ResponseService { + /** + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public static callWithResponseAndNoContentResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/response-and-no-content' + }); + } + + /** + * @returns import + * @throws ApiError + */ + public static callWithResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/response' + }); + } + + /** + * @returns unknown Message for 200 response + * @returns ModelWithString Message for 201 response + * @returns ModelWithString Message for 202 response + * @throws ApiError + */ + public static callWithDuplicateResponses(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/response', + errors: { + 500: 'Message for 500 error', + 501: 'Message for 501 error', + 502: 'Message for 502 error', + '4XX': 'Message for 4XX errors', + default: 'Default error response' + } + }); + } + + /** + * @returns unknown Message for 200 response + * @returns ModelThatExtends Message for 201 response + * @returns ModelThatExtendsExtends Message for 202 response + * @throws ApiError + */ + public static callWithResponses(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/response', + errors: { + 500: 'Message for 500 error', + 501: 'Message for 501 error', + 502: 'Message for 502 error', + default: 'Message for default response' + } + }); + } + +} + +export class SimpleService { + /** + * @returns Model_From_Zendesk Success + * @throws ApiError + */ + public static apiVVersionODataControllerCount(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple/$count' + }); + } + + /** + * @throws ApiError + */ + public static getCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static putCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static postCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static deleteCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static optionsCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'OPTIONS', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static headCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'HEAD', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static patchCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v{api-version}/simple' + }); + } + +} + +export class TypesService { + /** + * @param data The data for the request. + * @param data.parameterArray This is an array parameter + * @param data.parameterDictionary This is a dictionary parameter + * @param data.parameterEnum This is an enum parameter + * @param data.parameterTuple This is tuple parameter + * @param data.parameterNumber This is a number parameter + * @param data.parameterString This is a string parameter + * @param data.parameterBoolean This is a boolean parameter + * @param data.parameterObject This is an object parameter + * @param data.id This is a number parameter + * @returns number Response is a simple number + * @returns string Response is a simple string + * @returns boolean Response is a simple boolean + * @returns unknown Response is a simple object + * @throws ApiError + */ + public static types(data: TypesData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/types', + path: { + id: data.id + }, + query: { + parameterNumber: data.parameterNumber, + parameterString: data.parameterString, + parameterBoolean: data.parameterBoolean, + parameterObject: data.parameterObject, + parameterArray: data.parameterArray, + parameterDictionary: data.parameterDictionary, + parameterEnum: data.parameterEnum, + parameterTuple: data.parameterTuple + } + }); + } + +} + +export class UploadService { + /** + * @param data The data for the request. + * @param data.formData + * @returns boolean + * @throws ApiError + */ + public static uploadFile(data: UploadFileData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/upload', + formData: data.formData, + mediaType: 'application/x-www-form-urlencoded' + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/types.gen.ts new file mode 100644 index 000000000..1cdfa295c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/types.gen.ts @@ -0,0 +1,1493 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export enum _3e_num_1Период { + BIRD = 'Bird', + DOG = 'Dog' +} + +/** + * Model with number-only name + */ +export type _400 = string; + +export type _default = { + name?: string; +}; + +/** + * Model with restricted keyword name + */ +export type _import = string; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: (number) | undefined; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AnyOfAnyAndNull = { + data?: (unknown | null); +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<({ + foo?: string; +} | { + bar?: string; +})>; +}; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<({ + foo?: string; +} | { + bar?: string; +})>; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array<(boolean)>; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array<(number)>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: camelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array<(string)>; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type camelCaseCommentWithBreaks = number; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + firstName: string; + lastname: string; + age: number; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: (({ + boolean?: boolean; +} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: (Array<(_3e_num_1Период | ConstValue)> | null); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(number | string)>; +}); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: ParameterSimpleParameter; +} | { + bar: NonAsciiStringæøåÆØÅöôêÊ字符串; +}) & { + baz: (number) | null; + qux: number; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(boolean)>; +}); +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: (boolean | { + [key: string]: (number); +}); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; + +export type ConstValue = "ConstValue"; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: (string); + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: (string | number | boolean) | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: (string); +}; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export enum EnumWithExtensions { + /** + * Used when the status of something is successful + */ + CUSTOM_SUCCESS = 200, + /** + * Used when the status of something has a warning + */ + CUSTOM_WARNING = 400, + /** + * Used when the status of something has an error + */ + CUSTOM_ERROR = 500 +} + +/** + * This is a simple enum with numbers + */ +export enum EnumWithNumbers { + '_1' = 1, + '_2' = 2, + '_3' = 3, + '_1.1' = 1.1, + '_1.2' = 1.2, + '_1.3' = 1.3, + '_100' = 100, + '_200' = 200, + '_300' = 300, + '_-100' = -100, + '_-200' = -200, + '_-300' = -300, + '_-1.1' = -1.1, + '_-1.2' = -1.2, + '_-1.3' = -1.3 +} + +export enum EnumWithReplacedCharacters { + _SINGLE_QUOTE_ = "'Single Quote'", + _DOUBLE_QUOTES_ = '"Double Quotes"', + ØÆÅÔÖ_ØÆÅÔÖ字符串 = 'øæåôöØÆÅÔÖ字符串', + '_3.1' = 3.1, + EMPTY_STRING = '' +} + +/** + * This is a simple enum with strings + */ +export enum EnumWithStrings { + SUCCESS = 'Success', + WARNING = 'Warning', + ERROR = 'Error', + _SINGLE_QUOTE_ = "'Single Quote'", + _DOUBLE_QUOTES_ = '"Double Quotes"', + NON_ASCII__ØÆÅÔÖ_ØÆÅÔÖ字符串 = 'Non-ascii: øæåôöØÆÅÔÖ字符串' +} + +export enum EnumWithXEnumNames { + zero = 0, + one = 1, + two = 2 +} + +export type File = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { + item?: boolean; + error?: (string) | null; + readonly hasError?: boolean; + data?: { + [key: string]: unknown; + }; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_String_ = { + item?: (string) | null; + error?: (string) | null; + readonly hasError?: boolean; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type Model_From_Zendesk = string; + +/** + * Circle + */ +export type ModelCircle = { + kind: 'circle'; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: 'square'; + sideLength?: number; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string; +}; + +export type ModelWithAnyOfConstantSizeArray = [ + (number | string), + (number | string), + (number | string) +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + (number & string), + (number & string) +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + ((number) | null | string), + ((number) | null | string), + ((number) | null | string) +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + (number | _import), + (number | _import) +]; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnly = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +export type ModelWithConst = { + String?: "String"; + number?: 0; + null?: null; + withType?: "Some string"; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: (string); + }; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: boolean; +}; + +/** + * This is a simple enum with strings + */ +export enum foo_bar_enum { + SUCCESS = 'Success', + WARNING = 'Warning', + ERROR = 'Error', + ØÆÅ字符串 = 'ØÆÅ字符串' +} + +/** + * These are the HTTP error code enums + */ +export enum statusCode { + _100 = '100', + _200_FOO = '200 FOO', + _300_FOO_BAR = '300 FOO_BAR', + _400_FOO_BAR = '400 foo-bar', + _500_FOO_BAR = '500 foo.bar', + _600_FOO_BAR = '600 foo&bar' +} + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +export enum foo_bar_baz_qux { + _3_0 = '3.0' +} + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array<(string)>; + data?: (ModelWithNestedArrayEnumsData); +}; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export enum ModelWithNestedArrayEnumsDataBar { + BAZ = 'baz', + QUX = 'qux' +} + +export enum ModelWithNestedArrayEnumsDataFoo { + FOO = 'foo', + BAR = 'bar' +} + +export type ModelWithNestedCompositionEnums = { + foo?: (ModelWithNestedArrayEnumsDataFoo); +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: ('Success' | 'Warning' | 'Error'); + }; + dictionaryWithEnumFromDescription?: { + [key: string]: (number); + }; + arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; + arrayWithDescription?: Array<(number)>; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedProperties = { + readonly first: { + readonly second: { + readonly third: (string) | null; + } | null; + } | null; +}; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: (string) | null; + /** + * This is a simple string property + */ + nullableProp2?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: (string) | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Период + */ +export enum value { + '_-10' = -10, + '_-1' = -1, + '_0' = 0, + '_1' = 1, + '_3' = 3, + '_6' = 6, + '_12' = 12 +} + +export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { + baz: (number) | null; + qux: number; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + (string), + (string) + ]; + foo: 'Corge'; +}; + +export enum foo { + BAR = 'Bar' +} + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPattern = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + (number | string), + string +]; + +/** + * This is a model with one nested property + */ +export type ModelWithProperties = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: (string) | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +export type ModelWithReadOnlyAndWriteOnly = { + foo: string; + readonly bar: string; + baz: string; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReference = { + prop?: ModelWithProperties; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: (Array<(string | boolean)> | null); +}; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array<(string)>; +}; + +/** + * This is a reusable parameter + */ +export type ParameterSimpleParameter = string; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Parameter with illegal characters + */ +export type Parameterx_Foo_Bar = ModelWithString; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<({ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; +})>; +}; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple file + */ +export type SimpleFile = (Blob | File); + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = (string) | null; + +export type CollectionFormatData = { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCsv: Array<(string)> | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array<(string)> | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array<(string)> | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySsv: Array<(string)> | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTsv: Array<(string)> | null; +}; + +export type ComplexTypesData = { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; +}; + +export type ComplexTypesResponse = (Array); + +export type ComplexParamsData = { + id: number; + requestBody?: { + readonly key: (string) | null; + name: (string) | null; + enabled?: boolean; + readonly type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array<(string)> | null; + parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); + readonly user?: { + readonly id?: number; + readonly name?: (string) | null; + }; + }; +}; + +export type ComplexParamsResponse = (ModelWithString); + +export type PatchApiNoTagResponse = (unknown); + +export type ImportData = { + requestBody: (ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly); +}; + +export type ImportResponse = (Model_From_Zendesk | ModelWithReadOnlyAndWriteOnly); + +export type FooWowResponse = (unknown); + +export type GetApiSimpleOperationData = { + /** + * foo in method + */ + fooParam: string; +}; + +export type GetApiSimpleOperationResponse = (number); + +export type CallWithDefaultParametersData = { + /** + * This is a simple boolean with default value + */ + parameterBoolean?: (boolean) | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: (ModelWithString) | null; + /** + * This is a simple number with default value + */ + parameterNumber?: (number) | null; + /** + * This is a simple string with default value + */ + parameterString?: (string) | null; +}; + +export type CallWithDefaultOptionalParametersData = { + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; +}; + +export type CallToTestOrderOfParamsData = { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: (string) | null; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: (string) | null; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; +}; + +export type DeprecatedCallData = { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: (DeprecatedModel) | null; +}; + +export type CallWithDescriptionsData = { + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: unknown; + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: unknown; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: unknown; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: unknown; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: unknown; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: unknown; +}; + +export type TestErrorCodeData = { + /** + * Status code to return + */ + status: number; +}; + +export type TestErrorCodeResponse = (unknown); + +export type FileResponseData = { + id: string; +}; + +export type FileResponseResponse = ((Blob | File)); + +export type PostApiFormDataData = { + /** + * A reusable request body + */ + formData?: ModelWithString; + /** + * This is a reusable parameter + */ + parameter?: string; +}; + +export type CallWithResultFromHeaderResponse = (string); + +export type MultipartRequestData = { + formData?: { + content?: (Blob | File); + data?: ((ModelWithString) | null); + }; +}; + +export type MultipartResponseResponse = ({ + file?: (Blob | File); + metadata?: { + foo?: string; + bar?: string; + }; +}); + +export type DummyAResponse = (_400); + +export type DummyBResponse = (void); + +export type CallWithNoContentResponseResponse = (void); + +export type CallWithResponseAndNoContentResponseResponse = (number | void); + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + /** + * Dummy input param + */ + nonAsciiParamæøåÆøÅöôêÊ: number; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = (Array); + +export type PutWithFormUrlEncodedData = { + formData: ArrayWithStrings; +}; + +export type DeleteFooData3 = { + /** + * bar in method + */ + barParam: string; + /** + * foo in method + */ + fooParam: string; + /** + * Parameter with illegal characters + */ + xFooBar: ModelWithString; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the query params + */ + cursor: (string) | null; + fooAllOfEnum: (ModelWithNestedArrayEnumsDataFoo); + fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the cookie + */ + parameterCookie: (string) | null; + /** + * This is the parameter that goes into the header + */ + parameterHeader: (string) | null; + /** + * This is the parameter that goes into the path + */ + parameterPath: (string) | null; + /** + * This is the parameter that goes into the body + */ + requestBody: { + [key: string]: unknown; + } | null; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter with a reserved keyword + */ + _default?: string; + /** + * This is the parameter that goes into the cookie + */ + parameterCookie: (string) | null; + /** + * This is the parameter that goes into the request header + */ + parameterHeader: (string) | null; + /** + * This is the parameter that goes into the path + */ + parameterPath1?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath2?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath3?: string; + /** + * This is the parameter that goes into the request query params + */ + parameterQuery: (string) | null; + /** + * This is the parameter that goes into the body + */ + requestBody: (ModelWithString) | null; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + page?: number; + /** + * This is a required parameter + */ + requestBody: ModelWithOneOfEnum; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is a required parameter + */ + parameter: Pageable; + /** + * This is an optional parameter + */ + requestBody?: { + offset?: (number) | null; + }; +}; + +export type PostCallWithOptionalParamResponse = (number | void); + +export type PostApiRequestBodyData = { + /** + * A reusable request body + */ + foo?: ModelWithString; + /** + * This is a reusable parameter + */ + parameter?: string; +}; + +export type CallWithResponseResponse = (_import); + +export type CallWithDuplicateResponsesResponse = ((ModelWithBoolean & ModelWithInteger) | ModelWithString); + +export type CallWithResponsesResponse = ({ + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; +} | ModelThatExtends | ModelThatExtendsExtends); + +export type ApiVVersionODataControllerCountResponse = (Model_From_Zendesk); + +export type TypesData = { + /** + * This is a number parameter + */ + id?: number; + /** + * This is an array parameter + */ + parameterArray: Array<(string)> | null; + /** + * This is a boolean parameter + */ + parameterBoolean: (boolean) | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: ('Success' | 'Warning' | 'Error') | null; + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is a string parameter + */ + parameterString: (string) | null; + /** + * This is tuple parameter + */ + parameterTuple: [ + number, + number, + number, + number + ]; +}; + +export type TypesResponse = (number | string | boolean | { + [key: string]: unknown; +}); + +export type UploadFileData = { + formData: (Blob | File); +}; + +export type UploadFileResponse = (boolean); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiError.ts new file mode 100644 index 000000000..36675d288 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiError.ts @@ -0,0 +1,21 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; + +export class ApiError extends Error { + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: unknown; + public readonly request: ApiRequestOptions; + + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); + + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiRequestOptions.ts new file mode 100644 index 000000000..939a0aa4c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiRequestOptions.ts @@ -0,0 +1,21 @@ +export type ApiRequestOptions = { + readonly body?: any; + readonly cookies?: Record; + readonly errors?: Record; + readonly formData?: Record | any[] | Blob | File; + readonly headers?: Record; + readonly mediaType?: string; + readonly method: + | 'DELETE' + | 'GET' + | 'HEAD' + | 'OPTIONS' + | 'PATCH' + | 'POST' + | 'PUT'; + readonly path?: Record; + readonly query?: Record; + readonly responseHeader?: string; + readonly responseTransformer?: (data: unknown) => Promise; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiResult.ts new file mode 100644 index 000000000..4c58e3913 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiResult.ts @@ -0,0 +1,7 @@ +export type ApiResult = { + readonly body: TData; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/CancelablePromise.ts new file mode 100644 index 000000000..ccc082e8f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/CancelablePromise.ts @@ -0,0 +1,126 @@ +export class CancelError extends Error { + constructor(message: string) { + super(message); + this.name = 'CancelError'; + } + + public get isCancelled(): boolean { + return true; + } +} + +export interface OnCancel { + readonly isResolved: boolean; + readonly isRejected: boolean; + readonly isCancelled: boolean; + + (cancelHandler: () => void): void; +} + +export class CancelablePromise implements Promise { + private _isResolved: boolean; + private _isRejected: boolean; + private _isCancelled: boolean; + readonly cancelHandlers: (() => void)[]; + readonly promise: Promise; + private _resolve?: (value: T | PromiseLike) => void; + private _reject?: (reason?: unknown) => void; + + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason?: unknown) => void, + onCancel: OnCancel + ) => void + ) { + this._isResolved = false; + this._isRejected = false; + this._isCancelled = false; + this.cancelHandlers = []; + this.promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + + const onResolve = (value: T | PromiseLike): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isResolved = true; + if (this._resolve) this._resolve(value); + }; + + const onReject = (reason?: unknown): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isRejected = true; + if (this._reject) this._reject(reason); + }; + + const onCancel = (cancelHandler: () => void): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this.cancelHandlers.push(cancelHandler); + }; + + Object.defineProperty(onCancel, 'isResolved', { + get: (): boolean => this._isResolved, + }); + + Object.defineProperty(onCancel, 'isRejected', { + get: (): boolean => this._isRejected, + }); + + Object.defineProperty(onCancel, 'isCancelled', { + get: (): boolean => this._isCancelled, + }); + + return executor(onResolve, onReject, onCancel as OnCancel); + }); + } + + get [Symbol.toStringTag]() { + return "Cancellable Promise"; + } + + public then( + onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null + ): Promise { + return this.promise.then(onFulfilled, onRejected); + } + + public catch( + onRejected?: ((reason: unknown) => TResult | PromiseLike) | null + ): Promise { + return this.promise.catch(onRejected); + } + + public finally(onFinally?: (() => void) | null): Promise { + return this.promise.finally(onFinally); + } + + public cancel(): void { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isCancelled = true; + if (this.cancelHandlers.length) { + try { + for (const cancelHandler of this.cancelHandlers) { + cancelHandler(); + } + } catch (error) { + console.warn('Cancellation threw an error', error); + return; + } + } + this.cancelHandlers.length = 0; + if (this._reject) this._reject(new CancelError('Request aborted')); + } + + public get isCancelled(): boolean { + return this._isCancelled; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/OpenAPI.ts new file mode 100644 index 000000000..144e25744 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/OpenAPI.ts @@ -0,0 +1,56 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; + +type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware): void { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Middleware): void { + this._fns = [...this._fns, fn]; + } +} + +export type OpenAPIConfig = { + BASE: string; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + VERSION: string; + WITH_CREDENTIALS: boolean; + interceptors: { + request: Interceptors; + response: Interceptors; + }; +}; + +export const OpenAPI: OpenAPIConfig = { + BASE: 'http://localhost:3000/base', + CREDENTIALS: 'include', + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + TOKEN: undefined, + USERNAME: undefined, + VERSION: '1.0', + WITH_CREDENTIALS: false, + interceptors: { + request: new Interceptors(), + response: new Interceptors(), + }, +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/request.ts new file mode 100644 index 000000000..5458a2899 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/request.ts @@ -0,0 +1,350 @@ +import { ApiError } from './ApiError'; +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; +import { CancelablePromise } from './CancelablePromise'; +import type { OnCancel } from './CancelablePromise'; +import type { OpenAPIConfig } from './OpenAPI'; + +export const isString = (value: unknown): value is string => { + return typeof value === 'string'; +}; + +export const isStringWithValue = (value: unknown): value is string => { + return isString(value) && value !== ''; +}; + +export const isBlob = (value: any): value is Blob => { + return value instanceof Blob; +}; + +export const isFormData = (value: unknown): value is FormData => { + return value instanceof FormData; +}; + +export const base64 = (str: string): string => { + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } +}; + +export const getQueryString = (params: Record): string => { + const qs: string[] = []; + + const append = (key: string, value: unknown) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; + + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; + } + + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { + value.forEach(v => encodePair(key, v)); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); + } + }; + + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); + + return qs.length ? `?${qs.join('&')}` : ''; +}; + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI; + + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); + + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; +}; + +export const getFormData = (options: ApiRequestOptions): FormData | undefined => { + if (options.formData) { + const formData = new FormData(); + + const process = (key: string, value: unknown) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; + + Object.entries(options.formData) + .filter(([, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); + + return formData; + } + return undefined; +}; + +type Resolver = (options: ApiRequestOptions) => Promise; + +export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; +}; + +export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { + const [token, username, password, additionalHeaders] = await Promise.all([ + // @ts-ignore + resolve(options, config.TOKEN), + // @ts-ignore + resolve(options, config.USERNAME), + // @ts-ignore + resolve(options, config.PASSWORD), + // @ts-ignore + resolve(options, config.HEADERS), + ]); + + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + }) + .filter(([, value]) => value !== undefined && value !== null) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); + + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } + + return new Headers(headers); +}; + +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body !== undefined) { + if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { + return JSON.stringify(options.body); + } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { + return options.body; + } else { + return JSON.stringify(options.body); + } + } + return undefined; +}; + +export const sendRequest = async ( + config: OpenAPIConfig, + options: ApiRequestOptions, + url: string, + body: any, + formData: FormData | undefined, + headers: Headers, + onCancel: OnCancel +): Promise => { + const controller = new AbortController(); + + let request: RequestInit = { + headers, + body: body ?? formData, + method: options.method, + signal: controller.signal, + }; + + if (config.WITH_CREDENTIALS) { + request.credentials = config.CREDENTIALS; + } + + for (const fn of config.interceptors.request._fns) { + request = await fn(request); + } + + onCancel(() => controller.abort()); + + return await fetch(url, request); +}; + +export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { + if (responseHeader) { + const content = response.headers.get(responseHeader); + if (isString(content)) { + return content; + } + } + return undefined; +}; + +export const getResponseBody = async (response: Response): Promise => { + if (response.status !== 204) { + try { + const contentType = response.headers.get('Content-Type'); + if (contentType) { + const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; + if (contentType.includes('application/json') || contentType.includes('+json')) { + return await response.json(); + } else if (binaryTypes.some(type => contentType.includes(type))) { + return await response.blob(); + } else if (contentType.includes('multipart/form-data')) { + return await response.formData(); + } else if (contentType.includes('text/')) { + return await response.text(); + } + } + } catch (error) { + console.error(error); + } + } + return undefined; +}; + +export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Payload Too Large', + 414: 'URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Range Not Satisfiable', + 417: 'Expectation Failed', + 418: 'Im a teapot', + 421: 'Misdirected Request', + 422: 'Unprocessable Content', + 423: 'Locked', + 424: 'Failed Dependency', + 425: 'Too Early', + 426: 'Upgrade Required', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', + 451: 'Unavailable For Legal Reasons', + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 508: 'Loop Detected', + 510: 'Not Extended', + 511: 'Network Authentication Required', + ...options.errors, + } + + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } + + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } +}; + +/** + * Request method + * @param config The OpenAPI configuration object + * @param options The request options from the service + * @returns CancelablePromise + * @throws ApiError + */ +export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { + return new CancelablePromise(async (resolve, reject, onCancel) => { + try { + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); + const headers = await getHeaders(config, options); + + if (!onCancel.isCancelled) { + let response = await sendRequest(config, options, url, body, formData, headers, onCancel); + + for (const fn of config.interceptors.response._fns) { + response = await fn(response); + } + + const responseBody = await getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + + let transformedBody = responseBody; + if (options.responseTransformer && response.ok) { + transformedBody = await options.responseTransformer(responseBody) + } + + const result: ApiResult = { + url, + ok: response.ok, + status: response.status, + statusText: response.statusText, + body: responseHeader ?? transformedBody, + }; + + catchErrorCodes(options, result); + + resolve(result.body); + } + } catch (error) { + reject(error); + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/index.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/index.ts new file mode 100644 index 000000000..50a1dd734 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/index.ts @@ -0,0 +1,6 @@ +// This file is auto-generated by @hey-api/openapi-ts +export { ApiError } from './core/ApiError'; +export { CancelablePromise, CancelError } from './core/CancelablePromise'; +export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/sdk.gen.ts new file mode 100644 index 000000000..f62288bcf --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/sdk.gen.ts @@ -0,0 +1,913 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CancelablePromise } from './core/CancelablePromise'; +import { OpenAPI } from './core/OpenAPI'; +import { request as __request } from './core/request'; +import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; + +export class CollectionFormatService { + /** + * @param data The data for the request. + * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) + * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) + * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) + * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) + * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) + * @throws ApiError + */ + public static collectionFormat(data: CollectionFormatData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/collectionFormat', + query: { + parameterArrayCSV: data.parameterArrayCsv, + parameterArraySSV: data.parameterArraySsv, + parameterArrayTSV: data.parameterArrayTsv, + parameterArrayPipes: data.parameterArrayPipes, + parameterArrayMulti: data.parameterArrayMulti + } + }); + } + +} + +export class ComplexService { + /** + * @param data The data for the request. + * @param data.parameterObject Parameter containing object + * @param data.parameterReference Parameter containing reference + * @returns ModelWithString Successful response + * @throws ApiError + */ + public static complexTypes(data: ComplexTypesData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/complex', + query: { + parameterObject: data.parameterObject, + parameterReference: data.parameterReference + }, + errors: { + 400: '400 `server` error', + 500: '500 server error' + } + }); + } + + /** + * @param data The data for the request. + * @param data.id + * @param data.requestBody + * @returns ModelWithString Success + * @throws ApiError + */ + public static complexParams(data: ComplexParamsData): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/complex/{id}', + path: { + id: data.id + }, + body: data.requestBody, + mediaType: 'application/json-patch+json' + }); + } + +} + +export class DefaultService { + /** + * @throws ApiError + */ + public static export(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public static patchApiNoTag(): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @param data The data for the request. + * @param data.requestBody + * @returns Model_From_Zendesk Success + * @returns ModelWithReadOnlyAndWriteOnly Default success response + * @throws ApiError + */ + public static import(data: ImportData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/no+tag', + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public static fooWow(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @param data The data for the request. + * @param data.fooParam foo in method + * @returns number Response is a simple number + * @throws ApiError + */ + public static getApiSimpleOperation(data: GetApiSimpleOperationData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple:operation', + path: { + foo_param: data.fooParam + }, + errors: { + default: 'Default error response' + } + }); + } + +} + +export class DefaultsService { + /** + * @param data The data for the request. + * @param data.parameterString This is a simple string with default value + * @param data.parameterNumber This is a simple number with default value + * @param data.parameterBoolean This is a simple boolean with default value + * @param data.parameterEnum This is a simple enum with default value + * @param data.parameterModel This is a simple model with default value + * @throws ApiError + */ + public static callWithDefaultParameters(data: CallWithDefaultParametersData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterString This is a simple string that is optional with default value + * @param data.parameterNumber This is a simple number that is optional with default value + * @param data.parameterBoolean This is a simple boolean that is optional with default value + * @param data.parameterEnum This is a simple enum that is optional with default value + * @param data.parameterModel This is a simple model that is optional with default value + * @throws ApiError + */ + public static callWithDefaultOptionalParameters(data: CallWithDefaultOptionalParametersData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterStringWithNoDefault This is a string with no default + * @param data.parameterOptionalStringWithDefault This is a optional string with default + * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default + * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default + * @param data.parameterStringWithDefault This is a string with default + * @param data.parameterStringWithEmptyDefault This is a string with empty default + * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default + * @param data.parameterStringNullableWithDefault This is a string that can be null with default + * @throws ApiError + */ + public static callToTestOrderOfParams(data: CallToTestOrderOfParamsData): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/defaults', + query: { + parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, + parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, + parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, + parameterStringWithDefault: data.parameterStringWithDefault, + parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, + parameterStringWithNoDefault: data.parameterStringWithNoDefault, + parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, + parameterStringNullableWithDefault: data.parameterStringNullableWithDefault + } + }); + } + +} + +export class DeprecatedService { + /** + * @deprecated + * @param data The data for the request. + * @param data.parameter This parameter is deprecated + * @throws ApiError + */ + public static deprecatedCall(data: DeprecatedCallData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/deprecated', + headers: { + parameter: data.parameter + } + }); + } + +} + +export class DescriptionsService { + /** + * @param data The data for the request. + * @param data.parameterWithBreaks Testing multiline comments in string: First line + * Second line + * + * Fourth line + * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work + * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work + * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work + * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work + * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work + * @throws ApiError + */ + public static callWithDescriptions(data: CallWithDescriptionsData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/descriptions/', + query: { + parameterWithBreaks: data.parameterWithBreaks, + parameterWithBackticks: data.parameterWithBackticks, + parameterWithSlashes: data.parameterWithSlashes, + parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders, + parameterWithQuotes: data.parameterWithQuotes, + parameterWithReservedCharacters: data.parameterWithReservedCharacters + } + }); + } + +} + +export class DuplicateService { + /** + * @throws ApiError + */ + public static duplicateName(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public static duplicateName1(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public static duplicateName2(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public static duplicateName3(): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/duplicate' + }); + } + +} + +export class ErrorService { + /** + * @param data The data for the request. + * @param data.status Status code to return + * @returns unknown Custom message: Successful response + * @throws ApiError + */ + public static testErrorCode(data: TestErrorCodeData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/error', + query: { + status: data.status + }, + errors: { + 500: 'Custom message: Internal Server Error', + 501: 'Custom message: Not Implemented', + 502: 'Custom message: Bad Gateway', + 503: 'Custom message: Service Unavailable' + } + }); + } + +} + +export class FileResponseService { + /** + * @param data The data for the request. + * @param data.id + * @returns binary Success + * @throws ApiError + */ + public static fileResponse(data: FileResponseData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/file/{id}', + path: { + id: data.id + } + }); + } + +} + +export class FormDataService { + /** + * @param data The data for the request. + * @param data.parameter This is a reusable parameter + * @param data.formData A reusable request body + * @throws ApiError + */ + public static postApiFormData(data: PostApiFormDataData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/formData/', + query: { + parameter: data.parameter + }, + formData: data.formData, + mediaType: 'multipart/form-data' + }); + } + +} + +export class HeaderService { + /** + * @returns string Successful response + * @throws ApiError + */ + public static callWithResultFromHeader(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/header', + responseHeader: 'operation-location', + errors: { + 400: '400 server error', + 500: '500 server error' + } + }); + } + +} + +export class MultipartService { + /** + * @param data The data for the request. + * @param data.formData + * @throws ApiError + */ + public static multipartRequest(data: MultipartRequestData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/multipart', + formData: data.formData, + mediaType: 'multipart/form-data' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public static multipartResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multipart' + }); + } + +} + +export class MultipleTags1Service { + /** + * @returns _400 + * @throws ApiError + */ + public static dummyA(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/a' + }); + } + + /** + * @returns void Success + * @throws ApiError + */ + public static dummyB(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class MultipleTags2Service { + /** + * @returns _400 + * @throws ApiError + */ + public static dummyA(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/a' + }); + } + + /** + * @returns void Success + * @throws ApiError + */ + public static dummyB(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class MultipleTags3Service { + /** + * @returns void Success + * @throws ApiError + */ + public static dummyB(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class NoContentService { + /** + * @returns void Success + * @throws ApiError + */ + public static callWithNoContentResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/no-content' + }); + } + + /** + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public static callWithResponseAndNoContentResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/response-and-no-content' + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + /** + * @param data The data for the request. + * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param + * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response + * @throws ApiError + */ + public static nonAsciiæøåÆøÅöôêÊ字符串(data: NonAsciiæøåÆøÅöôêÊ字符串Data): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + query: { + 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ + } + }); + } + + /** + * Login User + * @param data The data for the request. + * @param data.formData + * @throws ApiError + */ + public static putWithFormUrlEncoded(data: PutWithFormUrlEncodedData): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + formData: data.formData, + mediaType: 'application/x-www-form-urlencoded' + }); + } + +} + +export class ParametersService { + /** + * @param data The data for the request. + * @param data.fooParam foo in method + * @param data.barParam bar in method + * @param data.xFooBar Parameter with illegal characters + * @throws ApiError + */ + public static deleteFoo(data: DeleteFooData3): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + path: { + foo_param: data.fooParam, + BarParam: data.barParam + }, + headers: { + 'x-Foo-Bar': data.xFooBar + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the header + * @param data.fooAllOfEnum + * @param data.cursor This is the parameter that goes into the query params + * @param data.parameterCookie This is the parameter that goes into the cookie + * @param data.parameterPath This is the parameter that goes into the path + * @param data.requestBody This is the parameter that goes into the body + * @param data.fooRefEnum + * @throws ApiError + */ + public static callWithParameters(data: CallWithParametersData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/{parameterPath}', + path: { + parameterPath: data.parameterPath + }, + cookies: { + parameterCookie: data.parameterCookie + }, + headers: { + parameterHeader: data.parameterHeader + }, + query: { + foo_ref_enum: data.fooRefEnum, + foo_all_of_enum: data.fooAllOfEnum, + cursor: data.cursor + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the request header + * @param data.parameterQuery This is the parameter that goes into the request query params + * @param data.parameterCookie This is the parameter that goes into the cookie + * @param data.requestBody This is the parameter that goes into the body + * @param data.parameterPath1 This is the parameter that goes into the path + * @param data.parameterPath2 This is the parameter that goes into the path + * @param data.parameterPath3 This is the parameter that goes into the path + * @param data._default This is the parameter with a reserved keyword + * @throws ApiError + */ + public static callWithWeirdParameterNames(data: CallWithWeirdParameterNamesData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + path: { + 'parameter.path.1': data.parameterPath1, + 'parameter-path-2': data.parameterPath2, + 'PARAMETER-PATH-3': data.parameterPath3 + }, + cookies: { + 'PARAMETER-COOKIE': data.parameterCookie + }, + headers: { + 'parameter.header': data.parameterHeader + }, + query: { + default: data._default, + 'parameter-query': data.parameterQuery + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.requestBody This is a required parameter + * @param data.page This is an optional parameter + * @throws ApiError + */ + public static getCallWithOptionalParam(data: GetCallWithOptionalParamData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/parameters/', + query: { + page: data.page + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.parameter This is a required parameter + * @param data.requestBody This is an optional parameter + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public static postCallWithOptionalParam(data: PostCallWithOptionalParamData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/', + query: { + parameter: data.parameter + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + +} + +export class RequestBodyService { + /** + * @param data The data for the request. + * @param data.parameter This is a reusable parameter + * @param data.foo A reusable request body + * @throws ApiError + */ + public static postApiRequestBody(data: PostApiRequestBodyData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/requestBody/', + query: { + parameter: data.parameter + }, + body: data.foo, + mediaType: 'application/json' + }); + } + +} + +export class ResponseService { + /** + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public static callWithResponseAndNoContentResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/response-and-no-content' + }); + } + + /** + * @returns import + * @throws ApiError + */ + public static callWithResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/response' + }); + } + + /** + * @returns unknown Message for 200 response + * @returns ModelWithString Message for 201 response + * @returns ModelWithString Message for 202 response + * @throws ApiError + */ + public static callWithDuplicateResponses(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/response', + errors: { + 500: 'Message for 500 error', + 501: 'Message for 501 error', + 502: 'Message for 502 error', + '4XX': 'Message for 4XX errors', + default: 'Default error response' + } + }); + } + + /** + * @returns unknown Message for 200 response + * @returns ModelThatExtends Message for 201 response + * @returns ModelThatExtendsExtends Message for 202 response + * @throws ApiError + */ + public static callWithResponses(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/response', + errors: { + 500: 'Message for 500 error', + 501: 'Message for 501 error', + 502: 'Message for 502 error', + default: 'Message for default response' + } + }); + } + +} + +export class SimpleService { + /** + * @returns Model_From_Zendesk Success + * @throws ApiError + */ + public static apiVVersionODataControllerCount(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple/$count' + }); + } + + /** + * @throws ApiError + */ + public static getCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static putCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static postCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static deleteCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static optionsCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'OPTIONS', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static headCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'HEAD', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static patchCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v{api-version}/simple' + }); + } + +} + +export class TypesService { + /** + * @param data The data for the request. + * @param data.parameterArray This is an array parameter + * @param data.parameterDictionary This is a dictionary parameter + * @param data.parameterEnum This is an enum parameter + * @param data.parameterTuple This is tuple parameter + * @param data.parameterNumber This is a number parameter + * @param data.parameterString This is a string parameter + * @param data.parameterBoolean This is a boolean parameter + * @param data.parameterObject This is an object parameter + * @param data.id This is a number parameter + * @returns number Response is a simple number + * @returns string Response is a simple string + * @returns boolean Response is a simple boolean + * @returns unknown Response is a simple object + * @throws ApiError + */ + public static types(data: TypesData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/types', + path: { + id: data.id + }, + query: { + parameterNumber: data.parameterNumber, + parameterString: data.parameterString, + parameterBoolean: data.parameterBoolean, + parameterObject: data.parameterObject, + parameterArray: data.parameterArray, + parameterDictionary: data.parameterDictionary, + parameterEnum: data.parameterEnum, + parameterTuple: data.parameterTuple + } + }); + } + +} + +export class UploadService { + /** + * @param data The data for the request. + * @param data.formData + * @returns boolean + * @throws ApiError + */ + public static uploadFile(data: UploadFileData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/upload', + formData: data.formData, + mediaType: 'application/x-www-form-urlencoded' + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/types.gen.ts new file mode 100644 index 000000000..77f604255 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/types.gen.ts @@ -0,0 +1,1524 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export enum _3e_num_1Период { + BIRD = 'Bird', + DOG = 'Dog' +} + +/** + * Model with number-only name + */ +export type _400 = string; + +export type _default = { + name?: string; +}; + +/** + * Model with restricted keyword name + */ +export type _import = string; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: (number) | undefined; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AnyOfAnyAndNull = { + data?: (unknown | null); +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<({ + foo?: string; +} | { + bar?: string; +})>; +}; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<({ + foo?: string; +} | { + bar?: string; +})>; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array<(boolean)>; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array<(number)>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: camelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array<(string)>; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type camelCaseCommentWithBreaks = number; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + firstName: string; + lastname: string; + age: number; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: (({ + boolean?: boolean; +} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: (Array<(_3e_num_1Период | ConstValue)> | null); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(number | string)>; +}); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: ParameterSimpleParameter; +} | { + bar: NonAsciiStringæøåÆØÅöôêÊ字符串; +}) & { + baz: (number) | null; + qux: number; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(boolean)>; +}); +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: (boolean | { + [key: string]: (number); +}); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; + +export type ConstValue = "ConstValue"; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: (string); + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: (string | number | boolean) | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: (string); +}; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export enum EnumWithExtensions { + /** + * Used when the status of something is successful + */ + CUSTOM_SUCCESS = 200, + /** + * Used when the status of something has a warning + */ + CUSTOM_WARNING = 400, + /** + * Used when the status of something has an error + */ + CUSTOM_ERROR = 500 +} + +/** + * This is a simple enum with numbers + */ +export enum EnumWithNumbers { + '_1' = 1, + '_2' = 2, + '_3' = 3, + '_1.1' = 1.1, + '_1.2' = 1.2, + '_1.3' = 1.3, + '_100' = 100, + '_200' = 200, + '_300' = 300, + '_-100' = -100, + '_-200' = -200, + '_-300' = -300, + '_-1.1' = -1.1, + '_-1.2' = -1.2, + '_-1.3' = -1.3 +} + +export enum EnumWithReplacedCharacters { + _SINGLE_QUOTE_ = "'Single Quote'", + _DOUBLE_QUOTES_ = '"Double Quotes"', + ØÆÅÔÖ_ØÆÅÔÖ字符串 = 'øæåôöØÆÅÔÖ字符串', + '_3.1' = 3.1, + EMPTY_STRING = '' +} + +/** + * This is a simple enum with strings + */ +export enum EnumWithStrings { + SUCCESS = 'Success', + WARNING = 'Warning', + ERROR = 'Error', + _SINGLE_QUOTE_ = "'Single Quote'", + _DOUBLE_QUOTES_ = '"Double Quotes"', + NON_ASCII__ØÆÅÔÖ_ØÆÅÔÖ字符串 = 'Non-ascii: øæåôöØÆÅÔÖ字符串' +} + +export enum EnumWithXEnumNames { + zero = 0, + one = 1, + two = 2 +} + +export type File = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { + item?: boolean; + error?: (string) | null; + readonly hasError?: boolean; + data?: { + [key: string]: unknown; + }; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_String_ = { + item?: (string) | null; + error?: (string) | null; + readonly hasError?: boolean; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type Model_From_Zendesk = string; + +/** + * Circle + */ +export type ModelCircle = { + kind: 'circle'; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: 'square'; + sideLength?: number; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string; +}; + +export type ModelWithAnyOfConstantSizeArray = [ + (number | string), + (number | string), + (number | string) +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + (number & string), + (number & string) +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + ((number) | null | string), + ((number) | null | string), + ((number) | null | string) +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + (number | _import), + (number | _import) +]; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnly = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +export type ModelWithConst = { + String?: "String"; + number?: 0; + null?: null; + withType?: "Some string"; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: (string); + }; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: boolean; +}; + +export namespace ModelWithEnum { + /** + * This is a simple enum with strings + */ + export enum foo_bar_enum { + SUCCESS = 'Success', + WARNING = 'Warning', + ERROR = 'Error', + ØÆÅ字符串 = 'ØÆÅ字符串' + } + /** + * These are the HTTP error code enums + */ + export enum statusCode { + _100 = '100', + _200_FOO = '200 FOO', + _300_FOO_BAR = '300 FOO_BAR', + _400_FOO_BAR = '400 foo-bar', + _500_FOO_BAR = '500 foo.bar', + _600_FOO_BAR = '600 foo&bar' + } +} + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +export namespace ModelWithEnumWithHyphen { + export enum foo_bar_baz_qux { + _3_0 = '3.0' + } +} + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array<(string)>; + data?: (ModelWithNestedArrayEnumsData); +}; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export enum ModelWithNestedArrayEnumsDataBar { + BAZ = 'baz', + QUX = 'qux' +} + +export enum ModelWithNestedArrayEnumsDataFoo { + FOO = 'foo', + BAR = 'bar' +} + +export type ModelWithNestedCompositionEnums = { + foo?: (ModelWithNestedArrayEnumsDataFoo); +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: ('Success' | 'Warning' | 'Error'); + }; + dictionaryWithEnumFromDescription?: { + [key: string]: (number); + }; + arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; + arrayWithDescription?: Array<(number)>; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +export namespace ModelWithNestedEnums { + /** + * This is a simple enum with strings + */ + export enum foo_bar_enum { + SUCCESS = 'Success', + WARNING = 'Warning', + ERROR = 'Error', + ØÆÅ字符串 = 'ØÆÅ字符串' + } +} + +/** + * This is a model with one nested property + */ +export type ModelWithNestedProperties = { + readonly first: { + readonly second: { + readonly third: (string) | null; + } | null; + } | null; +}; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: (string) | null; + /** + * This is a simple string property + */ + nullableProp2?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: (string) | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +export namespace ModelWithNullableString { + /** + * This is a simple enum with strings + */ + export enum foo_bar_enum { + SUCCESS = 'Success', + WARNING = 'Warning', + ERROR = 'Error', + ØÆÅ字符串 = 'ØÆÅ字符串' + } +} + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +export namespace ModelWithNumericEnumUnion { + /** + * Период + */ + export enum value { + '_-10' = -10, + '_-1' = -1, + '_0' = 0, + '_1' = 1, + '_3' = 3, + '_6' = 6, + '_12' = 12 + } +} + +export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { + baz: (number) | null; + qux: number; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + (string), + (string) + ]; + foo: 'Corge'; +}; + +export namespace ModelWithOneOfEnum { + export enum foo { + BAR = 'Bar' + } +} + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPattern = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + (number | string), + string +]; + +/** + * This is a model with one nested property + */ +export type ModelWithProperties = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: (string) | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +export type ModelWithReadOnlyAndWriteOnly = { + foo: string; + readonly bar: string; + baz: string; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReference = { + prop?: ModelWithProperties; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: (Array<(string | boolean)> | null); +}; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array<(string)>; +}; + +/** + * This is a reusable parameter + */ +export type ParameterSimpleParameter = string; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Parameter with illegal characters + */ +export type Parameterx_Foo_Bar = ModelWithString; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<({ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; +})>; +}; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple file + */ +export type SimpleFile = (Blob | File); + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = (string) | null; + +export type CollectionFormatData = { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCsv: Array<(string)> | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array<(string)> | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array<(string)> | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySsv: Array<(string)> | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTsv: Array<(string)> | null; +}; + +export type ComplexTypesData = { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; +}; + +export type ComplexTypesResponse = (Array); + +export type ComplexParamsData = { + id: number; + requestBody?: { + readonly key: (string) | null; + name: (string) | null; + enabled?: boolean; + readonly type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array<(string)> | null; + parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); + readonly user?: { + readonly id?: number; + readonly name?: (string) | null; + }; + }; +}; + +export type ComplexParamsResponse = (ModelWithString); + +export type PatchApiNoTagResponse = (unknown); + +export type ImportData = { + requestBody: (ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly); +}; + +export type ImportResponse = (Model_From_Zendesk | ModelWithReadOnlyAndWriteOnly); + +export type FooWowResponse = (unknown); + +export type GetApiSimpleOperationData = { + /** + * foo in method + */ + fooParam: string; +}; + +export type GetApiSimpleOperationResponse = (number); + +export type CallWithDefaultParametersData = { + /** + * This is a simple boolean with default value + */ + parameterBoolean?: (boolean) | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: (ModelWithString) | null; + /** + * This is a simple number with default value + */ + parameterNumber?: (number) | null; + /** + * This is a simple string with default value + */ + parameterString?: (string) | null; +}; + +export type CallWithDefaultOptionalParametersData = { + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; +}; + +export type CallToTestOrderOfParamsData = { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: (string) | null; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: (string) | null; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; +}; + +export type DeprecatedCallData = { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: (DeprecatedModel) | null; +}; + +export type CallWithDescriptionsData = { + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: unknown; + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: unknown; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: unknown; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: unknown; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: unknown; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: unknown; +}; + +export type TestErrorCodeData = { + /** + * Status code to return + */ + status: number; +}; + +export type TestErrorCodeResponse = (unknown); + +export type FileResponseData = { + id: string; +}; + +export type FileResponseResponse = ((Blob | File)); + +export type PostApiFormDataData = { + /** + * A reusable request body + */ + formData?: ModelWithString; + /** + * This is a reusable parameter + */ + parameter?: string; +}; + +export type CallWithResultFromHeaderResponse = (string); + +export type MultipartRequestData = { + formData?: { + content?: (Blob | File); + data?: ((ModelWithString) | null); + }; +}; + +export type MultipartResponseResponse = ({ + file?: (Blob | File); + metadata?: { + foo?: string; + bar?: string; + }; +}); + +export type DummyAResponse = (_400); + +export type DummyBResponse = (void); + +export type CallWithNoContentResponseResponse = (void); + +export type CallWithResponseAndNoContentResponseResponse = (number | void); + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + /** + * Dummy input param + */ + nonAsciiParamæøåÆøÅöôêÊ: number; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = (Array); + +export type PutWithFormUrlEncodedData = { + formData: ArrayWithStrings; +}; + +export type DeleteFooData3 = { + /** + * bar in method + */ + barParam: string; + /** + * foo in method + */ + fooParam: string; + /** + * Parameter with illegal characters + */ + xFooBar: ModelWithString; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the query params + */ + cursor: (string) | null; + fooAllOfEnum: (ModelWithNestedArrayEnumsDataFoo); + fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the cookie + */ + parameterCookie: (string) | null; + /** + * This is the parameter that goes into the header + */ + parameterHeader: (string) | null; + /** + * This is the parameter that goes into the path + */ + parameterPath: (string) | null; + /** + * This is the parameter that goes into the body + */ + requestBody: { + [key: string]: unknown; + } | null; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter with a reserved keyword + */ + _default?: string; + /** + * This is the parameter that goes into the cookie + */ + parameterCookie: (string) | null; + /** + * This is the parameter that goes into the request header + */ + parameterHeader: (string) | null; + /** + * This is the parameter that goes into the path + */ + parameterPath1?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath2?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath3?: string; + /** + * This is the parameter that goes into the request query params + */ + parameterQuery: (string) | null; + /** + * This is the parameter that goes into the body + */ + requestBody: (ModelWithString) | null; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + page?: number; + /** + * This is a required parameter + */ + requestBody: ModelWithOneOfEnum; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is a required parameter + */ + parameter: Pageable; + /** + * This is an optional parameter + */ + requestBody?: { + offset?: (number) | null; + }; +}; + +export type PostCallWithOptionalParamResponse = (number | void); + +export type PostApiRequestBodyData = { + /** + * A reusable request body + */ + foo?: ModelWithString; + /** + * This is a reusable parameter + */ + parameter?: string; +}; + +export type CallWithResponseResponse = (_import); + +export type CallWithDuplicateResponsesResponse = ((ModelWithBoolean & ModelWithInteger) | ModelWithString); + +export type CallWithResponsesResponse = ({ + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; +} | ModelThatExtends | ModelThatExtendsExtends); + +export type ApiVVersionODataControllerCountResponse = (Model_From_Zendesk); + +export type TypesData = { + /** + * This is a number parameter + */ + id?: number; + /** + * This is an array parameter + */ + parameterArray: Array<(string)> | null; + /** + * This is a boolean parameter + */ + parameterBoolean: (boolean) | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: ('Success' | 'Warning' | 'Error') | null; + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is a string parameter + */ + parameterString: (string) | null; + /** + * This is tuple parameter + */ + parameterTuple: [ + number, + number, + number, + number + ]; +}; + +export type TypesResponse = (number | string | boolean | { + [key: string]: unknown; +}); + +export type UploadFileData = { + formData: (Blob | File); +}; + +export type UploadFileResponse = (boolean); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiError.ts new file mode 100644 index 000000000..36675d288 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiError.ts @@ -0,0 +1,21 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; + +export class ApiError extends Error { + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: unknown; + public readonly request: ApiRequestOptions; + + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); + + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiRequestOptions.ts new file mode 100644 index 000000000..939a0aa4c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiRequestOptions.ts @@ -0,0 +1,21 @@ +export type ApiRequestOptions = { + readonly body?: any; + readonly cookies?: Record; + readonly errors?: Record; + readonly formData?: Record | any[] | Blob | File; + readonly headers?: Record; + readonly mediaType?: string; + readonly method: + | 'DELETE' + | 'GET' + | 'HEAD' + | 'OPTIONS' + | 'PATCH' + | 'POST' + | 'PUT'; + readonly path?: Record; + readonly query?: Record; + readonly responseHeader?: string; + readonly responseTransformer?: (data: unknown) => Promise; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiResult.ts new file mode 100644 index 000000000..4c58e3913 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiResult.ts @@ -0,0 +1,7 @@ +export type ApiResult = { + readonly body: TData; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/CancelablePromise.ts new file mode 100644 index 000000000..ccc082e8f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/CancelablePromise.ts @@ -0,0 +1,126 @@ +export class CancelError extends Error { + constructor(message: string) { + super(message); + this.name = 'CancelError'; + } + + public get isCancelled(): boolean { + return true; + } +} + +export interface OnCancel { + readonly isResolved: boolean; + readonly isRejected: boolean; + readonly isCancelled: boolean; + + (cancelHandler: () => void): void; +} + +export class CancelablePromise implements Promise { + private _isResolved: boolean; + private _isRejected: boolean; + private _isCancelled: boolean; + readonly cancelHandlers: (() => void)[]; + readonly promise: Promise; + private _resolve?: (value: T | PromiseLike) => void; + private _reject?: (reason?: unknown) => void; + + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason?: unknown) => void, + onCancel: OnCancel + ) => void + ) { + this._isResolved = false; + this._isRejected = false; + this._isCancelled = false; + this.cancelHandlers = []; + this.promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + + const onResolve = (value: T | PromiseLike): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isResolved = true; + if (this._resolve) this._resolve(value); + }; + + const onReject = (reason?: unknown): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isRejected = true; + if (this._reject) this._reject(reason); + }; + + const onCancel = (cancelHandler: () => void): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this.cancelHandlers.push(cancelHandler); + }; + + Object.defineProperty(onCancel, 'isResolved', { + get: (): boolean => this._isResolved, + }); + + Object.defineProperty(onCancel, 'isRejected', { + get: (): boolean => this._isRejected, + }); + + Object.defineProperty(onCancel, 'isCancelled', { + get: (): boolean => this._isCancelled, + }); + + return executor(onResolve, onReject, onCancel as OnCancel); + }); + } + + get [Symbol.toStringTag]() { + return "Cancellable Promise"; + } + + public then( + onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null + ): Promise { + return this.promise.then(onFulfilled, onRejected); + } + + public catch( + onRejected?: ((reason: unknown) => TResult | PromiseLike) | null + ): Promise { + return this.promise.catch(onRejected); + } + + public finally(onFinally?: (() => void) | null): Promise { + return this.promise.finally(onFinally); + } + + public cancel(): void { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isCancelled = true; + if (this.cancelHandlers.length) { + try { + for (const cancelHandler of this.cancelHandlers) { + cancelHandler(); + } + } catch (error) { + console.warn('Cancellation threw an error', error); + return; + } + } + this.cancelHandlers.length = 0; + if (this._reject) this._reject(new CancelError('Request aborted')); + } + + public get isCancelled(): boolean { + return this._isCancelled; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/OpenAPI.ts new file mode 100644 index 000000000..144e25744 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/OpenAPI.ts @@ -0,0 +1,56 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; + +type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware): void { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Middleware): void { + this._fns = [...this._fns, fn]; + } +} + +export type OpenAPIConfig = { + BASE: string; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + VERSION: string; + WITH_CREDENTIALS: boolean; + interceptors: { + request: Interceptors; + response: Interceptors; + }; +}; + +export const OpenAPI: OpenAPIConfig = { + BASE: 'http://localhost:3000/base', + CREDENTIALS: 'include', + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + TOKEN: undefined, + USERNAME: undefined, + VERSION: '1.0', + WITH_CREDENTIALS: false, + interceptors: { + request: new Interceptors(), + response: new Interceptors(), + }, +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/request.ts new file mode 100644 index 000000000..5458a2899 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/request.ts @@ -0,0 +1,350 @@ +import { ApiError } from './ApiError'; +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; +import { CancelablePromise } from './CancelablePromise'; +import type { OnCancel } from './CancelablePromise'; +import type { OpenAPIConfig } from './OpenAPI'; + +export const isString = (value: unknown): value is string => { + return typeof value === 'string'; +}; + +export const isStringWithValue = (value: unknown): value is string => { + return isString(value) && value !== ''; +}; + +export const isBlob = (value: any): value is Blob => { + return value instanceof Blob; +}; + +export const isFormData = (value: unknown): value is FormData => { + return value instanceof FormData; +}; + +export const base64 = (str: string): string => { + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } +}; + +export const getQueryString = (params: Record): string => { + const qs: string[] = []; + + const append = (key: string, value: unknown) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; + + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; + } + + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { + value.forEach(v => encodePair(key, v)); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); + } + }; + + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); + + return qs.length ? `?${qs.join('&')}` : ''; +}; + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI; + + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); + + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; +}; + +export const getFormData = (options: ApiRequestOptions): FormData | undefined => { + if (options.formData) { + const formData = new FormData(); + + const process = (key: string, value: unknown) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; + + Object.entries(options.formData) + .filter(([, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); + + return formData; + } + return undefined; +}; + +type Resolver = (options: ApiRequestOptions) => Promise; + +export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; +}; + +export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { + const [token, username, password, additionalHeaders] = await Promise.all([ + // @ts-ignore + resolve(options, config.TOKEN), + // @ts-ignore + resolve(options, config.USERNAME), + // @ts-ignore + resolve(options, config.PASSWORD), + // @ts-ignore + resolve(options, config.HEADERS), + ]); + + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + }) + .filter(([, value]) => value !== undefined && value !== null) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); + + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } + + return new Headers(headers); +}; + +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body !== undefined) { + if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { + return JSON.stringify(options.body); + } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { + return options.body; + } else { + return JSON.stringify(options.body); + } + } + return undefined; +}; + +export const sendRequest = async ( + config: OpenAPIConfig, + options: ApiRequestOptions, + url: string, + body: any, + formData: FormData | undefined, + headers: Headers, + onCancel: OnCancel +): Promise => { + const controller = new AbortController(); + + let request: RequestInit = { + headers, + body: body ?? formData, + method: options.method, + signal: controller.signal, + }; + + if (config.WITH_CREDENTIALS) { + request.credentials = config.CREDENTIALS; + } + + for (const fn of config.interceptors.request._fns) { + request = await fn(request); + } + + onCancel(() => controller.abort()); + + return await fetch(url, request); +}; + +export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { + if (responseHeader) { + const content = response.headers.get(responseHeader); + if (isString(content)) { + return content; + } + } + return undefined; +}; + +export const getResponseBody = async (response: Response): Promise => { + if (response.status !== 204) { + try { + const contentType = response.headers.get('Content-Type'); + if (contentType) { + const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; + if (contentType.includes('application/json') || contentType.includes('+json')) { + return await response.json(); + } else if (binaryTypes.some(type => contentType.includes(type))) { + return await response.blob(); + } else if (contentType.includes('multipart/form-data')) { + return await response.formData(); + } else if (contentType.includes('text/')) { + return await response.text(); + } + } + } catch (error) { + console.error(error); + } + } + return undefined; +}; + +export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Payload Too Large', + 414: 'URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Range Not Satisfiable', + 417: 'Expectation Failed', + 418: 'Im a teapot', + 421: 'Misdirected Request', + 422: 'Unprocessable Content', + 423: 'Locked', + 424: 'Failed Dependency', + 425: 'Too Early', + 426: 'Upgrade Required', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', + 451: 'Unavailable For Legal Reasons', + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 508: 'Loop Detected', + 510: 'Not Extended', + 511: 'Network Authentication Required', + ...options.errors, + } + + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } + + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } +}; + +/** + * Request method + * @param config The OpenAPI configuration object + * @param options The request options from the service + * @returns CancelablePromise + * @throws ApiError + */ +export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { + return new CancelablePromise(async (resolve, reject, onCancel) => { + try { + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); + const headers = await getHeaders(config, options); + + if (!onCancel.isCancelled) { + let response = await sendRequest(config, options, url, body, formData, headers, onCancel); + + for (const fn of config.interceptors.response._fns) { + response = await fn(response); + } + + const responseBody = await getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + + let transformedBody = responseBody; + if (options.responseTransformer && response.ok) { + transformedBody = await options.responseTransformer(responseBody) + } + + const result: ApiResult = { + url, + ok: response.ok, + status: response.status, + statusText: response.statusText, + body: responseHeader ?? transformedBody, + }; + + catchErrorCodes(options, result); + + resolve(result.body); + } + } catch (error) { + reject(error); + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/index.ts b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/index.ts new file mode 100644 index 000000000..50a1dd734 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/index.ts @@ -0,0 +1,6 @@ +// This file is auto-generated by @hey-api/openapi-ts +export { ApiError } from './core/ApiError'; +export { CancelablePromise, CancelError } from './core/CancelablePromise'; +export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/sdk.gen.ts new file mode 100644 index 000000000..6856f018b --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/sdk.gen.ts @@ -0,0 +1,85 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CancelablePromise } from './core/CancelablePromise'; +import { OpenAPI } from './core/OpenAPI'; +import { request as __request } from './core/request'; +import type { CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData } from './types.gen'; + +export class DefaultsService { + /** + * @param parameterString This is a simple string with default value + * @param parameterNumber This is a simple number with default value + * @param parameterBoolean This is a simple boolean with default value + * @param parameterEnum This is a simple enum with default value + * @param parameterModel This is a simple model with default value + * @throws ApiError + */ + public static callWithDefaultParameters(parameterString: CallWithDefaultParametersData['parameterString'] = 'Hello World!', parameterNumber: CallWithDefaultParametersData['parameterNumber'] = 123, parameterBoolean: CallWithDefaultParametersData['parameterBoolean'] = true, parameterEnum: CallWithDefaultParametersData['parameterEnum'] = 'Success', parameterModel: CallWithDefaultParametersData['parameterModel'] = { + prop: 'Hello World!' + }): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/defaults', + query: { + parameterString, + parameterNumber, + parameterBoolean, + parameterEnum, + parameterModel + } + }); + } + + /** + * @param parameterString This is a simple string that is optional with default value + * @param parameterNumber This is a simple number that is optional with default value + * @param parameterBoolean This is a simple boolean that is optional with default value + * @param parameterEnum This is a simple enum that is optional with default value + * @param parameterModel This is a simple model that is optional with default value + * @throws ApiError + */ + public static callWithDefaultOptionalParameters(parameterString: CallWithDefaultOptionalParametersData['parameterString'] = 'Hello World!', parameterNumber: CallWithDefaultOptionalParametersData['parameterNumber'] = 123, parameterBoolean: CallWithDefaultOptionalParametersData['parameterBoolean'] = true, parameterEnum: CallWithDefaultOptionalParametersData['parameterEnum'] = 'Success', parameterModel: CallWithDefaultOptionalParametersData['parameterModel'] = { + prop: 'Hello World!' + }): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/defaults', + query: { + parameterString, + parameterNumber, + parameterBoolean, + parameterEnum, + parameterModel + } + }); + } + + /** + * @param parameterStringWithNoDefault This is a string with no default + * @param parameterOptionalStringWithDefault This is a optional string with default + * @param parameterOptionalStringWithEmptyDefault This is a optional string with empty default + * @param parameterOptionalStringWithNoDefault This is a optional string with no default + * @param parameterStringWithDefault This is a string with default + * @param parameterStringWithEmptyDefault This is a string with empty default + * @param parameterStringNullableWithNoDefault This is a string that can be null with no default + * @param parameterStringNullableWithDefault This is a string that can be null with default + * @throws ApiError + */ + public static callToTestOrderOfParams(parameterStringWithNoDefault: CallToTestOrderOfParamsData['parameterStringWithNoDefault'], parameterOptionalStringWithDefault: CallToTestOrderOfParamsData['parameterOptionalStringWithDefault'] = 'Hello World!', parameterOptionalStringWithEmptyDefault: CallToTestOrderOfParamsData['parameterOptionalStringWithEmptyDefault'] = '', parameterOptionalStringWithNoDefault?: CallToTestOrderOfParamsData['parameterOptionalStringWithNoDefault'], parameterStringWithDefault: CallToTestOrderOfParamsData['parameterStringWithDefault'] = 'Hello World!', parameterStringWithEmptyDefault: CallToTestOrderOfParamsData['parameterStringWithEmptyDefault'] = '', parameterStringNullableWithNoDefault?: CallToTestOrderOfParamsData['parameterStringNullableWithNoDefault'], parameterStringNullableWithDefault: CallToTestOrderOfParamsData['parameterStringNullableWithDefault'] = null): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/defaults', + query: { + parameterOptionalStringWithDefault, + parameterOptionalStringWithEmptyDefault, + parameterOptionalStringWithNoDefault, + parameterStringWithDefault, + parameterStringWithEmptyDefault, + parameterStringWithNoDefault, + parameterStringNullableWithNoDefault, + parameterStringNullableWithDefault + } + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/types.gen.ts new file mode 100644 index 000000000..3ee5e285c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/types.gen.ts @@ -0,0 +1,102 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +export type CallWithDefaultParametersData = { + /** + * This is a simple boolean with default value + */ + parameterBoolean?: (boolean) | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: (ModelWithString) | null; + /** + * This is a simple number with default value + */ + parameterNumber?: (number) | null; + /** + * This is a simple string with default value + */ + parameterString?: (string) | null; +}; + +export type CallWithDefaultOptionalParametersData = { + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; +}; + +export type CallToTestOrderOfParamsData = { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: (string) | null; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: (string) | null; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_no_index/client.gen.ts b/packages/openapi-ts-tests/test/generated/v3_no_index/client.gen.ts new file mode 100644 index 000000000..fdbaafa48 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_no_index/client.gen.ts @@ -0,0 +1,18 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ClientOptions } from './types.gen'; +import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ + baseUrl: 'http://localhost:3000/base' +})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_no_index/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_no_index/types.gen.ts new file mode 100644 index 000000000..f6a6095e3 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_no_index/types.gen.ts @@ -0,0 +1,1970 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = unknown; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string; + /** + * This is a simple string property + */ + nullableRequiredProp1: string; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReference = { + prop?: ModelWithProperties; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnly = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: { + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithProperties = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedProperties = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPattern = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type File = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + unknown, + unknown + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnly = { + foo: string; + readonly bar: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | string, + number | string, + number | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: unknown; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssue = ((ConstValue | GenericSchemaDuplicateIssue1SystemBoolean) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemString; + +export type GenericSchemaDuplicateIssue1SystemBoolean = { + item?: boolean; + error?: string; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemString = { + item?: string; + error?: string; + readonly hasError?: boolean; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnly; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: unknown; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: unknown; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: unknown; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: unknown; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: unknown; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: unknown; + }; + url: '/api/v{api-version}/descriptions/'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + }; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters/'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters/'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody/'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData/'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string; + /** + * This is a simple number with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + }; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + /** + * This is tuple parameter + */ + parameterTuple: [ + number, + number, + number, + number + ]; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: unknown; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: unknown; +}; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + readonly key: string; + name: string; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array; + listOfStrings?: Array; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + readonly user?: { + readonly id?: number; + readonly name?: string; + }; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_node/core/ApiError.ts new file mode 100644 index 000000000..36675d288 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_node/core/ApiError.ts @@ -0,0 +1,21 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; + +export class ApiError extends Error { + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: unknown; + public readonly request: ApiRequestOptions; + + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); + + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_node/core/ApiRequestOptions.ts new file mode 100644 index 000000000..939a0aa4c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_node/core/ApiRequestOptions.ts @@ -0,0 +1,21 @@ +export type ApiRequestOptions = { + readonly body?: any; + readonly cookies?: Record; + readonly errors?: Record; + readonly formData?: Record | any[] | Blob | File; + readonly headers?: Record; + readonly mediaType?: string; + readonly method: + | 'DELETE' + | 'GET' + | 'HEAD' + | 'OPTIONS' + | 'PATCH' + | 'POST' + | 'PUT'; + readonly path?: Record; + readonly query?: Record; + readonly responseHeader?: string; + readonly responseTransformer?: (data: unknown) => Promise; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_node/core/ApiResult.ts new file mode 100644 index 000000000..4c58e3913 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_node/core/ApiResult.ts @@ -0,0 +1,7 @@ +export type ApiResult = { + readonly body: TData; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_node/core/CancelablePromise.ts new file mode 100644 index 000000000..ccc082e8f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_node/core/CancelablePromise.ts @@ -0,0 +1,126 @@ +export class CancelError extends Error { + constructor(message: string) { + super(message); + this.name = 'CancelError'; + } + + public get isCancelled(): boolean { + return true; + } +} + +export interface OnCancel { + readonly isResolved: boolean; + readonly isRejected: boolean; + readonly isCancelled: boolean; + + (cancelHandler: () => void): void; +} + +export class CancelablePromise implements Promise { + private _isResolved: boolean; + private _isRejected: boolean; + private _isCancelled: boolean; + readonly cancelHandlers: (() => void)[]; + readonly promise: Promise; + private _resolve?: (value: T | PromiseLike) => void; + private _reject?: (reason?: unknown) => void; + + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason?: unknown) => void, + onCancel: OnCancel + ) => void + ) { + this._isResolved = false; + this._isRejected = false; + this._isCancelled = false; + this.cancelHandlers = []; + this.promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + + const onResolve = (value: T | PromiseLike): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isResolved = true; + if (this._resolve) this._resolve(value); + }; + + const onReject = (reason?: unknown): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isRejected = true; + if (this._reject) this._reject(reason); + }; + + const onCancel = (cancelHandler: () => void): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this.cancelHandlers.push(cancelHandler); + }; + + Object.defineProperty(onCancel, 'isResolved', { + get: (): boolean => this._isResolved, + }); + + Object.defineProperty(onCancel, 'isRejected', { + get: (): boolean => this._isRejected, + }); + + Object.defineProperty(onCancel, 'isCancelled', { + get: (): boolean => this._isCancelled, + }); + + return executor(onResolve, onReject, onCancel as OnCancel); + }); + } + + get [Symbol.toStringTag]() { + return "Cancellable Promise"; + } + + public then( + onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null + ): Promise { + return this.promise.then(onFulfilled, onRejected); + } + + public catch( + onRejected?: ((reason: unknown) => TResult | PromiseLike) | null + ): Promise { + return this.promise.catch(onRejected); + } + + public finally(onFinally?: (() => void) | null): Promise { + return this.promise.finally(onFinally); + } + + public cancel(): void { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isCancelled = true; + if (this.cancelHandlers.length) { + try { + for (const cancelHandler of this.cancelHandlers) { + cancelHandler(); + } + } catch (error) { + console.warn('Cancellation threw an error', error); + return; + } + } + this.cancelHandlers.length = 0; + if (this._reject) this._reject(new CancelError('Request aborted')); + } + + public get isCancelled(): boolean { + return this._isCancelled; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_node/core/OpenAPI.ts new file mode 100644 index 000000000..90c96f9a3 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_node/core/OpenAPI.ts @@ -0,0 +1,57 @@ +import type { RequestInit, Response } from 'node-fetch'; +import type { ApiRequestOptions } from './ApiRequestOptions'; + +type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware): void { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Middleware): void { + this._fns = [...this._fns, fn]; + } +} + +export type OpenAPIConfig = { + BASE: string; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + VERSION: string; + WITH_CREDENTIALS: boolean; + interceptors: { + request: Interceptors; + response: Interceptors; + }; +}; + +export const OpenAPI: OpenAPIConfig = { + BASE: 'http://localhost:3000/base', + CREDENTIALS: 'include', + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + TOKEN: undefined, + USERNAME: undefined, + VERSION: '1.0', + WITH_CREDENTIALS: false, + interceptors: { + request: new Interceptors(), + response: new Interceptors(), + }, +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_node/core/request.ts new file mode 100644 index 000000000..fa1ed3862 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_node/core/request.ts @@ -0,0 +1,350 @@ +import fetch, { FormData, Headers } from 'node-fetch'; +import type { RequestInit, Response } from 'node-fetch'; + +import { ApiError } from './ApiError'; +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; +import { CancelablePromise } from './CancelablePromise'; +import type { OnCancel } from './CancelablePromise'; +import type { OpenAPIConfig } from './OpenAPI'; + +export const isString = (value: unknown): value is string => { + return typeof value === 'string'; +}; + +export const isStringWithValue = (value: unknown): value is string => { + return isString(value) && value !== ''; +}; + +export const isBlob = (value: any): value is Blob => { + return value instanceof Blob; +}; + +export const isFormData = (value: unknown): value is FormData => { + return value instanceof FormData; +}; + +export const base64 = (str: string): string => { + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } +}; + +export const getQueryString = (params: Record): string => { + const qs: string[] = []; + + const append = (key: string, value: unknown) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; + + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; + } + + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { + value.forEach(v => encodePair(key, v)); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); + } + }; + + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); + + return qs.length ? `?${qs.join('&')}` : ''; +}; + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI; + + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); + + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; +}; + +export const getFormData = (options: ApiRequestOptions): FormData | undefined => { + if (options.formData) { + const formData = new FormData(); + + const process = (key: string, value: unknown) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; + + Object.entries(options.formData) + .filter(([, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); + + return formData; + } + return undefined; +}; + +type Resolver = (options: ApiRequestOptions) => Promise; + +export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; +}; + +export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { + const [token, username, password, additionalHeaders] = await Promise.all([ + // @ts-ignore + resolve(options, config.TOKEN), + // @ts-ignore + resolve(options, config.USERNAME), + // @ts-ignore + resolve(options, config.PASSWORD), + // @ts-ignore + resolve(options, config.HEADERS), + ]); + + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + }) + .filter(([, value]) => value !== undefined && value !== null) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); + + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } + + return new Headers(headers); +}; + +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body !== undefined) { + if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { + return JSON.stringify(options.body); + } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { + return options.body; + } else { + return JSON.stringify(options.body); + } + } + return undefined; +}; + +export const sendRequest = async ( + config: OpenAPIConfig, + options: ApiRequestOptions, + url: string, + body: any, + formData: FormData | undefined, + headers: Headers, + onCancel: OnCancel +): Promise => { + const controller = new AbortController(); + + let request: RequestInit = { + headers, + body: body ?? formData, + method: options.method, + signal: controller.signal, + }; + + + for (const fn of config.interceptors.request._fns) { + request = await fn(request); + } + + onCancel(() => controller.abort()); + + return await fetch(url, request); +}; + +export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { + if (responseHeader) { + const content = response.headers.get(responseHeader); + if (isString(content)) { + return content; + } + } + return undefined; +}; + +export const getResponseBody = async (response: Response): Promise => { + if (response.status !== 204) { + try { + const contentType = response.headers.get('Content-Type'); + if (contentType) { + const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; + if (contentType.includes('application/json') || contentType.includes('+json')) { + return await response.json(); + } else if (binaryTypes.some(type => contentType.includes(type))) { + return await response.blob(); + } else if (contentType.includes('multipart/form-data')) { + return await response.formData(); + } else if (contentType.includes('text/')) { + return await response.text(); + } + } + } catch (error) { + console.error(error); + } + } + return undefined; +}; + +export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Payload Too Large', + 414: 'URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Range Not Satisfiable', + 417: 'Expectation Failed', + 418: 'Im a teapot', + 421: 'Misdirected Request', + 422: 'Unprocessable Content', + 423: 'Locked', + 424: 'Failed Dependency', + 425: 'Too Early', + 426: 'Upgrade Required', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', + 451: 'Unavailable For Legal Reasons', + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 508: 'Loop Detected', + 510: 'Not Extended', + 511: 'Network Authentication Required', + ...options.errors, + } + + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } + + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } +}; + +/** + * Request method + * @param config The OpenAPI configuration object + * @param options The request options from the service + * @returns CancelablePromise + * @throws ApiError + */ +export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { + return new CancelablePromise(async (resolve, reject, onCancel) => { + try { + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); + const headers = await getHeaders(config, options); + + if (!onCancel.isCancelled) { + let response = await sendRequest(config, options, url, body, formData, headers, onCancel); + + for (const fn of config.interceptors.response._fns) { + response = await fn(response); + } + + const responseBody = await getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + + let transformedBody = responseBody; + if (options.responseTransformer && response.ok) { + transformedBody = await options.responseTransformer(responseBody) + } + + const result: ApiResult = { + url, + ok: response.ok, + status: response.status, + statusText: response.statusText, + body: responseHeader ?? transformedBody, + }; + + catchErrorCodes(options, result); + + resolve(result.body); + } + } catch (error) { + reject(error); + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node/index.ts b/packages/openapi-ts-tests/test/generated/v3_node/index.ts new file mode 100644 index 000000000..50a1dd734 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_node/index.ts @@ -0,0 +1,6 @@ +// This file is auto-generated by @hey-api/openapi-ts +export { ApiError } from './core/ApiError'; +export { CancelablePromise, CancelError } from './core/CancelablePromise'; +export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_node/sdk.gen.ts new file mode 100644 index 000000000..f62288bcf --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_node/sdk.gen.ts @@ -0,0 +1,913 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CancelablePromise } from './core/CancelablePromise'; +import { OpenAPI } from './core/OpenAPI'; +import { request as __request } from './core/request'; +import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; + +export class CollectionFormatService { + /** + * @param data The data for the request. + * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) + * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) + * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) + * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) + * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) + * @throws ApiError + */ + public static collectionFormat(data: CollectionFormatData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/collectionFormat', + query: { + parameterArrayCSV: data.parameterArrayCsv, + parameterArraySSV: data.parameterArraySsv, + parameterArrayTSV: data.parameterArrayTsv, + parameterArrayPipes: data.parameterArrayPipes, + parameterArrayMulti: data.parameterArrayMulti + } + }); + } + +} + +export class ComplexService { + /** + * @param data The data for the request. + * @param data.parameterObject Parameter containing object + * @param data.parameterReference Parameter containing reference + * @returns ModelWithString Successful response + * @throws ApiError + */ + public static complexTypes(data: ComplexTypesData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/complex', + query: { + parameterObject: data.parameterObject, + parameterReference: data.parameterReference + }, + errors: { + 400: '400 `server` error', + 500: '500 server error' + } + }); + } + + /** + * @param data The data for the request. + * @param data.id + * @param data.requestBody + * @returns ModelWithString Success + * @throws ApiError + */ + public static complexParams(data: ComplexParamsData): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/complex/{id}', + path: { + id: data.id + }, + body: data.requestBody, + mediaType: 'application/json-patch+json' + }); + } + +} + +export class DefaultService { + /** + * @throws ApiError + */ + public static export(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public static patchApiNoTag(): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @param data The data for the request. + * @param data.requestBody + * @returns Model_From_Zendesk Success + * @returns ModelWithReadOnlyAndWriteOnly Default success response + * @throws ApiError + */ + public static import(data: ImportData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/no+tag', + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public static fooWow(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @param data The data for the request. + * @param data.fooParam foo in method + * @returns number Response is a simple number + * @throws ApiError + */ + public static getApiSimpleOperation(data: GetApiSimpleOperationData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple:operation', + path: { + foo_param: data.fooParam + }, + errors: { + default: 'Default error response' + } + }); + } + +} + +export class DefaultsService { + /** + * @param data The data for the request. + * @param data.parameterString This is a simple string with default value + * @param data.parameterNumber This is a simple number with default value + * @param data.parameterBoolean This is a simple boolean with default value + * @param data.parameterEnum This is a simple enum with default value + * @param data.parameterModel This is a simple model with default value + * @throws ApiError + */ + public static callWithDefaultParameters(data: CallWithDefaultParametersData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterString This is a simple string that is optional with default value + * @param data.parameterNumber This is a simple number that is optional with default value + * @param data.parameterBoolean This is a simple boolean that is optional with default value + * @param data.parameterEnum This is a simple enum that is optional with default value + * @param data.parameterModel This is a simple model that is optional with default value + * @throws ApiError + */ + public static callWithDefaultOptionalParameters(data: CallWithDefaultOptionalParametersData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterStringWithNoDefault This is a string with no default + * @param data.parameterOptionalStringWithDefault This is a optional string with default + * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default + * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default + * @param data.parameterStringWithDefault This is a string with default + * @param data.parameterStringWithEmptyDefault This is a string with empty default + * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default + * @param data.parameterStringNullableWithDefault This is a string that can be null with default + * @throws ApiError + */ + public static callToTestOrderOfParams(data: CallToTestOrderOfParamsData): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/defaults', + query: { + parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, + parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, + parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, + parameterStringWithDefault: data.parameterStringWithDefault, + parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, + parameterStringWithNoDefault: data.parameterStringWithNoDefault, + parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, + parameterStringNullableWithDefault: data.parameterStringNullableWithDefault + } + }); + } + +} + +export class DeprecatedService { + /** + * @deprecated + * @param data The data for the request. + * @param data.parameter This parameter is deprecated + * @throws ApiError + */ + public static deprecatedCall(data: DeprecatedCallData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/deprecated', + headers: { + parameter: data.parameter + } + }); + } + +} + +export class DescriptionsService { + /** + * @param data The data for the request. + * @param data.parameterWithBreaks Testing multiline comments in string: First line + * Second line + * + * Fourth line + * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work + * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work + * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work + * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work + * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work + * @throws ApiError + */ + public static callWithDescriptions(data: CallWithDescriptionsData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/descriptions/', + query: { + parameterWithBreaks: data.parameterWithBreaks, + parameterWithBackticks: data.parameterWithBackticks, + parameterWithSlashes: data.parameterWithSlashes, + parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders, + parameterWithQuotes: data.parameterWithQuotes, + parameterWithReservedCharacters: data.parameterWithReservedCharacters + } + }); + } + +} + +export class DuplicateService { + /** + * @throws ApiError + */ + public static duplicateName(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public static duplicateName1(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public static duplicateName2(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public static duplicateName3(): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/duplicate' + }); + } + +} + +export class ErrorService { + /** + * @param data The data for the request. + * @param data.status Status code to return + * @returns unknown Custom message: Successful response + * @throws ApiError + */ + public static testErrorCode(data: TestErrorCodeData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/error', + query: { + status: data.status + }, + errors: { + 500: 'Custom message: Internal Server Error', + 501: 'Custom message: Not Implemented', + 502: 'Custom message: Bad Gateway', + 503: 'Custom message: Service Unavailable' + } + }); + } + +} + +export class FileResponseService { + /** + * @param data The data for the request. + * @param data.id + * @returns binary Success + * @throws ApiError + */ + public static fileResponse(data: FileResponseData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/file/{id}', + path: { + id: data.id + } + }); + } + +} + +export class FormDataService { + /** + * @param data The data for the request. + * @param data.parameter This is a reusable parameter + * @param data.formData A reusable request body + * @throws ApiError + */ + public static postApiFormData(data: PostApiFormDataData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/formData/', + query: { + parameter: data.parameter + }, + formData: data.formData, + mediaType: 'multipart/form-data' + }); + } + +} + +export class HeaderService { + /** + * @returns string Successful response + * @throws ApiError + */ + public static callWithResultFromHeader(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/header', + responseHeader: 'operation-location', + errors: { + 400: '400 server error', + 500: '500 server error' + } + }); + } + +} + +export class MultipartService { + /** + * @param data The data for the request. + * @param data.formData + * @throws ApiError + */ + public static multipartRequest(data: MultipartRequestData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/multipart', + formData: data.formData, + mediaType: 'multipart/form-data' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public static multipartResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multipart' + }); + } + +} + +export class MultipleTags1Service { + /** + * @returns _400 + * @throws ApiError + */ + public static dummyA(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/a' + }); + } + + /** + * @returns void Success + * @throws ApiError + */ + public static dummyB(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class MultipleTags2Service { + /** + * @returns _400 + * @throws ApiError + */ + public static dummyA(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/a' + }); + } + + /** + * @returns void Success + * @throws ApiError + */ + public static dummyB(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class MultipleTags3Service { + /** + * @returns void Success + * @throws ApiError + */ + public static dummyB(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class NoContentService { + /** + * @returns void Success + * @throws ApiError + */ + public static callWithNoContentResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/no-content' + }); + } + + /** + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public static callWithResponseAndNoContentResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/response-and-no-content' + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + /** + * @param data The data for the request. + * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param + * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response + * @throws ApiError + */ + public static nonAsciiæøåÆøÅöôêÊ字符串(data: NonAsciiæøåÆøÅöôêÊ字符串Data): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + query: { + 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ + } + }); + } + + /** + * Login User + * @param data The data for the request. + * @param data.formData + * @throws ApiError + */ + public static putWithFormUrlEncoded(data: PutWithFormUrlEncodedData): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + formData: data.formData, + mediaType: 'application/x-www-form-urlencoded' + }); + } + +} + +export class ParametersService { + /** + * @param data The data for the request. + * @param data.fooParam foo in method + * @param data.barParam bar in method + * @param data.xFooBar Parameter with illegal characters + * @throws ApiError + */ + public static deleteFoo(data: DeleteFooData3): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + path: { + foo_param: data.fooParam, + BarParam: data.barParam + }, + headers: { + 'x-Foo-Bar': data.xFooBar + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the header + * @param data.fooAllOfEnum + * @param data.cursor This is the parameter that goes into the query params + * @param data.parameterCookie This is the parameter that goes into the cookie + * @param data.parameterPath This is the parameter that goes into the path + * @param data.requestBody This is the parameter that goes into the body + * @param data.fooRefEnum + * @throws ApiError + */ + public static callWithParameters(data: CallWithParametersData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/{parameterPath}', + path: { + parameterPath: data.parameterPath + }, + cookies: { + parameterCookie: data.parameterCookie + }, + headers: { + parameterHeader: data.parameterHeader + }, + query: { + foo_ref_enum: data.fooRefEnum, + foo_all_of_enum: data.fooAllOfEnum, + cursor: data.cursor + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the request header + * @param data.parameterQuery This is the parameter that goes into the request query params + * @param data.parameterCookie This is the parameter that goes into the cookie + * @param data.requestBody This is the parameter that goes into the body + * @param data.parameterPath1 This is the parameter that goes into the path + * @param data.parameterPath2 This is the parameter that goes into the path + * @param data.parameterPath3 This is the parameter that goes into the path + * @param data._default This is the parameter with a reserved keyword + * @throws ApiError + */ + public static callWithWeirdParameterNames(data: CallWithWeirdParameterNamesData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + path: { + 'parameter.path.1': data.parameterPath1, + 'parameter-path-2': data.parameterPath2, + 'PARAMETER-PATH-3': data.parameterPath3 + }, + cookies: { + 'PARAMETER-COOKIE': data.parameterCookie + }, + headers: { + 'parameter.header': data.parameterHeader + }, + query: { + default: data._default, + 'parameter-query': data.parameterQuery + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.requestBody This is a required parameter + * @param data.page This is an optional parameter + * @throws ApiError + */ + public static getCallWithOptionalParam(data: GetCallWithOptionalParamData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/parameters/', + query: { + page: data.page + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.parameter This is a required parameter + * @param data.requestBody This is an optional parameter + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public static postCallWithOptionalParam(data: PostCallWithOptionalParamData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/', + query: { + parameter: data.parameter + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + +} + +export class RequestBodyService { + /** + * @param data The data for the request. + * @param data.parameter This is a reusable parameter + * @param data.foo A reusable request body + * @throws ApiError + */ + public static postApiRequestBody(data: PostApiRequestBodyData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/requestBody/', + query: { + parameter: data.parameter + }, + body: data.foo, + mediaType: 'application/json' + }); + } + +} + +export class ResponseService { + /** + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public static callWithResponseAndNoContentResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/response-and-no-content' + }); + } + + /** + * @returns import + * @throws ApiError + */ + public static callWithResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/response' + }); + } + + /** + * @returns unknown Message for 200 response + * @returns ModelWithString Message for 201 response + * @returns ModelWithString Message for 202 response + * @throws ApiError + */ + public static callWithDuplicateResponses(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/response', + errors: { + 500: 'Message for 500 error', + 501: 'Message for 501 error', + 502: 'Message for 502 error', + '4XX': 'Message for 4XX errors', + default: 'Default error response' + } + }); + } + + /** + * @returns unknown Message for 200 response + * @returns ModelThatExtends Message for 201 response + * @returns ModelThatExtendsExtends Message for 202 response + * @throws ApiError + */ + public static callWithResponses(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/response', + errors: { + 500: 'Message for 500 error', + 501: 'Message for 501 error', + 502: 'Message for 502 error', + default: 'Message for default response' + } + }); + } + +} + +export class SimpleService { + /** + * @returns Model_From_Zendesk Success + * @throws ApiError + */ + public static apiVVersionODataControllerCount(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple/$count' + }); + } + + /** + * @throws ApiError + */ + public static getCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static putCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static postCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static deleteCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static optionsCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'OPTIONS', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static headCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'HEAD', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static patchCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v{api-version}/simple' + }); + } + +} + +export class TypesService { + /** + * @param data The data for the request. + * @param data.parameterArray This is an array parameter + * @param data.parameterDictionary This is a dictionary parameter + * @param data.parameterEnum This is an enum parameter + * @param data.parameterTuple This is tuple parameter + * @param data.parameterNumber This is a number parameter + * @param data.parameterString This is a string parameter + * @param data.parameterBoolean This is a boolean parameter + * @param data.parameterObject This is an object parameter + * @param data.id This is a number parameter + * @returns number Response is a simple number + * @returns string Response is a simple string + * @returns boolean Response is a simple boolean + * @returns unknown Response is a simple object + * @throws ApiError + */ + public static types(data: TypesData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/types', + path: { + id: data.id + }, + query: { + parameterNumber: data.parameterNumber, + parameterString: data.parameterString, + parameterBoolean: data.parameterBoolean, + parameterObject: data.parameterObject, + parameterArray: data.parameterArray, + parameterDictionary: data.parameterDictionary, + parameterEnum: data.parameterEnum, + parameterTuple: data.parameterTuple + } + }); + } + +} + +export class UploadService { + /** + * @param data The data for the request. + * @param data.formData + * @returns boolean + * @throws ApiError + */ + public static uploadFile(data: UploadFileData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/upload', + formData: data.formData, + mediaType: 'application/x-www-form-urlencoded' + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_node/types.gen.ts new file mode 100644 index 000000000..d20c92660 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_node/types.gen.ts @@ -0,0 +1,1537 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _3e_num_1Период = 'Bird' | 'Dog'; + +export const _3e_num_1Период = { + BIRD: 'Bird', + DOG: 'Dog' +} as const; + +/** + * Model with number-only name + */ +export type _400 = string; + +export type _default = { + name?: string; +}; + +/** + * Model with restricted keyword name + */ +export type _import = string; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: (number) | undefined; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AnyOfAnyAndNull = { + data?: (unknown | null); +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<({ + foo?: string; +} | { + bar?: string; +})>; +}; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<({ + foo?: string; +} | { + bar?: string; +})>; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array<(boolean)>; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array<(number)>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: camelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array<(string)>; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type camelCaseCommentWithBreaks = number; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + firstName: string; + lastname: string; + age: number; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: (({ + boolean?: boolean; +} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: (Array<(_3e_num_1Период | ConstValue)> | null); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(number | string)>; +}); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: ParameterSimpleParameter; +} | { + bar: NonAsciiStringæøåÆØÅöôêÊ字符串; +}) & { + baz: (number) | null; + qux: number; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(boolean)>; +}); +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: (boolean | { + [key: string]: (number); +}); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; + +export type ConstValue = "ConstValue"; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: (string); + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: (string | number | boolean) | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: (string); +}; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple enum with numbers + */ +export const EnumWithExtensions = { + /** + * Used when the status of something is successful + */ + CUSTOM_SUCCESS: 200, + /** + * Used when the status of something has a warning + */ + CUSTOM_WARNING: 400, + /** + * Used when the status of something has an error + */ + CUSTOM_ERROR: 500 +} as const; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * This is a simple enum with numbers + */ +export const EnumWithNumbers = { + '_1': 1, + '_2': 2, + '_3': 3, + '_1.1': 1.1, + '_1.2': 1.2, + '_1.3': 1.3, + '_100': 100, + '_200': 200, + '_300': 300, + '_-100': -100, + '_-200': -200, + '_-300': -300, + '_-1.1': -1.1, + '_-1.2': -1.2, + '_-1.3': -1.3 +} as const; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +export const EnumWithReplacedCharacters = { + _SINGLE_QUOTE_: "'Single Quote'", + _DOUBLE_QUOTES_: '"Double Quotes"', + 'ØÆÅÔÖ_ØÆÅÔÖ字符串': 'øæåôöØÆÅÔÖ字符串', + '_3.1': 3.1, + EMPTY_STRING: '' +} as const; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with strings + */ +export const EnumWithStrings = { + SUCCESS: 'Success', + WARNING: 'Warning', + ERROR: 'Error', + _SINGLE_QUOTE_: "'Single Quote'", + _DOUBLE_QUOTES_: '"Double Quotes"', + 'NON_ASCII__ØÆÅÔÖ_ØÆÅÔÖ字符串': 'Non-ascii: øæåôöØÆÅÔÖ字符串' +} as const; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +export const EnumWithXEnumNames = { + zero: 0, + one: 1, + two: 2 +} as const; + +export type File = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { + item?: boolean; + error?: (string) | null; + readonly hasError?: boolean; + data?: { + [key: string]: unknown; + }; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_String_ = { + item?: (string) | null; + error?: (string) | null; + readonly hasError?: boolean; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type Model_From_Zendesk = string; + +/** + * Circle + */ +export type ModelCircle = { + kind: 'circle'; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: 'square'; + sideLength?: number; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string; +}; + +export type ModelWithAnyOfConstantSizeArray = [ + (number | string), + (number | string), + (number | string) +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + (number & string), + (number & string) +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + ((number) | null | string), + ((number) | null | string), + ((number) | null | string) +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + (number | _import), + (number | _import) +]; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnly = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +export type ModelWithConst = { + String?: "String"; + number?: 0; + null?: null; + withType?: "Some string"; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: (string); + }; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: boolean; +}; + +/** + * This is a simple enum with strings + */ +export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + +/** + * This is a simple enum with strings + */ +export const foo_bar_enum = { + SUCCESS: 'Success', + WARNING: 'Warning', + ERROR: 'Error', + 'ØÆÅ字符串': 'ØÆÅ字符串' +} as const; + +/** + * These are the HTTP error code enums + */ +export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + +/** + * These are the HTTP error code enums + */ +export const statusCode = { + _100: '100', + _200_FOO: '200 FOO', + _300_FOO_BAR: '300 FOO_BAR', + _400_FOO_BAR: '400 foo-bar', + _500_FOO_BAR: '500 foo.bar', + _600_FOO_BAR: '600 foo&bar' +} as const; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +export type foo_bar_baz_qux = '3.0'; + +export const foo_bar_baz_qux = { + _3_0: '3.0' +} as const; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array<(string)>; + data?: (ModelWithNestedArrayEnumsData); +}; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export const ModelWithNestedArrayEnumsDataBar = { + BAZ: 'baz', + QUX: 'qux' +} as const; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export const ModelWithNestedArrayEnumsDataFoo = { + FOO: 'foo', + BAR: 'bar' +} as const; + +export type ModelWithNestedCompositionEnums = { + foo?: (ModelWithNestedArrayEnumsDataFoo); +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: ('Success' | 'Warning' | 'Error'); + }; + dictionaryWithEnumFromDescription?: { + [key: string]: (number); + }; + arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; + arrayWithDescription?: Array<(number)>; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedProperties = { + readonly first: { + readonly second: { + readonly third: (string) | null; + } | null; + } | null; +}; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: (string) | null; + /** + * This is a simple string property + */ + nullableProp2?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: (string) | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Период + */ +export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; + +/** + * Период + */ +export const value = { + '_-10': -10, + '_-1': -1, + '_0': 0, + '_1': 1, + '_3': 3, + '_6': 6, + '_12': 12 +} as const; + +export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { + baz: (number) | null; + qux: number; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + (string), + (string) + ]; + foo: 'Corge'; +}; + +export type foo = 'Bar'; + +export const foo = { + BAR: 'Bar' +} as const; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPattern = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + (number | string), + string +]; + +/** + * This is a model with one nested property + */ +export type ModelWithProperties = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: (string) | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +export type ModelWithReadOnlyAndWriteOnly = { + foo: string; + readonly bar: string; + baz: string; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReference = { + prop?: ModelWithProperties; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: (Array<(string | boolean)> | null); +}; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array<(string)>; +}; + +/** + * This is a reusable parameter + */ +export type ParameterSimpleParameter = string; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Parameter with illegal characters + */ +export type Parameterx_Foo_Bar = ModelWithString; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<({ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; +})>; +}; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple file + */ +export type SimpleFile = (Blob | File); + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = (string) | null; + +export type CollectionFormatData = { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCsv: Array<(string)> | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array<(string)> | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array<(string)> | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySsv: Array<(string)> | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTsv: Array<(string)> | null; +}; + +export type ComplexTypesData = { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; +}; + +export type ComplexTypesResponse = (Array); + +export type ComplexParamsData = { + id: number; + requestBody?: { + readonly key: (string) | null; + name: (string) | null; + enabled?: boolean; + readonly type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array<(string)> | null; + parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); + readonly user?: { + readonly id?: number; + readonly name?: (string) | null; + }; + }; +}; + +export type ComplexParamsResponse = (ModelWithString); + +export type PatchApiNoTagResponse = (unknown); + +export type ImportData = { + requestBody: (ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly); +}; + +export type ImportResponse = (Model_From_Zendesk | ModelWithReadOnlyAndWriteOnly); + +export type FooWowResponse = (unknown); + +export type GetApiSimpleOperationData = { + /** + * foo in method + */ + fooParam: string; +}; + +export type GetApiSimpleOperationResponse = (number); + +export type CallWithDefaultParametersData = { + /** + * This is a simple boolean with default value + */ + parameterBoolean?: (boolean) | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: (ModelWithString) | null; + /** + * This is a simple number with default value + */ + parameterNumber?: (number) | null; + /** + * This is a simple string with default value + */ + parameterString?: (string) | null; +}; + +export type CallWithDefaultOptionalParametersData = { + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; +}; + +export type CallToTestOrderOfParamsData = { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: (string) | null; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: (string) | null; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; +}; + +export type DeprecatedCallData = { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: (DeprecatedModel) | null; +}; + +export type CallWithDescriptionsData = { + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: unknown; + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: unknown; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: unknown; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: unknown; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: unknown; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: unknown; +}; + +export type TestErrorCodeData = { + /** + * Status code to return + */ + status: number; +}; + +export type TestErrorCodeResponse = (unknown); + +export type FileResponseData = { + id: string; +}; + +export type FileResponseResponse = ((Blob | File)); + +export type PostApiFormDataData = { + /** + * A reusable request body + */ + formData?: ModelWithString; + /** + * This is a reusable parameter + */ + parameter?: string; +}; + +export type CallWithResultFromHeaderResponse = (string); + +export type MultipartRequestData = { + formData?: { + content?: (Blob | File); + data?: ((ModelWithString) | null); + }; +}; + +export type MultipartResponseResponse = ({ + file?: (Blob | File); + metadata?: { + foo?: string; + bar?: string; + }; +}); + +export type DummyAResponse = (_400); + +export type DummyBResponse = (void); + +export type CallWithNoContentResponseResponse = (void); + +export type CallWithResponseAndNoContentResponseResponse = (number | void); + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + /** + * Dummy input param + */ + nonAsciiParamæøåÆøÅöôêÊ: number; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = (Array); + +export type PutWithFormUrlEncodedData = { + formData: ArrayWithStrings; +}; + +export type DeleteFooData3 = { + /** + * bar in method + */ + barParam: string; + /** + * foo in method + */ + fooParam: string; + /** + * Parameter with illegal characters + */ + xFooBar: ModelWithString; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the query params + */ + cursor: (string) | null; + fooAllOfEnum: (ModelWithNestedArrayEnumsDataFoo); + fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the cookie + */ + parameterCookie: (string) | null; + /** + * This is the parameter that goes into the header + */ + parameterHeader: (string) | null; + /** + * This is the parameter that goes into the path + */ + parameterPath: (string) | null; + /** + * This is the parameter that goes into the body + */ + requestBody: { + [key: string]: unknown; + } | null; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter with a reserved keyword + */ + _default?: string; + /** + * This is the parameter that goes into the cookie + */ + parameterCookie: (string) | null; + /** + * This is the parameter that goes into the request header + */ + parameterHeader: (string) | null; + /** + * This is the parameter that goes into the path + */ + parameterPath1?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath2?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath3?: string; + /** + * This is the parameter that goes into the request query params + */ + parameterQuery: (string) | null; + /** + * This is the parameter that goes into the body + */ + requestBody: (ModelWithString) | null; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + page?: number; + /** + * This is a required parameter + */ + requestBody: ModelWithOneOfEnum; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is a required parameter + */ + parameter: Pageable; + /** + * This is an optional parameter + */ + requestBody?: { + offset?: (number) | null; + }; +}; + +export type PostCallWithOptionalParamResponse = (number | void); + +export type PostApiRequestBodyData = { + /** + * A reusable request body + */ + foo?: ModelWithString; + /** + * This is a reusable parameter + */ + parameter?: string; +}; + +export type CallWithResponseResponse = (_import); + +export type CallWithDuplicateResponsesResponse = ((ModelWithBoolean & ModelWithInteger) | ModelWithString); + +export type CallWithResponsesResponse = ({ + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; +} | ModelThatExtends | ModelThatExtendsExtends); + +export type ApiVVersionODataControllerCountResponse = (Model_From_Zendesk); + +export type TypesData = { + /** + * This is a number parameter + */ + id?: number; + /** + * This is an array parameter + */ + parameterArray: Array<(string)> | null; + /** + * This is a boolean parameter + */ + parameterBoolean: (boolean) | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: ('Success' | 'Warning' | 'Error') | null; + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is a string parameter + */ + parameterString: (string) | null; + /** + * This is tuple parameter + */ + parameterTuple: [ + number, + number, + number, + number + ]; +}; + +export type TypesResponse = (number | string | boolean | { + [key: string]: unknown; +}); + +export type UploadFileData = { + formData: (Blob | File); +}; + +export type UploadFileResponse = (boolean); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiError.ts new file mode 100644 index 000000000..36675d288 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiError.ts @@ -0,0 +1,21 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; + +export class ApiError extends Error { + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: unknown; + public readonly request: ApiRequestOptions; + + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); + + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiRequestOptions.ts new file mode 100644 index 000000000..939a0aa4c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiRequestOptions.ts @@ -0,0 +1,21 @@ +export type ApiRequestOptions = { + readonly body?: any; + readonly cookies?: Record; + readonly errors?: Record; + readonly formData?: Record | any[] | Blob | File; + readonly headers?: Record; + readonly mediaType?: string; + readonly method: + | 'DELETE' + | 'GET' + | 'HEAD' + | 'OPTIONS' + | 'PATCH' + | 'POST' + | 'PUT'; + readonly path?: Record; + readonly query?: Record; + readonly responseHeader?: string; + readonly responseTransformer?: (data: unknown) => Promise; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiResult.ts new file mode 100644 index 000000000..4c58e3913 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiResult.ts @@ -0,0 +1,7 @@ +export type ApiResult = { + readonly body: TData; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node_transform/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_node_transform/core/CancelablePromise.ts new file mode 100644 index 000000000..ccc082e8f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_node_transform/core/CancelablePromise.ts @@ -0,0 +1,126 @@ +export class CancelError extends Error { + constructor(message: string) { + super(message); + this.name = 'CancelError'; + } + + public get isCancelled(): boolean { + return true; + } +} + +export interface OnCancel { + readonly isResolved: boolean; + readonly isRejected: boolean; + readonly isCancelled: boolean; + + (cancelHandler: () => void): void; +} + +export class CancelablePromise implements Promise { + private _isResolved: boolean; + private _isRejected: boolean; + private _isCancelled: boolean; + readonly cancelHandlers: (() => void)[]; + readonly promise: Promise; + private _resolve?: (value: T | PromiseLike) => void; + private _reject?: (reason?: unknown) => void; + + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason?: unknown) => void, + onCancel: OnCancel + ) => void + ) { + this._isResolved = false; + this._isRejected = false; + this._isCancelled = false; + this.cancelHandlers = []; + this.promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + + const onResolve = (value: T | PromiseLike): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isResolved = true; + if (this._resolve) this._resolve(value); + }; + + const onReject = (reason?: unknown): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isRejected = true; + if (this._reject) this._reject(reason); + }; + + const onCancel = (cancelHandler: () => void): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this.cancelHandlers.push(cancelHandler); + }; + + Object.defineProperty(onCancel, 'isResolved', { + get: (): boolean => this._isResolved, + }); + + Object.defineProperty(onCancel, 'isRejected', { + get: (): boolean => this._isRejected, + }); + + Object.defineProperty(onCancel, 'isCancelled', { + get: (): boolean => this._isCancelled, + }); + + return executor(onResolve, onReject, onCancel as OnCancel); + }); + } + + get [Symbol.toStringTag]() { + return "Cancellable Promise"; + } + + public then( + onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null + ): Promise { + return this.promise.then(onFulfilled, onRejected); + } + + public catch( + onRejected?: ((reason: unknown) => TResult | PromiseLike) | null + ): Promise { + return this.promise.catch(onRejected); + } + + public finally(onFinally?: (() => void) | null): Promise { + return this.promise.finally(onFinally); + } + + public cancel(): void { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isCancelled = true; + if (this.cancelHandlers.length) { + try { + for (const cancelHandler of this.cancelHandlers) { + cancelHandler(); + } + } catch (error) { + console.warn('Cancellation threw an error', error); + return; + } + } + this.cancelHandlers.length = 0; + if (this._reject) this._reject(new CancelError('Request aborted')); + } + + public get isCancelled(): boolean { + return this._isCancelled; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node_transform/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_node_transform/core/OpenAPI.ts new file mode 100644 index 000000000..90c96f9a3 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_node_transform/core/OpenAPI.ts @@ -0,0 +1,57 @@ +import type { RequestInit, Response } from 'node-fetch'; +import type { ApiRequestOptions } from './ApiRequestOptions'; + +type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware): void { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Middleware): void { + this._fns = [...this._fns, fn]; + } +} + +export type OpenAPIConfig = { + BASE: string; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + VERSION: string; + WITH_CREDENTIALS: boolean; + interceptors: { + request: Interceptors; + response: Interceptors; + }; +}; + +export const OpenAPI: OpenAPIConfig = { + BASE: 'http://localhost:3000/base', + CREDENTIALS: 'include', + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + TOKEN: undefined, + USERNAME: undefined, + VERSION: '1.0', + WITH_CREDENTIALS: false, + interceptors: { + request: new Interceptors(), + response: new Interceptors(), + }, +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node_transform/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_node_transform/core/request.ts new file mode 100644 index 000000000..fa1ed3862 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_node_transform/core/request.ts @@ -0,0 +1,350 @@ +import fetch, { FormData, Headers } from 'node-fetch'; +import type { RequestInit, Response } from 'node-fetch'; + +import { ApiError } from './ApiError'; +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; +import { CancelablePromise } from './CancelablePromise'; +import type { OnCancel } from './CancelablePromise'; +import type { OpenAPIConfig } from './OpenAPI'; + +export const isString = (value: unknown): value is string => { + return typeof value === 'string'; +}; + +export const isStringWithValue = (value: unknown): value is string => { + return isString(value) && value !== ''; +}; + +export const isBlob = (value: any): value is Blob => { + return value instanceof Blob; +}; + +export const isFormData = (value: unknown): value is FormData => { + return value instanceof FormData; +}; + +export const base64 = (str: string): string => { + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } +}; + +export const getQueryString = (params: Record): string => { + const qs: string[] = []; + + const append = (key: string, value: unknown) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; + + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; + } + + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { + value.forEach(v => encodePair(key, v)); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); + } + }; + + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); + + return qs.length ? `?${qs.join('&')}` : ''; +}; + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI; + + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); + + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; +}; + +export const getFormData = (options: ApiRequestOptions): FormData | undefined => { + if (options.formData) { + const formData = new FormData(); + + const process = (key: string, value: unknown) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; + + Object.entries(options.formData) + .filter(([, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); + + return formData; + } + return undefined; +}; + +type Resolver = (options: ApiRequestOptions) => Promise; + +export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; +}; + +export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { + const [token, username, password, additionalHeaders] = await Promise.all([ + // @ts-ignore + resolve(options, config.TOKEN), + // @ts-ignore + resolve(options, config.USERNAME), + // @ts-ignore + resolve(options, config.PASSWORD), + // @ts-ignore + resolve(options, config.HEADERS), + ]); + + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + }) + .filter(([, value]) => value !== undefined && value !== null) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); + + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } + + return new Headers(headers); +}; + +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body !== undefined) { + if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { + return JSON.stringify(options.body); + } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { + return options.body; + } else { + return JSON.stringify(options.body); + } + } + return undefined; +}; + +export const sendRequest = async ( + config: OpenAPIConfig, + options: ApiRequestOptions, + url: string, + body: any, + formData: FormData | undefined, + headers: Headers, + onCancel: OnCancel +): Promise => { + const controller = new AbortController(); + + let request: RequestInit = { + headers, + body: body ?? formData, + method: options.method, + signal: controller.signal, + }; + + + for (const fn of config.interceptors.request._fns) { + request = await fn(request); + } + + onCancel(() => controller.abort()); + + return await fetch(url, request); +}; + +export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { + if (responseHeader) { + const content = response.headers.get(responseHeader); + if (isString(content)) { + return content; + } + } + return undefined; +}; + +export const getResponseBody = async (response: Response): Promise => { + if (response.status !== 204) { + try { + const contentType = response.headers.get('Content-Type'); + if (contentType) { + const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; + if (contentType.includes('application/json') || contentType.includes('+json')) { + return await response.json(); + } else if (binaryTypes.some(type => contentType.includes(type))) { + return await response.blob(); + } else if (contentType.includes('multipart/form-data')) { + return await response.formData(); + } else if (contentType.includes('text/')) { + return await response.text(); + } + } + } catch (error) { + console.error(error); + } + } + return undefined; +}; + +export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Payload Too Large', + 414: 'URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Range Not Satisfiable', + 417: 'Expectation Failed', + 418: 'Im a teapot', + 421: 'Misdirected Request', + 422: 'Unprocessable Content', + 423: 'Locked', + 424: 'Failed Dependency', + 425: 'Too Early', + 426: 'Upgrade Required', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', + 451: 'Unavailable For Legal Reasons', + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 508: 'Loop Detected', + 510: 'Not Extended', + 511: 'Network Authentication Required', + ...options.errors, + } + + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } + + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } +}; + +/** + * Request method + * @param config The OpenAPI configuration object + * @param options The request options from the service + * @returns CancelablePromise + * @throws ApiError + */ +export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { + return new CancelablePromise(async (resolve, reject, onCancel) => { + try { + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); + const headers = await getHeaders(config, options); + + if (!onCancel.isCancelled) { + let response = await sendRequest(config, options, url, body, formData, headers, onCancel); + + for (const fn of config.interceptors.response._fns) { + response = await fn(response); + } + + const responseBody = await getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + + let transformedBody = responseBody; + if (options.responseTransformer && response.ok) { + transformedBody = await options.responseTransformer(responseBody) + } + + const result: ApiResult = { + url, + ok: response.ok, + status: response.status, + statusText: response.statusText, + body: responseHeader ?? transformedBody, + }; + + catchErrorCodes(options, result); + + resolve(result.body); + } + } catch (error) { + reject(error); + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node_transform/index.ts b/packages/openapi-ts-tests/test/generated/v3_node_transform/index.ts new file mode 100644 index 000000000..50a1dd734 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_node_transform/index.ts @@ -0,0 +1,6 @@ +// This file is auto-generated by @hey-api/openapi-ts +export { ApiError } from './core/ApiError'; +export { CancelablePromise, CancelError } from './core/CancelablePromise'; +export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node_transform/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_node_transform/sdk.gen.ts new file mode 100644 index 000000000..5211e9979 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_node_transform/sdk.gen.ts @@ -0,0 +1,80 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CancelablePromise } from './core/CancelablePromise'; +import { OpenAPI } from './core/OpenAPI'; +import { request as __request } from './core/request'; +import { type ParentModelWithDatesResponse, type ModelWithDatesResponse, type ModelWithDatesArrayResponse, type ArrayOfDatesResponse, type DateResponse, type MultipleResponsesResponse, ParentModelWithDatesResponseTransformer, ModelWithDatesResponseTransformer, ModelWithDatesArrayResponseTransformer } from './types.gen'; + +export class DefaultService { + /** + * @returns ParentModelWithDates Success + * @returns unknown Success + * @throws ApiError + */ + public static parentModelWithDates(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/model-with-dates', + responseTransformer: ParentModelWithDatesResponseTransformer + }); + } + + /** + * @returns ModelWithDates Success + * @throws ApiError + */ + public static modelWithDates(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/model-with-dates', + responseTransformer: ModelWithDatesResponseTransformer + }); + } + + /** + * @returns ModelWithDates Success + * @throws ApiError + */ + public static modelWithDatesArray(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/model-with-dates-array', + responseTransformer: ModelWithDatesArrayResponseTransformer + }); + } + + /** + * @returns string Success + * @throws ApiError + */ + public static arrayOfDates(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/array-of-dates' + }); + } + + /** + * @returns string Success + * @throws ApiError + */ + public static date(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/date' + }); + } + + /** + * @returns ModelWithDates Updated + * @returns SimpleModel Created + * @throws ApiError + */ + public static multipleResponses(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/multiple-responses' + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node_transform/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_node_transform/types.gen.ts new file mode 100644 index 000000000..8c9227850 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_node_transform/types.gen.ts @@ -0,0 +1,106 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * This is a model that contains a some dates + */ +export type ModelWithDates = { + id: number; + name: string; + readonly enabled: boolean; + readonly modified: Date; + readonly expires?: Date; +}; + +/** + * This is a model that contains a some dates and arrays + */ +export type ParentModelWithDates = { + id: number; + readonly modified?: Date; + items?: Array; + item?: ModelWithDates; + 'nullable-date'?: Array<(Date | null)>; + simpleItems?: Array; + simpleItem?: SimpleModel; + dates?: Array<(Date)>; + strings?: Array<(string)>; +}; + +/** + * This is a model that contains a some dates + */ +export type SimpleModel = { + id: number; + name: string; + readonly enabled: boolean; +}; + +export type ParentModelWithDatesResponse = (ParentModelWithDates | unknown); + +export type ModelWithDatesResponse = (ModelWithDates); + +export type ModelWithDatesArrayResponse = (Array); + +export type ArrayOfDatesResponse = (Array<(Date)>); + +export type DateResponse = (Date); + +export type MultipleResponsesResponse = (Array | Array); + +export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; + +export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; + +export type ModelWithDatesModelResponseTransformer = (data: any) => ModelWithDates; + +export const ModelWithDatesModelResponseTransformer: ModelWithDatesModelResponseTransformer = data => { + if (data?.modified) { + data.modified = new Date(data.modified); + } + if (data?.expires) { + data.expires = new Date(data.expires); + } + return data; +}; + +export const ParentModelWithDatesModelResponseTransformer: ParentModelWithDatesModelResponseTransformer = data => { + if (data?.modified) { + data.modified = new Date(data.modified); + } + if (Array.isArray(data?.items)) { + data.items.forEach(ModelWithDatesModelResponseTransformer); + } + if (data?.item) { + ModelWithDatesModelResponseTransformer(data.item); + } + if (Array.isArray(data?.['nullable-date'])) { + data['nullable-date'] = data['nullable-date'].map(item => item ? new Date(item) : item); + } + if (Array.isArray(data?.dates)) { + data.dates = data.dates.map(item => item ? new Date(item) : item); + } + return data; +}; + +export const ParentModelWithDatesResponseTransformer: ParentModelWithDatesResponseTransformer = async (data) => { + if (data) { + ParentModelWithDatesModelResponseTransformer(data); + } + return data; +}; + +export type ModelWithDatesResponseTransformer = (data: any) => Promise; + +export const ModelWithDatesResponseTransformer: ModelWithDatesResponseTransformer = async (data) => { + ModelWithDatesModelResponseTransformer(data); + return data; +}; + +export type ModelWithDatesArrayResponseTransformer = (data: any) => Promise; + +export const ModelWithDatesArrayResponseTransformer: ModelWithDatesArrayResponseTransformer = async (data) => { + if (Array.isArray(data)) { + data.forEach(ModelWithDatesModelResponseTransformer); + } + return data; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_options/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_options/core/ApiError.ts new file mode 100644 index 000000000..36675d288 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_options/core/ApiError.ts @@ -0,0 +1,21 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; + +export class ApiError extends Error { + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: unknown; + public readonly request: ApiRequestOptions; + + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); + + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_options/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_options/core/ApiRequestOptions.ts new file mode 100644 index 000000000..939a0aa4c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_options/core/ApiRequestOptions.ts @@ -0,0 +1,21 @@ +export type ApiRequestOptions = { + readonly body?: any; + readonly cookies?: Record; + readonly errors?: Record; + readonly formData?: Record | any[] | Blob | File; + readonly headers?: Record; + readonly mediaType?: string; + readonly method: + | 'DELETE' + | 'GET' + | 'HEAD' + | 'OPTIONS' + | 'PATCH' + | 'POST' + | 'PUT'; + readonly path?: Record; + readonly query?: Record; + readonly responseHeader?: string; + readonly responseTransformer?: (data: unknown) => Promise; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_options/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_options/core/ApiResult.ts new file mode 100644 index 000000000..4c58e3913 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_options/core/ApiResult.ts @@ -0,0 +1,7 @@ +export type ApiResult = { + readonly body: TData; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_options/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_options/core/CancelablePromise.ts new file mode 100644 index 000000000..ccc082e8f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_options/core/CancelablePromise.ts @@ -0,0 +1,126 @@ +export class CancelError extends Error { + constructor(message: string) { + super(message); + this.name = 'CancelError'; + } + + public get isCancelled(): boolean { + return true; + } +} + +export interface OnCancel { + readonly isResolved: boolean; + readonly isRejected: boolean; + readonly isCancelled: boolean; + + (cancelHandler: () => void): void; +} + +export class CancelablePromise implements Promise { + private _isResolved: boolean; + private _isRejected: boolean; + private _isCancelled: boolean; + readonly cancelHandlers: (() => void)[]; + readonly promise: Promise; + private _resolve?: (value: T | PromiseLike) => void; + private _reject?: (reason?: unknown) => void; + + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason?: unknown) => void, + onCancel: OnCancel + ) => void + ) { + this._isResolved = false; + this._isRejected = false; + this._isCancelled = false; + this.cancelHandlers = []; + this.promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + + const onResolve = (value: T | PromiseLike): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isResolved = true; + if (this._resolve) this._resolve(value); + }; + + const onReject = (reason?: unknown): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isRejected = true; + if (this._reject) this._reject(reason); + }; + + const onCancel = (cancelHandler: () => void): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this.cancelHandlers.push(cancelHandler); + }; + + Object.defineProperty(onCancel, 'isResolved', { + get: (): boolean => this._isResolved, + }); + + Object.defineProperty(onCancel, 'isRejected', { + get: (): boolean => this._isRejected, + }); + + Object.defineProperty(onCancel, 'isCancelled', { + get: (): boolean => this._isCancelled, + }); + + return executor(onResolve, onReject, onCancel as OnCancel); + }); + } + + get [Symbol.toStringTag]() { + return "Cancellable Promise"; + } + + public then( + onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null + ): Promise { + return this.promise.then(onFulfilled, onRejected); + } + + public catch( + onRejected?: ((reason: unknown) => TResult | PromiseLike) | null + ): Promise { + return this.promise.catch(onRejected); + } + + public finally(onFinally?: (() => void) | null): Promise { + return this.promise.finally(onFinally); + } + + public cancel(): void { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isCancelled = true; + if (this.cancelHandlers.length) { + try { + for (const cancelHandler of this.cancelHandlers) { + cancelHandler(); + } + } catch (error) { + console.warn('Cancellation threw an error', error); + return; + } + } + this.cancelHandlers.length = 0; + if (this._reject) this._reject(new CancelError('Request aborted')); + } + + public get isCancelled(): boolean { + return this._isCancelled; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_options/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_options/core/OpenAPI.ts new file mode 100644 index 000000000..144e25744 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_options/core/OpenAPI.ts @@ -0,0 +1,56 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; + +type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware): void { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Middleware): void { + this._fns = [...this._fns, fn]; + } +} + +export type OpenAPIConfig = { + BASE: string; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + VERSION: string; + WITH_CREDENTIALS: boolean; + interceptors: { + request: Interceptors; + response: Interceptors; + }; +}; + +export const OpenAPI: OpenAPIConfig = { + BASE: 'http://localhost:3000/base', + CREDENTIALS: 'include', + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + TOKEN: undefined, + USERNAME: undefined, + VERSION: '1.0', + WITH_CREDENTIALS: false, + interceptors: { + request: new Interceptors(), + response: new Interceptors(), + }, +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_options/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_options/core/request.ts new file mode 100644 index 000000000..5458a2899 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_options/core/request.ts @@ -0,0 +1,350 @@ +import { ApiError } from './ApiError'; +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; +import { CancelablePromise } from './CancelablePromise'; +import type { OnCancel } from './CancelablePromise'; +import type { OpenAPIConfig } from './OpenAPI'; + +export const isString = (value: unknown): value is string => { + return typeof value === 'string'; +}; + +export const isStringWithValue = (value: unknown): value is string => { + return isString(value) && value !== ''; +}; + +export const isBlob = (value: any): value is Blob => { + return value instanceof Blob; +}; + +export const isFormData = (value: unknown): value is FormData => { + return value instanceof FormData; +}; + +export const base64 = (str: string): string => { + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } +}; + +export const getQueryString = (params: Record): string => { + const qs: string[] = []; + + const append = (key: string, value: unknown) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; + + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; + } + + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { + value.forEach(v => encodePair(key, v)); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); + } + }; + + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); + + return qs.length ? `?${qs.join('&')}` : ''; +}; + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI; + + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); + + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; +}; + +export const getFormData = (options: ApiRequestOptions): FormData | undefined => { + if (options.formData) { + const formData = new FormData(); + + const process = (key: string, value: unknown) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; + + Object.entries(options.formData) + .filter(([, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); + + return formData; + } + return undefined; +}; + +type Resolver = (options: ApiRequestOptions) => Promise; + +export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; +}; + +export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { + const [token, username, password, additionalHeaders] = await Promise.all([ + // @ts-ignore + resolve(options, config.TOKEN), + // @ts-ignore + resolve(options, config.USERNAME), + // @ts-ignore + resolve(options, config.PASSWORD), + // @ts-ignore + resolve(options, config.HEADERS), + ]); + + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + }) + .filter(([, value]) => value !== undefined && value !== null) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); + + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } + + return new Headers(headers); +}; + +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body !== undefined) { + if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { + return JSON.stringify(options.body); + } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { + return options.body; + } else { + return JSON.stringify(options.body); + } + } + return undefined; +}; + +export const sendRequest = async ( + config: OpenAPIConfig, + options: ApiRequestOptions, + url: string, + body: any, + formData: FormData | undefined, + headers: Headers, + onCancel: OnCancel +): Promise => { + const controller = new AbortController(); + + let request: RequestInit = { + headers, + body: body ?? formData, + method: options.method, + signal: controller.signal, + }; + + if (config.WITH_CREDENTIALS) { + request.credentials = config.CREDENTIALS; + } + + for (const fn of config.interceptors.request._fns) { + request = await fn(request); + } + + onCancel(() => controller.abort()); + + return await fetch(url, request); +}; + +export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { + if (responseHeader) { + const content = response.headers.get(responseHeader); + if (isString(content)) { + return content; + } + } + return undefined; +}; + +export const getResponseBody = async (response: Response): Promise => { + if (response.status !== 204) { + try { + const contentType = response.headers.get('Content-Type'); + if (contentType) { + const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; + if (contentType.includes('application/json') || contentType.includes('+json')) { + return await response.json(); + } else if (binaryTypes.some(type => contentType.includes(type))) { + return await response.blob(); + } else if (contentType.includes('multipart/form-data')) { + return await response.formData(); + } else if (contentType.includes('text/')) { + return await response.text(); + } + } + } catch (error) { + console.error(error); + } + } + return undefined; +}; + +export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Payload Too Large', + 414: 'URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Range Not Satisfiable', + 417: 'Expectation Failed', + 418: 'Im a teapot', + 421: 'Misdirected Request', + 422: 'Unprocessable Content', + 423: 'Locked', + 424: 'Failed Dependency', + 425: 'Too Early', + 426: 'Upgrade Required', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', + 451: 'Unavailable For Legal Reasons', + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 508: 'Loop Detected', + 510: 'Not Extended', + 511: 'Network Authentication Required', + ...options.errors, + } + + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } + + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } +}; + +/** + * Request method + * @param config The OpenAPI configuration object + * @param options The request options from the service + * @returns CancelablePromise + * @throws ApiError + */ +export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { + return new CancelablePromise(async (resolve, reject, onCancel) => { + try { + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); + const headers = await getHeaders(config, options); + + if (!onCancel.isCancelled) { + let response = await sendRequest(config, options, url, body, formData, headers, onCancel); + + for (const fn of config.interceptors.response._fns) { + response = await fn(response); + } + + const responseBody = await getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + + let transformedBody = responseBody; + if (options.responseTransformer && response.ok) { + transformedBody = await options.responseTransformer(responseBody) + } + + const result: ApiResult = { + url, + ok: response.ok, + status: response.status, + statusText: response.statusText, + body: responseHeader ?? transformedBody, + }; + + catchErrorCodes(options, result); + + resolve(result.body); + } + } catch (error) { + reject(error); + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_options/index.ts b/packages/openapi-ts-tests/test/generated/v3_options/index.ts new file mode 100644 index 000000000..50a1dd734 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_options/index.ts @@ -0,0 +1,6 @@ +// This file is auto-generated by @hey-api/openapi-ts +export { ApiError } from './core/ApiError'; +export { CancelablePromise, CancelError } from './core/CancelablePromise'; +export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_options/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_options/sdk.gen.ts new file mode 100644 index 000000000..5ba5878ab --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_options/sdk.gen.ts @@ -0,0 +1,84 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CancelablePromise } from './core/CancelablePromise'; +import { OpenAPI } from './core/OpenAPI'; +import { request as __request } from './core/request'; +import type { CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData } from './types.gen'; + +export class DefaultsService { + /** + * @param data The data for the request. + * @param data.parameterString This is a simple string with default value + * @param data.parameterNumber This is a simple number with default value + * @param data.parameterBoolean This is a simple boolean with default value + * @param data.parameterEnum This is a simple enum with default value + * @param data.parameterModel This is a simple model with default value + * @throws ApiError + */ + public static callWithDefaultParameters(data: CallWithDefaultParametersData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterString This is a simple string that is optional with default value + * @param data.parameterNumber This is a simple number that is optional with default value + * @param data.parameterBoolean This is a simple boolean that is optional with default value + * @param data.parameterEnum This is a simple enum that is optional with default value + * @param data.parameterModel This is a simple model that is optional with default value + * @throws ApiError + */ + public static callWithDefaultOptionalParameters(data: CallWithDefaultOptionalParametersData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterStringWithNoDefault This is a string with no default + * @param data.parameterOptionalStringWithDefault This is a optional string with default + * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default + * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default + * @param data.parameterStringWithDefault This is a string with default + * @param data.parameterStringWithEmptyDefault This is a string with empty default + * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default + * @param data.parameterStringNullableWithDefault This is a string that can be null with default + * @throws ApiError + */ + public static callToTestOrderOfParams(data: CallToTestOrderOfParamsData): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/defaults', + query: { + parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, + parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, + parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, + parameterStringWithDefault: data.parameterStringWithDefault, + parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, + parameterStringWithNoDefault: data.parameterStringWithNoDefault, + parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, + parameterStringNullableWithDefault: data.parameterStringNullableWithDefault + } + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_options/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_options/types.gen.ts new file mode 100644 index 000000000..3ee5e285c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_options/types.gen.ts @@ -0,0 +1,102 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +export type CallWithDefaultParametersData = { + /** + * This is a simple boolean with default value + */ + parameterBoolean?: (boolean) | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: (ModelWithString) | null; + /** + * This is a simple number with default value + */ + parameterNumber?: (number) | null; + /** + * This is a simple string with default value + */ + parameterString?: (string) | null; +}; + +export type CallWithDefaultOptionalParametersData = { + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; +}; + +export type CallToTestOrderOfParamsData = { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: (string) | null; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: (string) | null; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_services_filter/index.ts b/packages/openapi-ts-tests/test/generated/v3_services_filter/index.ts new file mode 100644 index 000000000..81abc8221 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_services_filter/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_services_filter/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_services_filter/sdk.gen.ts new file mode 100644 index 000000000..ab8cd7396 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_services_filter/sdk.gen.ts @@ -0,0 +1,75 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CancelablePromise } from './core/CancelablePromise'; +import { OpenAPI } from './core/OpenAPI'; +import { request as __request } from './core/request'; + +/** + * @throws ApiError + */ +export const getCallWithoutParametersAndResponse = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple' + }); +}; + +/** + * @throws ApiError + */ +export const putCallWithoutParametersAndResponse = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/simple' + }); +}; + +/** + * @throws ApiError + */ +export const postCallWithoutParametersAndResponse = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/simple' + }); +}; + +/** + * @throws ApiError + */ +export const deleteCallWithoutParametersAndResponse = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/simple' + }); +}; + +/** + * @throws ApiError + */ +export const optionsCallWithoutParametersAndResponse = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'OPTIONS', + url: '/api/v{api-version}/simple' + }); +}; + +/** + * @throws ApiError + */ +export const headCallWithoutParametersAndResponse = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'HEAD', + url: '/api/v{api-version}/simple' + }); +}; + +/** + * @throws ApiError + */ +export const patchCallWithoutParametersAndResponse = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v{api-version}/simple' + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_services_filter/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_services_filter/types.gen.ts new file mode 100644 index 000000000..0147d27ac --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_services_filter/types.gen.ts @@ -0,0 +1,1090 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _3e_num_1Период = 'Bird' | 'Dog'; + +export const _3e_num_1Период = { + BIRD: 'Bird', + DOG: 'Dog' +} as const; + +/** + * Model with number-only name + */ +export type _400 = string; + +export type _default = { + name?: string; +}; + +/** + * Model with restricted keyword name + */ +export type _import = string; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: (number) | undefined; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AnyOfAnyAndNull = { + data?: (unknown | null); +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<({ + foo?: string; +} | { + bar?: string; +})>; +}; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<({ + foo?: string; +} | { + bar?: string; +})>; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array<(boolean)>; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array<(number)>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: camelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array<(string)>; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type camelCaseCommentWithBreaks = number; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + firstName: string; + lastname: string; + age: number; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: (({ + boolean?: boolean; +} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: (Array<(_3e_num_1Период | ConstValue)> | null); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(number | string)>; +}); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: ParameterSimpleParameter; +} | { + bar: NonAsciiStringæøåÆØÅöôêÊ字符串; +}) & { + baz: (number) | null; + qux: number; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(boolean)>; +}); +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: (boolean | { + [key: string]: (number); +}); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; + +export type ConstValue = "ConstValue"; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: (string); + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: (string | number | boolean) | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: (string); +}; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple enum with numbers + */ +export const EnumWithExtensions = { + /** + * Used when the status of something is successful + */ + CUSTOM_SUCCESS: 200, + /** + * Used when the status of something has a warning + */ + CUSTOM_WARNING: 400, + /** + * Used when the status of something has an error + */ + CUSTOM_ERROR: 500 +} as const; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * This is a simple enum with numbers + */ +export const EnumWithNumbers = { + '_1': 1, + '_2': 2, + '_3': 3, + '_1.1': 1.1, + '_1.2': 1.2, + '_1.3': 1.3, + '_100': 100, + '_200': 200, + '_300': 300, + '_-100': -100, + '_-200': -200, + '_-300': -300, + '_-1.1': -1.1, + '_-1.2': -1.2, + '_-1.3': -1.3 +} as const; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +export const EnumWithReplacedCharacters = { + _SINGLE_QUOTE_: "'Single Quote'", + _DOUBLE_QUOTES_: '"Double Quotes"', + 'ØÆÅÔÖ_ØÆÅÔÖ字符串': 'øæåôöØÆÅÔÖ字符串', + '_3.1': 3.1, + EMPTY_STRING: '' +} as const; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with strings + */ +export const EnumWithStrings = { + SUCCESS: 'Success', + WARNING: 'Warning', + ERROR: 'Error', + _SINGLE_QUOTE_: "'Single Quote'", + _DOUBLE_QUOTES_: '"Double Quotes"', + 'NON_ASCII__ØÆÅÔÖ_ØÆÅÔÖ字符串': 'Non-ascii: øæåôöØÆÅÔÖ字符串' +} as const; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +export const EnumWithXEnumNames = { + zero: 0, + one: 1, + two: 2 +} as const; + +export type File = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { + item?: boolean; + error?: (string) | null; + readonly hasError?: boolean; + data?: { + [key: string]: unknown; + }; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_String_ = { + item?: (string) | null; + error?: (string) | null; + readonly hasError?: boolean; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type Model_From_Zendesk = string; + +/** + * Circle + */ +export type ModelCircle = { + kind: 'circle'; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: 'square'; + sideLength?: number; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string; +}; + +export type ModelWithAnyOfConstantSizeArray = [ + (number | string), + (number | string), + (number | string) +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + (number & string), + (number & string) +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + ((number) | null | string), + ((number) | null | string), + ((number) | null | string) +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + (number | _import), + (number | _import) +]; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnly = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +export type ModelWithConst = { + String?: "String"; + number?: 0; + null?: null; + withType?: "Some string"; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: (string); + }; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: boolean; +}; + +/** + * This is a simple enum with strings + */ +export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + +/** + * This is a simple enum with strings + */ +export const foo_bar_enum = { + SUCCESS: 'Success', + WARNING: 'Warning', + ERROR: 'Error', + 'ØÆÅ字符串': 'ØÆÅ字符串' +} as const; + +/** + * These are the HTTP error code enums + */ +export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + +/** + * These are the HTTP error code enums + */ +export const statusCode = { + _100: '100', + _200_FOO: '200 FOO', + _300_FOO_BAR: '300 FOO_BAR', + _400_FOO_BAR: '400 foo-bar', + _500_FOO_BAR: '500 foo.bar', + _600_FOO_BAR: '600 foo&bar' +} as const; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +export type foo_bar_baz_qux = '3.0'; + +export const foo_bar_baz_qux = { + _3_0: '3.0' +} as const; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array<(string)>; + data?: (ModelWithNestedArrayEnumsData); +}; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export const ModelWithNestedArrayEnumsDataBar = { + BAZ: 'baz', + QUX: 'qux' +} as const; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export const ModelWithNestedArrayEnumsDataFoo = { + FOO: 'foo', + BAR: 'bar' +} as const; + +export type ModelWithNestedCompositionEnums = { + foo?: (ModelWithNestedArrayEnumsDataFoo); +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: ('Success' | 'Warning' | 'Error'); + }; + dictionaryWithEnumFromDescription?: { + [key: string]: (number); + }; + arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; + arrayWithDescription?: Array<(number)>; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedProperties = { + readonly first: { + readonly second: { + readonly third: (string) | null; + } | null; + } | null; +}; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: (string) | null; + /** + * This is a simple string property + */ + nullableProp2?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: (string) | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Период + */ +export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; + +/** + * Период + */ +export const value = { + '_-10': -10, + '_-1': -1, + '_0': 0, + '_1': 1, + '_3': 3, + '_6': 6, + '_12': 12 +} as const; + +export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { + baz: (number) | null; + qux: number; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + (string), + (string) + ]; + foo: 'Corge'; +}; + +export type foo = 'Bar'; + +export const foo = { + BAR: 'Bar' +} as const; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPattern = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + (number | string), + string +]; + +/** + * This is a model with one nested property + */ +export type ModelWithProperties = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: (string) | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +export type ModelWithReadOnlyAndWriteOnly = { + foo: string; + readonly bar: string; + baz: string; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReference = { + prop?: ModelWithProperties; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: (Array<(string | boolean)> | null); +}; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array<(string)>; +}; + +/** + * This is a reusable parameter + */ +export type ParameterSimpleParameter = string; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Parameter with illegal characters + */ +export type Parameterx_Foo_Bar = ModelWithString; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<({ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; +})>; +}; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple file + */ +export type SimpleFile = (Blob | File); + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = (string) | null; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_services_name/index.ts b/packages/openapi-ts-tests/test/generated/v3_services_name/index.ts new file mode 100644 index 000000000..81abc8221 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_services_name/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_services_name/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_services_name/sdk.gen.ts new file mode 100644 index 000000000..9e9e50323 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_services_name/sdk.gen.ts @@ -0,0 +1,222 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CancelablePromise } from './core/CancelablePromise'; +import { OpenAPI } from './core/OpenAPI'; +import { request as __request } from './core/request'; +import type { DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, ApiVVersionODataControllerCountResponse } from './types.gen'; + +export class myAwesomeParametersApi { + /** + * @param data The data for the request. + * @param data.fooParam foo in method + * @param data.barParam bar in method + * @param data.xFooBar Parameter with illegal characters + * @throws ApiError + */ + public static deleteFoo(data: DeleteFooData3): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + path: { + foo_param: data.fooParam, + BarParam: data.barParam + }, + headers: { + 'x-Foo-Bar': data.xFooBar + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the header + * @param data.fooAllOfEnum + * @param data.cursor This is the parameter that goes into the query params + * @param data.parameterCookie This is the parameter that goes into the cookie + * @param data.parameterPath This is the parameter that goes into the path + * @param data.requestBody This is the parameter that goes into the body + * @param data.fooRefEnum + * @throws ApiError + */ + public static callWithParameters(data: CallWithParametersData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/{parameterPath}', + path: { + parameterPath: data.parameterPath + }, + cookies: { + parameterCookie: data.parameterCookie + }, + headers: { + parameterHeader: data.parameterHeader + }, + query: { + foo_ref_enum: data.fooRefEnum, + foo_all_of_enum: data.fooAllOfEnum, + cursor: data.cursor + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the request header + * @param data.parameterQuery This is the parameter that goes into the request query params + * @param data.parameterCookie This is the parameter that goes into the cookie + * @param data.requestBody This is the parameter that goes into the body + * @param data.parameterPath1 This is the parameter that goes into the path + * @param data.parameterPath2 This is the parameter that goes into the path + * @param data.parameterPath3 This is the parameter that goes into the path + * @param data._default This is the parameter with a reserved keyword + * @throws ApiError + */ + public static callWithWeirdParameterNames(data: CallWithWeirdParameterNamesData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + path: { + 'parameter.path.1': data.parameterPath1, + 'parameter-path-2': data.parameterPath2, + 'PARAMETER-PATH-3': data.parameterPath3 + }, + cookies: { + 'PARAMETER-COOKIE': data.parameterCookie + }, + headers: { + 'parameter.header': data.parameterHeader + }, + query: { + default: data._default, + 'parameter-query': data.parameterQuery + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.requestBody This is a required parameter + * @param data.page This is an optional parameter + * @throws ApiError + */ + public static getCallWithOptionalParam(data: GetCallWithOptionalParamData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/parameters/', + query: { + page: data.page + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.parameter This is a required parameter + * @param data.requestBody This is an optional parameter + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public static postCallWithOptionalParam(data: PostCallWithOptionalParamData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/', + query: { + parameter: data.parameter + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + +} + +export class myAwesomeSimpleApi { + /** + * @returns Model_From_Zendesk Success + * @throws ApiError + */ + public static apiVVersionODataControllerCount(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple/$count' + }); + } + + /** + * @throws ApiError + */ + public static getCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static putCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static postCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static deleteCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static optionsCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'OPTIONS', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static headCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'HEAD', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static patchCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v{api-version}/simple' + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_services_name/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_services_name/types.gen.ts new file mode 100644 index 000000000..4f5dc013c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_services_name/types.gen.ts @@ -0,0 +1,1195 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _3e_num_1Период = 'Bird' | 'Dog'; + +export const _3e_num_1Период = { + BIRD: 'Bird', + DOG: 'Dog' +} as const; + +/** + * Model with number-only name + */ +export type _400 = string; + +export type _default = { + name?: string; +}; + +/** + * Model with restricted keyword name + */ +export type _import = string; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: (number) | undefined; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AnyOfAnyAndNull = { + data?: (unknown | null); +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<({ + foo?: string; +} | { + bar?: string; +})>; +}; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<({ + foo?: string; +} | { + bar?: string; +})>; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array<(boolean)>; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array<(number)>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: camelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array<(string)>; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type camelCaseCommentWithBreaks = number; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + firstName: string; + lastname: string; + age: number; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: (({ + boolean?: boolean; +} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: (Array<(_3e_num_1Период | ConstValue)> | null); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(number | string)>; +}); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: ParameterSimpleParameter; +} | { + bar: NonAsciiStringæøåÆØÅöôêÊ字符串; +}) & { + baz: (number) | null; + qux: number; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(boolean)>; +}); +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: (boolean | { + [key: string]: (number); +}); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; + +export type ConstValue = "ConstValue"; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: (string); + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: (string | number | boolean) | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: (string); +}; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple enum with numbers + */ +export const EnumWithExtensions = { + /** + * Used when the status of something is successful + */ + CUSTOM_SUCCESS: 200, + /** + * Used when the status of something has a warning + */ + CUSTOM_WARNING: 400, + /** + * Used when the status of something has an error + */ + CUSTOM_ERROR: 500 +} as const; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * This is a simple enum with numbers + */ +export const EnumWithNumbers = { + '_1': 1, + '_2': 2, + '_3': 3, + '_1.1': 1.1, + '_1.2': 1.2, + '_1.3': 1.3, + '_100': 100, + '_200': 200, + '_300': 300, + '_-100': -100, + '_-200': -200, + '_-300': -300, + '_-1.1': -1.1, + '_-1.2': -1.2, + '_-1.3': -1.3 +} as const; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +export const EnumWithReplacedCharacters = { + _SINGLE_QUOTE_: "'Single Quote'", + _DOUBLE_QUOTES_: '"Double Quotes"', + 'ØÆÅÔÖ_ØÆÅÔÖ字符串': 'øæåôöØÆÅÔÖ字符串', + '_3.1': 3.1, + EMPTY_STRING: '' +} as const; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with strings + */ +export const EnumWithStrings = { + SUCCESS: 'Success', + WARNING: 'Warning', + ERROR: 'Error', + _SINGLE_QUOTE_: "'Single Quote'", + _DOUBLE_QUOTES_: '"Double Quotes"', + 'NON_ASCII__ØÆÅÔÖ_ØÆÅÔÖ字符串': 'Non-ascii: øæåôöØÆÅÔÖ字符串' +} as const; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +export const EnumWithXEnumNames = { + zero: 0, + one: 1, + two: 2 +} as const; + +export type File = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { + item?: boolean; + error?: (string) | null; + readonly hasError?: boolean; + data?: { + [key: string]: unknown; + }; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_String_ = { + item?: (string) | null; + error?: (string) | null; + readonly hasError?: boolean; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type Model_From_Zendesk = string; + +/** + * Circle + */ +export type ModelCircle = { + kind: 'circle'; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: 'square'; + sideLength?: number; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string; +}; + +export type ModelWithAnyOfConstantSizeArray = [ + (number | string), + (number | string), + (number | string) +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + (number & string), + (number & string) +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + ((number) | null | string), + ((number) | null | string), + ((number) | null | string) +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + (number | _import), + (number | _import) +]; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnly = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +export type ModelWithConst = { + String?: "String"; + number?: 0; + null?: null; + withType?: "Some string"; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: (string); + }; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: boolean; +}; + +/** + * This is a simple enum with strings + */ +export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + +/** + * This is a simple enum with strings + */ +export const foo_bar_enum = { + SUCCESS: 'Success', + WARNING: 'Warning', + ERROR: 'Error', + 'ØÆÅ字符串': 'ØÆÅ字符串' +} as const; + +/** + * These are the HTTP error code enums + */ +export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + +/** + * These are the HTTP error code enums + */ +export const statusCode = { + _100: '100', + _200_FOO: '200 FOO', + _300_FOO_BAR: '300 FOO_BAR', + _400_FOO_BAR: '400 foo-bar', + _500_FOO_BAR: '500 foo.bar', + _600_FOO_BAR: '600 foo&bar' +} as const; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +export type foo_bar_baz_qux = '3.0'; + +export const foo_bar_baz_qux = { + _3_0: '3.0' +} as const; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array<(string)>; + data?: (ModelWithNestedArrayEnumsData); +}; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export const ModelWithNestedArrayEnumsDataBar = { + BAZ: 'baz', + QUX: 'qux' +} as const; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export const ModelWithNestedArrayEnumsDataFoo = { + FOO: 'foo', + BAR: 'bar' +} as const; + +export type ModelWithNestedCompositionEnums = { + foo?: (ModelWithNestedArrayEnumsDataFoo); +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: ('Success' | 'Warning' | 'Error'); + }; + dictionaryWithEnumFromDescription?: { + [key: string]: (number); + }; + arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; + arrayWithDescription?: Array<(number)>; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedProperties = { + readonly first: { + readonly second: { + readonly third: (string) | null; + } | null; + } | null; +}; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: (string) | null; + /** + * This is a simple string property + */ + nullableProp2?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: (string) | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Период + */ +export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; + +/** + * Период + */ +export const value = { + '_-10': -10, + '_-1': -1, + '_0': 0, + '_1': 1, + '_3': 3, + '_6': 6, + '_12': 12 +} as const; + +export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { + baz: (number) | null; + qux: number; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + (string), + (string) + ]; + foo: 'Corge'; +}; + +export type foo = 'Bar'; + +export const foo = { + BAR: 'Bar' +} as const; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPattern = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + (number | string), + string +]; + +/** + * This is a model with one nested property + */ +export type ModelWithProperties = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: (string) | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +export type ModelWithReadOnlyAndWriteOnly = { + foo: string; + readonly bar: string; + baz: string; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReference = { + prop?: ModelWithProperties; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: (Array<(string | boolean)> | null); +}; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array<(string)>; +}; + +/** + * This is a reusable parameter + */ +export type ParameterSimpleParameter = string; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Parameter with illegal characters + */ +export type Parameterx_Foo_Bar = ModelWithString; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<({ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; +})>; +}; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple file + */ +export type SimpleFile = (Blob | File); + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = (string) | null; + +export type DeleteFooData3 = { + /** + * bar in method + */ + barParam: string; + /** + * foo in method + */ + fooParam: string; + /** + * Parameter with illegal characters + */ + xFooBar: ModelWithString; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the query params + */ + cursor: (string) | null; + fooAllOfEnum: (ModelWithNestedArrayEnumsDataFoo); + fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the cookie + */ + parameterCookie: (string) | null; + /** + * This is the parameter that goes into the header + */ + parameterHeader: (string) | null; + /** + * This is the parameter that goes into the path + */ + parameterPath: (string) | null; + /** + * This is the parameter that goes into the body + */ + requestBody: { + [key: string]: unknown; + } | null; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter with a reserved keyword + */ + _default?: string; + /** + * This is the parameter that goes into the cookie + */ + parameterCookie: (string) | null; + /** + * This is the parameter that goes into the request header + */ + parameterHeader: (string) | null; + /** + * This is the parameter that goes into the path + */ + parameterPath1?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath2?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath3?: string; + /** + * This is the parameter that goes into the request query params + */ + parameterQuery: (string) | null; + /** + * This is the parameter that goes into the body + */ + requestBody: (ModelWithString) | null; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + page?: number; + /** + * This is a required parameter + */ + requestBody: ModelWithOneOfEnum; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is a required parameter + */ + parameter: Pageable; + /** + * This is an optional parameter + */ + requestBody?: { + offset?: (number) | null; + }; +}; + +export type PostCallWithOptionalParamResponse = (number | void); + +export type ApiVVersionODataControllerCountResponse = (Model_From_Zendesk); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_transform/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_transform/core/ApiError.ts new file mode 100644 index 000000000..36675d288 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_transform/core/ApiError.ts @@ -0,0 +1,21 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; + +export class ApiError extends Error { + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: unknown; + public readonly request: ApiRequestOptions; + + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); + + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_transform/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_transform/core/ApiRequestOptions.ts new file mode 100644 index 000000000..939a0aa4c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_transform/core/ApiRequestOptions.ts @@ -0,0 +1,21 @@ +export type ApiRequestOptions = { + readonly body?: any; + readonly cookies?: Record; + readonly errors?: Record; + readonly formData?: Record | any[] | Blob | File; + readonly headers?: Record; + readonly mediaType?: string; + readonly method: + | 'DELETE' + | 'GET' + | 'HEAD' + | 'OPTIONS' + | 'PATCH' + | 'POST' + | 'PUT'; + readonly path?: Record; + readonly query?: Record; + readonly responseHeader?: string; + readonly responseTransformer?: (data: unknown) => Promise; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_transform/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_transform/core/ApiResult.ts new file mode 100644 index 000000000..4c58e3913 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_transform/core/ApiResult.ts @@ -0,0 +1,7 @@ +export type ApiResult = { + readonly body: TData; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_transform/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_transform/core/CancelablePromise.ts new file mode 100644 index 000000000..ccc082e8f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_transform/core/CancelablePromise.ts @@ -0,0 +1,126 @@ +export class CancelError extends Error { + constructor(message: string) { + super(message); + this.name = 'CancelError'; + } + + public get isCancelled(): boolean { + return true; + } +} + +export interface OnCancel { + readonly isResolved: boolean; + readonly isRejected: boolean; + readonly isCancelled: boolean; + + (cancelHandler: () => void): void; +} + +export class CancelablePromise implements Promise { + private _isResolved: boolean; + private _isRejected: boolean; + private _isCancelled: boolean; + readonly cancelHandlers: (() => void)[]; + readonly promise: Promise; + private _resolve?: (value: T | PromiseLike) => void; + private _reject?: (reason?: unknown) => void; + + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason?: unknown) => void, + onCancel: OnCancel + ) => void + ) { + this._isResolved = false; + this._isRejected = false; + this._isCancelled = false; + this.cancelHandlers = []; + this.promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + + const onResolve = (value: T | PromiseLike): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isResolved = true; + if (this._resolve) this._resolve(value); + }; + + const onReject = (reason?: unknown): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isRejected = true; + if (this._reject) this._reject(reason); + }; + + const onCancel = (cancelHandler: () => void): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this.cancelHandlers.push(cancelHandler); + }; + + Object.defineProperty(onCancel, 'isResolved', { + get: (): boolean => this._isResolved, + }); + + Object.defineProperty(onCancel, 'isRejected', { + get: (): boolean => this._isRejected, + }); + + Object.defineProperty(onCancel, 'isCancelled', { + get: (): boolean => this._isCancelled, + }); + + return executor(onResolve, onReject, onCancel as OnCancel); + }); + } + + get [Symbol.toStringTag]() { + return "Cancellable Promise"; + } + + public then( + onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null + ): Promise { + return this.promise.then(onFulfilled, onRejected); + } + + public catch( + onRejected?: ((reason: unknown) => TResult | PromiseLike) | null + ): Promise { + return this.promise.catch(onRejected); + } + + public finally(onFinally?: (() => void) | null): Promise { + return this.promise.finally(onFinally); + } + + public cancel(): void { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isCancelled = true; + if (this.cancelHandlers.length) { + try { + for (const cancelHandler of this.cancelHandlers) { + cancelHandler(); + } + } catch (error) { + console.warn('Cancellation threw an error', error); + return; + } + } + this.cancelHandlers.length = 0; + if (this._reject) this._reject(new CancelError('Request aborted')); + } + + public get isCancelled(): boolean { + return this._isCancelled; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_transform/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_transform/core/OpenAPI.ts new file mode 100644 index 000000000..144e25744 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_transform/core/OpenAPI.ts @@ -0,0 +1,56 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; + +type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware): void { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Middleware): void { + this._fns = [...this._fns, fn]; + } +} + +export type OpenAPIConfig = { + BASE: string; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + VERSION: string; + WITH_CREDENTIALS: boolean; + interceptors: { + request: Interceptors; + response: Interceptors; + }; +}; + +export const OpenAPI: OpenAPIConfig = { + BASE: 'http://localhost:3000/base', + CREDENTIALS: 'include', + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + TOKEN: undefined, + USERNAME: undefined, + VERSION: '1.0', + WITH_CREDENTIALS: false, + interceptors: { + request: new Interceptors(), + response: new Interceptors(), + }, +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_transform/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_transform/core/request.ts new file mode 100644 index 000000000..5458a2899 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_transform/core/request.ts @@ -0,0 +1,350 @@ +import { ApiError } from './ApiError'; +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; +import { CancelablePromise } from './CancelablePromise'; +import type { OnCancel } from './CancelablePromise'; +import type { OpenAPIConfig } from './OpenAPI'; + +export const isString = (value: unknown): value is string => { + return typeof value === 'string'; +}; + +export const isStringWithValue = (value: unknown): value is string => { + return isString(value) && value !== ''; +}; + +export const isBlob = (value: any): value is Blob => { + return value instanceof Blob; +}; + +export const isFormData = (value: unknown): value is FormData => { + return value instanceof FormData; +}; + +export const base64 = (str: string): string => { + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } +}; + +export const getQueryString = (params: Record): string => { + const qs: string[] = []; + + const append = (key: string, value: unknown) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; + + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; + } + + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { + value.forEach(v => encodePair(key, v)); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); + } + }; + + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); + + return qs.length ? `?${qs.join('&')}` : ''; +}; + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI; + + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); + + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; +}; + +export const getFormData = (options: ApiRequestOptions): FormData | undefined => { + if (options.formData) { + const formData = new FormData(); + + const process = (key: string, value: unknown) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; + + Object.entries(options.formData) + .filter(([, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); + + return formData; + } + return undefined; +}; + +type Resolver = (options: ApiRequestOptions) => Promise; + +export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; +}; + +export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { + const [token, username, password, additionalHeaders] = await Promise.all([ + // @ts-ignore + resolve(options, config.TOKEN), + // @ts-ignore + resolve(options, config.USERNAME), + // @ts-ignore + resolve(options, config.PASSWORD), + // @ts-ignore + resolve(options, config.HEADERS), + ]); + + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + }) + .filter(([, value]) => value !== undefined && value !== null) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); + + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } + + return new Headers(headers); +}; + +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body !== undefined) { + if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { + return JSON.stringify(options.body); + } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { + return options.body; + } else { + return JSON.stringify(options.body); + } + } + return undefined; +}; + +export const sendRequest = async ( + config: OpenAPIConfig, + options: ApiRequestOptions, + url: string, + body: any, + formData: FormData | undefined, + headers: Headers, + onCancel: OnCancel +): Promise => { + const controller = new AbortController(); + + let request: RequestInit = { + headers, + body: body ?? formData, + method: options.method, + signal: controller.signal, + }; + + if (config.WITH_CREDENTIALS) { + request.credentials = config.CREDENTIALS; + } + + for (const fn of config.interceptors.request._fns) { + request = await fn(request); + } + + onCancel(() => controller.abort()); + + return await fetch(url, request); +}; + +export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { + if (responseHeader) { + const content = response.headers.get(responseHeader); + if (isString(content)) { + return content; + } + } + return undefined; +}; + +export const getResponseBody = async (response: Response): Promise => { + if (response.status !== 204) { + try { + const contentType = response.headers.get('Content-Type'); + if (contentType) { + const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; + if (contentType.includes('application/json') || contentType.includes('+json')) { + return await response.json(); + } else if (binaryTypes.some(type => contentType.includes(type))) { + return await response.blob(); + } else if (contentType.includes('multipart/form-data')) { + return await response.formData(); + } else if (contentType.includes('text/')) { + return await response.text(); + } + } + } catch (error) { + console.error(error); + } + } + return undefined; +}; + +export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Payload Too Large', + 414: 'URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Range Not Satisfiable', + 417: 'Expectation Failed', + 418: 'Im a teapot', + 421: 'Misdirected Request', + 422: 'Unprocessable Content', + 423: 'Locked', + 424: 'Failed Dependency', + 425: 'Too Early', + 426: 'Upgrade Required', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', + 451: 'Unavailable For Legal Reasons', + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 508: 'Loop Detected', + 510: 'Not Extended', + 511: 'Network Authentication Required', + ...options.errors, + } + + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } + + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } +}; + +/** + * Request method + * @param config The OpenAPI configuration object + * @param options The request options from the service + * @returns CancelablePromise + * @throws ApiError + */ +export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { + return new CancelablePromise(async (resolve, reject, onCancel) => { + try { + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); + const headers = await getHeaders(config, options); + + if (!onCancel.isCancelled) { + let response = await sendRequest(config, options, url, body, formData, headers, onCancel); + + for (const fn of config.interceptors.response._fns) { + response = await fn(response); + } + + const responseBody = await getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + + let transformedBody = responseBody; + if (options.responseTransformer && response.ok) { + transformedBody = await options.responseTransformer(responseBody) + } + + const result: ApiResult = { + url, + ok: response.ok, + status: response.status, + statusText: response.statusText, + body: responseHeader ?? transformedBody, + }; + + catchErrorCodes(options, result); + + resolve(result.body); + } + } catch (error) { + reject(error); + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_transform/index.ts b/packages/openapi-ts-tests/test/generated/v3_transform/index.ts new file mode 100644 index 000000000..50a1dd734 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_transform/index.ts @@ -0,0 +1,6 @@ +// This file is auto-generated by @hey-api/openapi-ts +export { ApiError } from './core/ApiError'; +export { CancelablePromise, CancelError } from './core/CancelablePromise'; +export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_transform/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_transform/sdk.gen.ts new file mode 100644 index 000000000..5211e9979 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_transform/sdk.gen.ts @@ -0,0 +1,80 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CancelablePromise } from './core/CancelablePromise'; +import { OpenAPI } from './core/OpenAPI'; +import { request as __request } from './core/request'; +import { type ParentModelWithDatesResponse, type ModelWithDatesResponse, type ModelWithDatesArrayResponse, type ArrayOfDatesResponse, type DateResponse, type MultipleResponsesResponse, ParentModelWithDatesResponseTransformer, ModelWithDatesResponseTransformer, ModelWithDatesArrayResponseTransformer } from './types.gen'; + +export class DefaultService { + /** + * @returns ParentModelWithDates Success + * @returns unknown Success + * @throws ApiError + */ + public static parentModelWithDates(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/model-with-dates', + responseTransformer: ParentModelWithDatesResponseTransformer + }); + } + + /** + * @returns ModelWithDates Success + * @throws ApiError + */ + public static modelWithDates(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/model-with-dates', + responseTransformer: ModelWithDatesResponseTransformer + }); + } + + /** + * @returns ModelWithDates Success + * @throws ApiError + */ + public static modelWithDatesArray(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/model-with-dates-array', + responseTransformer: ModelWithDatesArrayResponseTransformer + }); + } + + /** + * @returns string Success + * @throws ApiError + */ + public static arrayOfDates(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/array-of-dates' + }); + } + + /** + * @returns string Success + * @throws ApiError + */ + public static date(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/date' + }); + } + + /** + * @returns ModelWithDates Updated + * @returns SimpleModel Created + * @throws ApiError + */ + public static multipleResponses(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/multiple-responses' + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_transform/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_transform/types.gen.ts new file mode 100644 index 000000000..8c9227850 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_transform/types.gen.ts @@ -0,0 +1,106 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * This is a model that contains a some dates + */ +export type ModelWithDates = { + id: number; + name: string; + readonly enabled: boolean; + readonly modified: Date; + readonly expires?: Date; +}; + +/** + * This is a model that contains a some dates and arrays + */ +export type ParentModelWithDates = { + id: number; + readonly modified?: Date; + items?: Array; + item?: ModelWithDates; + 'nullable-date'?: Array<(Date | null)>; + simpleItems?: Array; + simpleItem?: SimpleModel; + dates?: Array<(Date)>; + strings?: Array<(string)>; +}; + +/** + * This is a model that contains a some dates + */ +export type SimpleModel = { + id: number; + name: string; + readonly enabled: boolean; +}; + +export type ParentModelWithDatesResponse = (ParentModelWithDates | unknown); + +export type ModelWithDatesResponse = (ModelWithDates); + +export type ModelWithDatesArrayResponse = (Array); + +export type ArrayOfDatesResponse = (Array<(Date)>); + +export type DateResponse = (Date); + +export type MultipleResponsesResponse = (Array | Array); + +export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; + +export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; + +export type ModelWithDatesModelResponseTransformer = (data: any) => ModelWithDates; + +export const ModelWithDatesModelResponseTransformer: ModelWithDatesModelResponseTransformer = data => { + if (data?.modified) { + data.modified = new Date(data.modified); + } + if (data?.expires) { + data.expires = new Date(data.expires); + } + return data; +}; + +export const ParentModelWithDatesModelResponseTransformer: ParentModelWithDatesModelResponseTransformer = data => { + if (data?.modified) { + data.modified = new Date(data.modified); + } + if (Array.isArray(data?.items)) { + data.items.forEach(ModelWithDatesModelResponseTransformer); + } + if (data?.item) { + ModelWithDatesModelResponseTransformer(data.item); + } + if (Array.isArray(data?.['nullable-date'])) { + data['nullable-date'] = data['nullable-date'].map(item => item ? new Date(item) : item); + } + if (Array.isArray(data?.dates)) { + data.dates = data.dates.map(item => item ? new Date(item) : item); + } + return data; +}; + +export const ParentModelWithDatesResponseTransformer: ParentModelWithDatesResponseTransformer = async (data) => { + if (data) { + ParentModelWithDatesModelResponseTransformer(data); + } + return data; +}; + +export type ModelWithDatesResponseTransformer = (data: any) => Promise; + +export const ModelWithDatesResponseTransformer: ModelWithDatesResponseTransformer = async (data) => { + ModelWithDatesModelResponseTransformer(data); + return data; +}; + +export type ModelWithDatesArrayResponseTransformer = (data: any) => Promise; + +export const ModelWithDatesArrayResponseTransformer: ModelWithDatesArrayResponseTransformer = async (data) => { + if (Array.isArray(data)) { + data.forEach(ModelWithDatesModelResponseTransformer); + } + return data; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_tree_shakeable/index.ts b/packages/openapi-ts-tests/test/generated/v3_tree_shakeable/index.ts new file mode 100644 index 000000000..81abc8221 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_tree_shakeable/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_tree_shakeable/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_tree_shakeable/sdk.gen.ts new file mode 100644 index 000000000..01dbca473 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_tree_shakeable/sdk.gen.ts @@ -0,0 +1,799 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CancelablePromise } from './core/CancelablePromise'; +import { OpenAPI } from './core/OpenAPI'; +import { request as __request } from './core/request'; +import type { PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, ApiVVersionODataControllerCountResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, PostApiFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, DummyAResponse, DummyBResponse, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartRequestData, MultipartResponseResponse, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderResponse, TestErrorCodeData, TestErrorCodeResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; + +/** + * @throws ApiError + */ +export const export_ = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/no+tag' + }); +}; + +/** + * @returns unknown OK + * @throws ApiError + */ +export const patchApiNoTag = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v{api-version}/no+tag' + }); +}; + +/** + * @param data The data for the request. + * @param data.requestBody + * @returns Model_From_Zendesk Success + * @returns ModelWithReadOnlyAndWriteOnly Default success response + * @throws ApiError + */ +export const import_ = (data: ImportData): CancelablePromise => { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/no+tag', + body: data.requestBody, + mediaType: 'application/json' + }); +}; + +/** + * @returns unknown OK + * @throws ApiError + */ +export const fooWow = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/no+tag' + }); +}; + +/** + * @returns Model_From_Zendesk Success + * @throws ApiError + */ +export const apiVVersionODataControllerCount = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple/$count' + }); +}; + +/** + * @param data The data for the request. + * @param data.fooParam foo in method + * @returns number Response is a simple number + * @throws ApiError + */ +export const getApiSimpleOperation = (data: GetApiSimpleOperationData): CancelablePromise => { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple:operation', + path: { + foo_param: data.fooParam + }, + errors: { + default: 'Default error response' + } + }); +}; + +/** + * @throws ApiError + */ +export const getCallWithoutParametersAndResponse = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple' + }); +}; + +/** + * @throws ApiError + */ +export const putCallWithoutParametersAndResponse = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/simple' + }); +}; + +/** + * @throws ApiError + */ +export const postCallWithoutParametersAndResponse = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/simple' + }); +}; + +/** + * @throws ApiError + */ +export const deleteCallWithoutParametersAndResponse = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/simple' + }); +}; + +/** + * @throws ApiError + */ +export const optionsCallWithoutParametersAndResponse = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'OPTIONS', + url: '/api/v{api-version}/simple' + }); +}; + +/** + * @throws ApiError + */ +export const headCallWithoutParametersAndResponse = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'HEAD', + url: '/api/v{api-version}/simple' + }); +}; + +/** + * @throws ApiError + */ +export const patchCallWithoutParametersAndResponse = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v{api-version}/simple' + }); +}; + +/** + * @param data The data for the request. + * @param data.fooParam foo in method + * @param data.barParam bar in method + * @param data.xFooBar Parameter with illegal characters + * @throws ApiError + */ +export const deleteFoo = (data: DeleteFooData3): CancelablePromise => { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + path: { + foo_param: data.fooParam, + BarParam: data.barParam + }, + headers: { + 'x-Foo-Bar': data.xFooBar + } + }); +}; + +/** + * @param data The data for the request. + * @param data.parameterWithBreaks Testing multiline comments in string: First line + * Second line + * + * Fourth line + * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work + * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work + * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work + * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work + * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work + * @throws ApiError + */ +export const callWithDescriptions = (data: CallWithDescriptionsData = {}): CancelablePromise => { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/descriptions/', + query: { + parameterWithBreaks: data.parameterWithBreaks, + parameterWithBackticks: data.parameterWithBackticks, + parameterWithSlashes: data.parameterWithSlashes, + parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders, + parameterWithQuotes: data.parameterWithQuotes, + parameterWithReservedCharacters: data.parameterWithReservedCharacters + } + }); +}; + +/** + * @deprecated + * @param data The data for the request. + * @param data.parameter This parameter is deprecated + * @throws ApiError + */ +export const deprecatedCall = (data: DeprecatedCallData): CancelablePromise => { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/deprecated', + headers: { + parameter: data.parameter + } + }); +}; + +/** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the header + * @param data.fooAllOfEnum + * @param data.cursor This is the parameter that goes into the query params + * @param data.parameterCookie This is the parameter that goes into the cookie + * @param data.parameterPath This is the parameter that goes into the path + * @param data.requestBody This is the parameter that goes into the body + * @param data.fooRefEnum + * @throws ApiError + */ +export const callWithParameters = (data: CallWithParametersData): CancelablePromise => { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/{parameterPath}', + path: { + parameterPath: data.parameterPath + }, + cookies: { + parameterCookie: data.parameterCookie + }, + headers: { + parameterHeader: data.parameterHeader + }, + query: { + foo_ref_enum: data.fooRefEnum, + foo_all_of_enum: data.fooAllOfEnum, + cursor: data.cursor + }, + body: data.requestBody, + mediaType: 'application/json' + }); +}; + +/** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the request header + * @param data.parameterQuery This is the parameter that goes into the request query params + * @param data.parameterCookie This is the parameter that goes into the cookie + * @param data.requestBody This is the parameter that goes into the body + * @param data.parameterPath1 This is the parameter that goes into the path + * @param data.parameterPath2 This is the parameter that goes into the path + * @param data.parameterPath3 This is the parameter that goes into the path + * @param data._default This is the parameter with a reserved keyword + * @throws ApiError + */ +export const callWithWeirdParameterNames = (data: CallWithWeirdParameterNamesData): CancelablePromise => { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + path: { + 'parameter.path.1': data.parameterPath1, + 'parameter-path-2': data.parameterPath2, + 'PARAMETER-PATH-3': data.parameterPath3 + }, + cookies: { + 'PARAMETER-COOKIE': data.parameterCookie + }, + headers: { + 'parameter.header': data.parameterHeader + }, + query: { + default: data._default, + 'parameter-query': data.parameterQuery + }, + body: data.requestBody, + mediaType: 'application/json' + }); +}; + +/** + * @param data The data for the request. + * @param data.requestBody This is a required parameter + * @param data.page This is an optional parameter + * @throws ApiError + */ +export const getCallWithOptionalParam = (data: GetCallWithOptionalParamData): CancelablePromise => { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/parameters/', + query: { + page: data.page + }, + body: data.requestBody, + mediaType: 'application/json' + }); +}; + +/** + * @param data The data for the request. + * @param data.parameter This is a required parameter + * @param data.requestBody This is an optional parameter + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ +export const postCallWithOptionalParam = (data: PostCallWithOptionalParamData): CancelablePromise => { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/', + query: { + parameter: data.parameter + }, + body: data.requestBody, + mediaType: 'application/json' + }); +}; + +/** + * @param data The data for the request. + * @param data.parameter This is a reusable parameter + * @param data.foo A reusable request body + * @throws ApiError + */ +export const postApiRequestBody = (data: PostApiRequestBodyData = {}): CancelablePromise => { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/requestBody/', + query: { + parameter: data.parameter + }, + body: data.foo, + mediaType: 'application/json' + }); +}; + +/** + * @param data The data for the request. + * @param data.parameter This is a reusable parameter + * @param data.formData A reusable request body + * @throws ApiError + */ +export const postApiFormData = (data: PostApiFormDataData = {}): CancelablePromise => { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/formData/', + query: { + parameter: data.parameter + }, + formData: data.formData, + mediaType: 'multipart/form-data' + }); +}; + +/** + * @param data The data for the request. + * @param data.parameterString This is a simple string with default value + * @param data.parameterNumber This is a simple number with default value + * @param data.parameterBoolean This is a simple boolean with default value + * @param data.parameterEnum This is a simple enum with default value + * @param data.parameterModel This is a simple model with default value + * @throws ApiError + */ +export const callWithDefaultParameters = (data: CallWithDefaultParametersData = {}): CancelablePromise => { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); +}; + +/** + * @param data The data for the request. + * @param data.parameterString This is a simple string that is optional with default value + * @param data.parameterNumber This is a simple number that is optional with default value + * @param data.parameterBoolean This is a simple boolean that is optional with default value + * @param data.parameterEnum This is a simple enum that is optional with default value + * @param data.parameterModel This is a simple model that is optional with default value + * @throws ApiError + */ +export const callWithDefaultOptionalParameters = (data: CallWithDefaultOptionalParametersData = {}): CancelablePromise => { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); +}; + +/** + * @param data The data for the request. + * @param data.parameterStringWithNoDefault This is a string with no default + * @param data.parameterOptionalStringWithDefault This is a optional string with default + * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default + * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default + * @param data.parameterStringWithDefault This is a string with default + * @param data.parameterStringWithEmptyDefault This is a string with empty default + * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default + * @param data.parameterStringNullableWithDefault This is a string that can be null with default + * @throws ApiError + */ +export const callToTestOrderOfParams = (data: CallToTestOrderOfParamsData): CancelablePromise => { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/defaults', + query: { + parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, + parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, + parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, + parameterStringWithDefault: data.parameterStringWithDefault, + parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, + parameterStringWithNoDefault: data.parameterStringWithNoDefault, + parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, + parameterStringNullableWithDefault: data.parameterStringNullableWithDefault + } + }); +}; + +/** + * @throws ApiError + */ +export const duplicateName = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/duplicate' + }); +}; + +/** + * @throws ApiError + */ +export const duplicateName1 = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/duplicate' + }); +}; + +/** + * @throws ApiError + */ +export const duplicateName2 = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/duplicate' + }); +}; + +/** + * @throws ApiError + */ +export const duplicateName3 = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/duplicate' + }); +}; + +/** + * @returns void Success + * @throws ApiError + */ +export const callWithNoContentResponse = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/no-content' + }); +}; + +/** + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ +export const callWithResponseAndNoContentResponse = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/response-and-no-content' + }); +}; + +/** + * @returns _400 + * @throws ApiError + */ +export const dummyA = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/a' + }); +}; + +/** + * @returns void Success + * @throws ApiError + */ +export const dummyB = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); +}; + +/** + * @returns import + * @throws ApiError + */ +export const callWithResponse = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/response' + }); +}; + +/** + * @returns unknown Message for 200 response + * @returns ModelWithString Message for 201 response + * @returns ModelWithString Message for 202 response + * @throws ApiError + */ +export const callWithDuplicateResponses = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/response', + errors: { + 500: 'Message for 500 error', + 501: 'Message for 501 error', + 502: 'Message for 502 error', + '4XX': 'Message for 4XX errors', + default: 'Default error response' + } + }); +}; + +/** + * @returns unknown Message for 200 response + * @returns ModelThatExtends Message for 201 response + * @returns ModelThatExtendsExtends Message for 202 response + * @throws ApiError + */ +export const callWithResponses = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/response', + errors: { + 500: 'Message for 500 error', + 501: 'Message for 501 error', + 502: 'Message for 502 error', + default: 'Message for default response' + } + }); +}; + +/** + * @param data The data for the request. + * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) + * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) + * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) + * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) + * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) + * @throws ApiError + */ +export const collectionFormat = (data: CollectionFormatData): CancelablePromise => { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/collectionFormat', + query: { + parameterArrayCSV: data.parameterArrayCsv, + parameterArraySSV: data.parameterArraySsv, + parameterArrayTSV: data.parameterArrayTsv, + parameterArrayPipes: data.parameterArrayPipes, + parameterArrayMulti: data.parameterArrayMulti + } + }); +}; + +/** + * @param data The data for the request. + * @param data.parameterArray This is an array parameter + * @param data.parameterDictionary This is a dictionary parameter + * @param data.parameterEnum This is an enum parameter + * @param data.parameterTuple This is tuple parameter + * @param data.parameterNumber This is a number parameter + * @param data.parameterString This is a string parameter + * @param data.parameterBoolean This is a boolean parameter + * @param data.parameterObject This is an object parameter + * @param data.id This is a number parameter + * @returns number Response is a simple number + * @returns string Response is a simple string + * @returns boolean Response is a simple boolean + * @returns unknown Response is a simple object + * @throws ApiError + */ +export const types = (data: TypesData): CancelablePromise => { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/types', + path: { + id: data.id + }, + query: { + parameterNumber: data.parameterNumber, + parameterString: data.parameterString, + parameterBoolean: data.parameterBoolean, + parameterObject: data.parameterObject, + parameterArray: data.parameterArray, + parameterDictionary: data.parameterDictionary, + parameterEnum: data.parameterEnum, + parameterTuple: data.parameterTuple + } + }); +}; + +/** + * @param data The data for the request. + * @param data.formData + * @returns boolean + * @throws ApiError + */ +export const uploadFile = (data: UploadFileData): CancelablePromise => { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/upload', + formData: data.formData, + mediaType: 'application/x-www-form-urlencoded' + }); +}; + +/** + * @param data The data for the request. + * @param data.id + * @returns binary Success + * @throws ApiError + */ +export const fileResponse = (data: FileResponseData): CancelablePromise => { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/file/{id}', + path: { + id: data.id + } + }); +}; + +/** + * @param data The data for the request. + * @param data.parameterObject Parameter containing object + * @param data.parameterReference Parameter containing reference + * @returns ModelWithString Successful response + * @throws ApiError + */ +export const complexTypes = (data: ComplexTypesData): CancelablePromise => { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/complex', + query: { + parameterObject: data.parameterObject, + parameterReference: data.parameterReference + }, + errors: { + 400: '400 `server` error', + 500: '500 server error' + } + }); +}; + +/** + * @param data The data for the request. + * @param data.formData + * @throws ApiError + */ +export const multipartRequest = (data: MultipartRequestData = {}): CancelablePromise => { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/multipart', + formData: data.formData, + mediaType: 'multipart/form-data' + }); +}; + +/** + * @returns unknown OK + * @throws ApiError + */ +export const multipartResponse = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multipart' + }); +}; + +/** + * @param data The data for the request. + * @param data.id + * @param data.requestBody + * @returns ModelWithString Success + * @throws ApiError + */ +export const complexParams = (data: ComplexParamsData): CancelablePromise => { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/complex/{id}', + path: { + id: data.id + }, + body: data.requestBody, + mediaType: 'application/json-patch+json' + }); +}; + +/** + * @returns string Successful response + * @throws ApiError + */ +export const callWithResultFromHeader = (): CancelablePromise => { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/header', + responseHeader: 'operation-location', + errors: { + 400: '400 server error', + 500: '500 server error' + } + }); +}; + +/** + * @param data The data for the request. + * @param data.status Status code to return + * @returns unknown Custom message: Successful response + * @throws ApiError + */ +export const testErrorCode = (data: TestErrorCodeData): CancelablePromise => { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/error', + query: { + status: data.status + }, + errors: { + 500: 'Custom message: Internal Server Error', + 501: 'Custom message: Not Implemented', + 502: 'Custom message: Bad Gateway', + 503: 'Custom message: Service Unavailable' + } + }); +}; + +/** + * @param data The data for the request. + * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param + * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response + * @throws ApiError + */ +export const nonAsciiæøåÆøÅöôêÊ字符串 = (data: NonAsciiæøåÆøÅöôêÊ字符串Data): CancelablePromise => { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + query: { + 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ + } + }); +}; + +/** + * Login User + * @param data The data for the request. + * @param data.formData + * @throws ApiError + */ +export const putWithFormUrlEncoded = (data: PutWithFormUrlEncodedData): CancelablePromise => { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + formData: data.formData, + mediaType: 'application/x-www-form-urlencoded' + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_tree_shakeable/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_tree_shakeable/types.gen.ts new file mode 100644 index 000000000..b21a80d15 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_tree_shakeable/types.gen.ts @@ -0,0 +1,1537 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _3e_num_1Период = 'Bird' | 'Dog'; + +export const _3e_num_1Период = { + BIRD: 'Bird', + DOG: 'Dog' +} as const; + +/** + * Model with number-only name + */ +export type _400 = string; + +export type _default = { + name?: string; +}; + +/** + * Model with restricted keyword name + */ +export type _import = string; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: (number) | undefined; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AnyOfAnyAndNull = { + data?: (unknown | null); +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<({ + foo?: string; +} | { + bar?: string; +})>; +}; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<({ + foo?: string; +} | { + bar?: string; +})>; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array<(boolean)>; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array<(number)>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: camelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array<(string)>; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type camelCaseCommentWithBreaks = number; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + firstName: string; + lastname: string; + age: number; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: (({ + boolean?: boolean; +} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: (Array<(_3e_num_1Период | ConstValue)> | null); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(number | string)>; +}); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: ParameterSimpleParameter; +} | { + bar: NonAsciiStringæøåÆØÅöôêÊ字符串; +}) & { + baz: (number) | null; + qux: number; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(boolean)>; +}); +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: (boolean | { + [key: string]: (number); +}); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; + +export type ConstValue = "ConstValue"; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: (string); + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: (string | number | boolean) | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: (string); +}; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple enum with numbers + */ +export const EnumWithExtensions = { + /** + * Used when the status of something is successful + */ + CUSTOM_SUCCESS: 200, + /** + * Used when the status of something has a warning + */ + CUSTOM_WARNING: 400, + /** + * Used when the status of something has an error + */ + CUSTOM_ERROR: 500 +} as const; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * This is a simple enum with numbers + */ +export const EnumWithNumbers = { + '_1': 1, + '_2': 2, + '_3': 3, + '_1.1': 1.1, + '_1.2': 1.2, + '_1.3': 1.3, + '_100': 100, + '_200': 200, + '_300': 300, + '_-100': -100, + '_-200': -200, + '_-300': -300, + '_-1.1': -1.1, + '_-1.2': -1.2, + '_-1.3': -1.3 +} as const; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +export const EnumWithReplacedCharacters = { + _SINGLE_QUOTE_: "'Single Quote'", + _DOUBLE_QUOTES_: '"Double Quotes"', + 'ØÆÅÔÖ_ØÆÅÔÖ字符串': 'øæåôöØÆÅÔÖ字符串', + '_3.1': 3.1, + EMPTY_STRING: '' +} as const; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with strings + */ +export const EnumWithStrings = { + SUCCESS: 'Success', + WARNING: 'Warning', + ERROR: 'Error', + _SINGLE_QUOTE_: "'Single Quote'", + _DOUBLE_QUOTES_: '"Double Quotes"', + 'NON_ASCII__ØÆÅÔÖ_ØÆÅÔÖ字符串': 'Non-ascii: øæåôöØÆÅÔÖ字符串' +} as const; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +export const EnumWithXEnumNames = { + zero: 0, + one: 1, + two: 2 +} as const; + +export type File = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { + item?: boolean; + error?: (string) | null; + readonly hasError?: boolean; + data?: { + [key: string]: unknown; + }; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_String_ = { + item?: (string) | null; + error?: (string) | null; + readonly hasError?: boolean; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type Model_From_Zendesk = string; + +/** + * Circle + */ +export type ModelCircle = { + kind: 'circle'; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: 'square'; + sideLength?: number; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string; +}; + +export type ModelWithAnyOfConstantSizeArray = [ + (number | string), + (number | string), + (number | string) +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + (number & string), + (number & string) +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + ((number) | null | string), + ((number) | null | string), + ((number) | null | string) +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + (number | _import), + (number | _import) +]; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnly = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +export type ModelWithConst = { + String?: "String"; + number?: 0; + null?: null; + withType?: "Some string"; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: (string); + }; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: boolean; +}; + +/** + * This is a simple enum with strings + */ +export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + +/** + * This is a simple enum with strings + */ +export const foo_bar_enum = { + SUCCESS: 'Success', + WARNING: 'Warning', + ERROR: 'Error', + 'ØÆÅ字符串': 'ØÆÅ字符串' +} as const; + +/** + * These are the HTTP error code enums + */ +export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + +/** + * These are the HTTP error code enums + */ +export const statusCode = { + _100: '100', + _200_FOO: '200 FOO', + _300_FOO_BAR: '300 FOO_BAR', + _400_FOO_BAR: '400 foo-bar', + _500_FOO_BAR: '500 foo.bar', + _600_FOO_BAR: '600 foo&bar' +} as const; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +export type foo_bar_baz_qux = '3.0'; + +export const foo_bar_baz_qux = { + _3_0: '3.0' +} as const; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array<(string)>; + data?: (ModelWithNestedArrayEnumsData); +}; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export const ModelWithNestedArrayEnumsDataBar = { + BAZ: 'baz', + QUX: 'qux' +} as const; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export const ModelWithNestedArrayEnumsDataFoo = { + FOO: 'foo', + BAR: 'bar' +} as const; + +export type ModelWithNestedCompositionEnums = { + foo?: (ModelWithNestedArrayEnumsDataFoo); +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: ('Success' | 'Warning' | 'Error'); + }; + dictionaryWithEnumFromDescription?: { + [key: string]: (number); + }; + arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; + arrayWithDescription?: Array<(number)>; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedProperties = { + readonly first: { + readonly second: { + readonly third: (string) | null; + } | null; + } | null; +}; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: (string) | null; + /** + * This is a simple string property + */ + nullableProp2?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: (string) | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Период + */ +export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; + +/** + * Период + */ +export const value = { + '_-10': -10, + '_-1': -1, + '_0': 0, + '_1': 1, + '_3': 3, + '_6': 6, + '_12': 12 +} as const; + +export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { + baz: (number) | null; + qux: number; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + (string), + (string) + ]; + foo: 'Corge'; +}; + +export type foo = 'Bar'; + +export const foo = { + BAR: 'Bar' +} as const; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPattern = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + (number | string), + string +]; + +/** + * This is a model with one nested property + */ +export type ModelWithProperties = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: (string) | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +export type ModelWithReadOnlyAndWriteOnly = { + foo: string; + readonly bar: string; + baz: string; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReference = { + prop?: ModelWithProperties; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: (Array<(string | boolean)> | null); +}; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array<(string)>; +}; + +/** + * This is a reusable parameter + */ +export type ParameterSimpleParameter = string; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Parameter with illegal characters + */ +export type Parameterx_Foo_Bar = ModelWithString; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<({ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; +})>; +}; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple file + */ +export type SimpleFile = (Blob | File); + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = (string) | null; + +export type PatchApiNoTagResponse = (unknown); + +export type ImportData = { + requestBody: (ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly); +}; + +export type ImportResponse = (Model_From_Zendesk | ModelWithReadOnlyAndWriteOnly); + +export type FooWowResponse = (unknown); + +export type ApiVVersionODataControllerCountResponse = (Model_From_Zendesk); + +export type GetApiSimpleOperationData = { + /** + * foo in method + */ + fooParam: string; +}; + +export type GetApiSimpleOperationResponse = (number); + +export type DeleteFooData3 = { + /** + * bar in method + */ + barParam: string; + /** + * foo in method + */ + fooParam: string; + /** + * Parameter with illegal characters + */ + xFooBar: ModelWithString; +}; + +export type CallWithDescriptionsData = { + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: unknown; + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: unknown; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: unknown; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: unknown; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: unknown; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: unknown; +}; + +export type DeprecatedCallData = { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: (DeprecatedModel) | null; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the query params + */ + cursor: (string) | null; + fooAllOfEnum: (ModelWithNestedArrayEnumsDataFoo); + fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the cookie + */ + parameterCookie: (string) | null; + /** + * This is the parameter that goes into the header + */ + parameterHeader: (string) | null; + /** + * This is the parameter that goes into the path + */ + parameterPath: (string) | null; + /** + * This is the parameter that goes into the body + */ + requestBody: { + [key: string]: unknown; + } | null; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter with a reserved keyword + */ + _default?: string; + /** + * This is the parameter that goes into the cookie + */ + parameterCookie: (string) | null; + /** + * This is the parameter that goes into the request header + */ + parameterHeader: (string) | null; + /** + * This is the parameter that goes into the path + */ + parameterPath1?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath2?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath3?: string; + /** + * This is the parameter that goes into the request query params + */ + parameterQuery: (string) | null; + /** + * This is the parameter that goes into the body + */ + requestBody: (ModelWithString) | null; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + page?: number; + /** + * This is a required parameter + */ + requestBody: ModelWithOneOfEnum; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is a required parameter + */ + parameter: Pageable; + /** + * This is an optional parameter + */ + requestBody?: { + offset?: (number) | null; + }; +}; + +export type PostCallWithOptionalParamResponse = (number | void); + +export type PostApiRequestBodyData = { + /** + * A reusable request body + */ + foo?: ModelWithString; + /** + * This is a reusable parameter + */ + parameter?: string; +}; + +export type PostApiFormDataData = { + /** + * A reusable request body + */ + formData?: ModelWithString; + /** + * This is a reusable parameter + */ + parameter?: string; +}; + +export type CallWithDefaultParametersData = { + /** + * This is a simple boolean with default value + */ + parameterBoolean?: (boolean) | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: (ModelWithString) | null; + /** + * This is a simple number with default value + */ + parameterNumber?: (number) | null; + /** + * This is a simple string with default value + */ + parameterString?: (string) | null; +}; + +export type CallWithDefaultOptionalParametersData = { + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; +}; + +export type CallToTestOrderOfParamsData = { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: (string) | null; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: (string) | null; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; +}; + +export type CallWithNoContentResponseResponse = (void); + +export type CallWithResponseAndNoContentResponseResponse = (number | void); + +export type DummyAResponse = (_400); + +export type DummyBResponse = (void); + +export type CallWithResponseResponse = (_import); + +export type CallWithDuplicateResponsesResponse = ((ModelWithBoolean & ModelWithInteger) | ModelWithString); + +export type CallWithResponsesResponse = ({ + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; +} | ModelThatExtends | ModelThatExtendsExtends); + +export type CollectionFormatData = { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCsv: Array<(string)> | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array<(string)> | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array<(string)> | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySsv: Array<(string)> | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTsv: Array<(string)> | null; +}; + +export type TypesData = { + /** + * This is a number parameter + */ + id?: number; + /** + * This is an array parameter + */ + parameterArray: Array<(string)> | null; + /** + * This is a boolean parameter + */ + parameterBoolean: (boolean) | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: ('Success' | 'Warning' | 'Error') | null; + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is a string parameter + */ + parameterString: (string) | null; + /** + * This is tuple parameter + */ + parameterTuple: [ + number, + number, + number, + number + ]; +}; + +export type TypesResponse = (number | string | boolean | { + [key: string]: unknown; +}); + +export type UploadFileData = { + formData: (Blob | File); +}; + +export type UploadFileResponse = (boolean); + +export type FileResponseData = { + id: string; +}; + +export type FileResponseResponse = ((Blob | File)); + +export type ComplexTypesData = { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; +}; + +export type ComplexTypesResponse = (Array); + +export type MultipartRequestData = { + formData?: { + content?: (Blob | File); + data?: ((ModelWithString) | null); + }; +}; + +export type MultipartResponseResponse = ({ + file?: (Blob | File); + metadata?: { + foo?: string; + bar?: string; + }; +}); + +export type ComplexParamsData = { + id: number; + requestBody?: { + readonly key: (string) | null; + name: (string) | null; + enabled?: boolean; + readonly type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array<(string)> | null; + parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); + readonly user?: { + readonly id?: number; + readonly name?: (string) | null; + }; + }; +}; + +export type ComplexParamsResponse = (ModelWithString); + +export type CallWithResultFromHeaderResponse = (string); + +export type TestErrorCodeData = { + /** + * Status code to return + */ + status: number; +}; + +export type TestErrorCodeResponse = (unknown); + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + /** + * Dummy input param + */ + nonAsciiParamæøåÆøÅöôêÊ: number; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = (Array); + +export type PutWithFormUrlEncodedData = { + formData: ArrayWithStrings; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_types/index.ts b/packages/openapi-ts-tests/test/generated/v3_types/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_types/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_types/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_types/types.gen.ts new file mode 100644 index 000000000..f6a6095e3 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_types/types.gen.ts @@ -0,0 +1,1970 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = unknown; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string; + /** + * This is a simple string property + */ + nullableRequiredProp1: string; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReference = { + prop?: ModelWithProperties; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnly = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: { + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithProperties = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedProperties = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPattern = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type File = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + unknown, + unknown + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnly = { + foo: string; + readonly bar: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | string, + number | string, + number | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: unknown; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssue = ((ConstValue | GenericSchemaDuplicateIssue1SystemBoolean) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemString; + +export type GenericSchemaDuplicateIssue1SystemBoolean = { + item?: boolean; + error?: string; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemString = { + item?: string; + error?: string; + readonly hasError?: boolean; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnly; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: unknown; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: unknown; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: unknown; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: unknown; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: unknown; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: unknown; + }; + url: '/api/v{api-version}/descriptions/'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + }; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters/'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters/'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody/'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData/'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string; + /** + * This is a simple number with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + }; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + /** + * This is tuple parameter + */ + parameterTuple: [ + number, + number, + number, + number + ]; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: unknown; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: unknown; +}; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + readonly key: string; + name: string; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array; + listOfStrings?: Array; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + readonly user?: { + readonly id?: number; + readonly name?: string; + }; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_types_no_tree/index.ts b/packages/openapi-ts-tests/test/generated/v3_types_no_tree/index.ts new file mode 100644 index 000000000..56bade120 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_types_no_tree/index.ts @@ -0,0 +1,2 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_types_no_tree/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_types_no_tree/types.gen.ts new file mode 100644 index 000000000..f6a6095e3 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_types_no_tree/types.gen.ts @@ -0,0 +1,1970 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Model with number-only name + */ +export type _400 = string; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CamelCaseCommentWithBreaks = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; + +/** + * This is a simple file + */ +export type SimpleFile = unknown; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = string; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: CamelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<{ + foo?: string; +} | { + bar?: string; +}>; + +export type AnyOfAnyAndNull = { + data?: unknown | null; +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<{ + foo?: string; + } | { + bar?: string; + }>; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: string; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: string | number | boolean | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: string; + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type ModelFromZendesk = string; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: string; + /** + * This is a simple string property + */ + nullableRequiredProp1: string; + /** + * This is a simple string property + */ + nullableProp2?: string | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: string | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: true; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: 'Success' | 'Warning' | 'Error'; + }; + dictionaryWithEnumFromDescription?: { + [key: string]: number; + }; + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; + arrayWithDescription?: Array; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReference = { + prop?: ModelWithProperties; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnly = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array; + propWithNumber?: Array; +}; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: string; + }; +}; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * Circle + */ +export type ModelCircle = { + kind: string; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: string; + sideLength?: number; +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ({ + kind?: 'circle'; +} & ModelCircle) | ({ + kind?: 'square'; +} & ModelSquare); + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: { + propA?: string; + } | string | number; +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: Array | Array; +}; + +export type _3eNum1Период = 'Bird' | 'Dog'; + +export type ConstValue = 'ConstValue'; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: Array<_3eNum1Период | ConstValue> | null; +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: boolean | { + [key: string]: number; + }; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: boolean | { + [key: string]: Array; + }; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: { + boolean?: boolean; + } & ModelWithEnum & ModelWithArray & ModelWithDictionary; +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: { + boolean?: boolean; + } | ModelWithEnum | ModelWithArray | ModelWithDictionary; +}; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + age: number; + firstName: string; + lastname: string; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithProperties = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: string; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedProperties = { + readonly first: { + readonly second: { + readonly third: string; + }; + }; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPattern = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type File = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +export type Default = { + name?: string; +}; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; + +export type ModelWithConst = { + String?: 'String'; + number?: 0; + null?: null; + withType?: 'Some string'; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string | undefined; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: Array | null; +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: SimpleParameter; +} | { + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; +}) & { + baz: number; + qux: number; +}; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + unknown, + unknown + ]; + foo: 'Corge'; +}; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array; + data?: ModelWithNestedArrayEnumsData; +}; + +export type ModelWithNestedCompositionEnums = { + foo?: ModelWithNestedArrayEnumsDataFoo; +}; + +export type ModelWithReadOnlyAndWriteOnly = { + foo: string; + readonly bar: string; + baz: string; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +export type ModelWithAnyOfConstantSizeArray = [ + number | string, + number | string, + number | string +]; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + number | string, + string +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + number | string, + number | string, + number | string +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + number | Import, + number | Import +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + number & string, + number & string +]; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { + baz: number; + qux: number; +}; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * Model with restricted keyword name + */ +export type Import = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type IoK8sApimachineryPkgApisMetaV1Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: string | number; +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: unknown; +}; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: number; +}; + +export type OneOfAllOfIssue = ((ConstValue | GenericSchemaDuplicateIssue1SystemBoolean) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemString; + +export type GenericSchemaDuplicateIssue1SystemBoolean = { + item?: boolean; + error?: string; + readonly hasError?: boolean; + data?: { + [key: string]: never; + }; +}; + +export type GenericSchemaDuplicateIssue1SystemString = { + item?: string; + error?: string; + readonly hasError?: boolean; +}; + +/** + * This is a reusable parameter + */ +export type SimpleParameter = string; + +/** + * Parameter with illegal characters + */ +export type XFooBar = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleRequestBody = ModelWithString; + +/** + * A reusable request body + */ +export type SimpleFormData = ModelWithString; + +export type ExportData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type PatchApiVbyApiVersionNoTagResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ImportData = { + body: ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type ImportResponses = { + /** + * Success + */ + 200: ModelFromZendesk; + /** + * Default success response + */ + default: ModelWithReadOnlyAndWriteOnly; +}; + +export type ImportResponse = ImportResponses[keyof ImportResponses]; + +export type FooWowData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no+tag'; +}; + +export type FooWowResponses = { + /** + * OK + */ + default: unknown; +}; + +export type ApiVVersionODataControllerCountData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple/$count'; +}; + +export type ApiVVersionODataControllerCountResponses = { + /** + * Success + */ + 200: ModelFromZendesk; +}; + +export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; + +export type GetApiVbyApiVersionSimpleOperationData = { + body?: never; + path: { + /** + * foo in method + */ + foo_param: string; + }; + query?: never; + url: '/api/v{api-version}/simple:operation'; +}; + +export type GetApiVbyApiVersionSimpleOperationErrors = { + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; + +export type GetApiVbyApiVersionSimpleOperationResponses = { + /** + * Response is a simple number + */ + 200: number; +}; + +export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; + +export type DeleteCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type GetCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type HeadCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type OptionsCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PatchCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PostCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type PutCallWithoutParametersAndResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/simple'; +}; + +export type DeleteFooData3 = { + body?: never; + headers: { + /** + * Parameter with illegal characters + */ + 'x-Foo-Bar': ModelWithString; + }; + path: { + /** + * foo in method + */ + foo_param: string; + /** + * bar in method + */ + BarParam: string; + }; + query?: never; + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; +}; + +export type CallWithDescriptionsData = { + body?: never; + path?: never; + query?: { + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: unknown; + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: unknown; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: unknown; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: unknown; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: unknown; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: unknown; + }; + url: '/api/v{api-version}/descriptions/'; +}; + +export type DeprecatedCallData = { + body?: never; + headers: { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: DeprecatedModel; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/parameters/deprecated'; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the body + */ + body: { + [key: string]: unknown; + }; + headers: { + /** + * This is the parameter that goes into the header + */ + parameterHeader: string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + parameterPath: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the query params + */ + cursor: string; + }; + url: '/api/v{api-version}/parameters/{parameterPath}'; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter that goes into the body + */ + body: ModelWithString; + headers: { + /** + * This is the parameter that goes into the request header + */ + 'parameter.header': string; + }; + path: { + /** + * This is the parameter that goes into the path + */ + 'parameter.path.1'?: string; + /** + * This is the parameter that goes into the path + */ + 'parameter-path-2'?: string; + /** + * This is the parameter that goes into the path + */ + 'PARAMETER-PATH-3'?: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query: { + /** + * This is the parameter with a reserved keyword + */ + default?: string; + /** + * This is the parameter that goes into the request query params + */ + 'parameter-query': string; + }; + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is a required parameter + */ + body: ModelWithOneOfEnum; + path?: never; + query?: { + /** + * This is an optional parameter + */ + page?: number; + }; + url: '/api/v{api-version}/parameters/'; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + body?: { + offset?: number; + }; + path?: never; + query: { + /** + * This is a required parameter + */ + parameter: Pageable; + }; + url: '/api/v{api-version}/parameters/'; +}; + +export type PostCallWithOptionalParamResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; + +export type PostApiVbyApiVersionRequestBodyData = { + /** + * A reusable request body + */ + body?: SimpleRequestBody; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/requestBody/'; +}; + +export type PostApiVbyApiVersionFormDataData = { + /** + * A reusable request body + */ + body?: SimpleFormData; + path?: never; + query?: { + /** + * This is a reusable parameter + */ + parameter?: string; + }; + url: '/api/v{api-version}/formData/'; +}; + +export type CallWithDefaultParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string with default value + */ + parameterString?: string; + /** + * This is a simple number with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallWithDefaultOptionalParametersData = { + body?: never; + path?: never; + query?: { + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type CallToTestOrderOfParamsData = { + body?: never; + path?: never; + query: { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: string; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: string; + }; + url: '/api/v{api-version}/defaults'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type DuplicateNameData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/duplicate'; +}; + +export type CallWithNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/no-content'; +}; + +export type CallWithNoContentResponseResponses = { + /** + * Success + */ + 204: void; +}; + +export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; + +export type CallWithResponseAndNoContentResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; +}; + +export type CallWithResponseAndNoContentResponseResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Success + */ + 204: void; +}; + +export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; + +export type DummyAData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/a'; +}; + +export type DummyAResponses = { + 200: _400; +}; + +export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; + +export type DummyBData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multiple-tags/b'; +}; + +export type DummyBResponses = { + /** + * Success + */ + 204: void; +}; + +export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; + +export type CallWithResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponseResponses = { + default: Import; +}; + +export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; + +export type CallWithDuplicateResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithDuplicateResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for 4XX errors + */ + '4XX': DictionaryWithArray; + /** + * Default error response + */ + default: ModelWithBoolean; +}; + +export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; + +export type CallWithDuplicateResponsesResponses = { + /** + * Message for 200 response + */ + 200: ModelWithBoolean & ModelWithInteger; + /** + * Message for 201 response + */ + 201: ModelWithString; + /** + * Message for 202 response + */ + 202: ModelWithString; +}; + +export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; + +export type CallWithResponsesData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/response'; +}; + +export type CallWithResponsesErrors = { + /** + * Message for 500 error + */ + 500: ModelWithStringError; + /** + * Message for 501 error + */ + 501: ModelWithStringError; + /** + * Message for 502 error + */ + 502: ModelWithStringError; + /** + * Message for default response + */ + default: ModelWithStringError; +}; + +export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; + +export type CallWithResponsesResponses = { + /** + * Message for 200 response + */ + 200: { + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; + }; + /** + * Message for 201 response + */ + 201: ModelThatExtends; + /** + * Message for 202 response + */ + 202: ModelThatExtendsExtends; +}; + +export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; + +export type CollectionFormatData = { + body?: never; + path?: never; + query: { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCSV: Array; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySSV: Array; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTSV: Array; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array; + }; + url: '/api/v{api-version}/collectionFormat'; +}; + +export type TypesData = { + body?: never; + path?: { + /** + * This is a number parameter + */ + id?: number; + }; + query: { + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is a string parameter + */ + parameterString: string; + /** + * This is a boolean parameter + */ + parameterBoolean: boolean; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + }; + /** + * This is an array parameter + */ + parameterArray: Array; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + }; + /** + * This is an enum parameter + */ + parameterEnum: 'Success' | 'Warning' | 'Error'; + /** + * This is tuple parameter + */ + parameterTuple: [ + number, + number, + number, + number + ]; + }; + url: '/api/v{api-version}/types'; +}; + +export type TypesResponses = { + /** + * Response is a simple number + */ + 200: number; + /** + * Response is a simple string + */ + 201: string; + /** + * Response is a simple boolean + */ + 202: boolean; + /** + * Response is a simple object + */ + 203: { + [key: string]: unknown; + }; +}; + +export type TypesResponse = TypesResponses[keyof TypesResponses]; + +export type UploadFileData = { + body: unknown; + path: { + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/upload'; +}; + +export type UploadFileResponses = { + 200: boolean; +}; + +export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; + +export type FileResponseData = { + body?: never; + path: { + id: string; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/file/{id}'; +}; + +export type FileResponseResponses = { + /** + * Success + */ + 200: unknown; +}; + +export type ComplexTypesData = { + body?: never; + path?: never; + query: { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; + }; + url: '/api/v{api-version}/complex'; +}; + +export type ComplexTypesErrors = { + /** + * 400 `server` error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type ComplexTypesResponses = { + /** + * Successful response + */ + 200: Array; +}; + +export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; + +export type MultipartResponseData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type MultipartResponseResponses = { + /** + * OK + */ + 200: { + file?: Blob | File; + metadata?: { + foo?: string; + bar?: string; + }; + }; +}; + +export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; + +export type MultipartRequestData = { + body?: { + content?: Blob | File; + data?: ModelWithString; + }; + path?: never; + query?: never; + url: '/api/v{api-version}/multipart'; +}; + +export type ComplexParamsData = { + body?: { + readonly key: string; + name: string; + enabled?: boolean; + type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array; + listOfStrings?: Array; + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; + readonly user?: { + readonly id?: number; + readonly name?: string; + }; + }; + path: { + id: number; + /** + * api-version should be required in standalone clients + */ + 'api-version': string; + }; + query?: never; + url: '/api/v{api-version}/complex/{id}'; +}; + +export type ComplexParamsResponses = { + /** + * Success + */ + 200: ModelWithString; +}; + +export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; + +export type CallWithResultFromHeaderData = { + body?: never; + path?: never; + query?: never; + url: '/api/v{api-version}/header'; +}; + +export type CallWithResultFromHeaderErrors = { + /** + * 400 server error + */ + 400: unknown; + /** + * 500 server error + */ + 500: unknown; +}; + +export type CallWithResultFromHeaderResponses = { + /** + * Successful response + */ + 200: unknown; +}; + +export type TestErrorCodeData = { + body?: never; + path?: never; + query: { + /** + * Status code to return + */ + status: number; + }; + url: '/api/v{api-version}/error'; +}; + +export type TestErrorCodeErrors = { + /** + * Custom message: Internal Server Error + */ + 500: unknown; + /** + * Custom message: Not Implemented + */ + 501: unknown; + /** + * Custom message: Bad Gateway + */ + 502: unknown; + /** + * Custom message: Service Unavailable + */ + 503: unknown; +}; + +export type TestErrorCodeResponses = { + /** + * Custom message: Successful response + */ + 200: unknown; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + body?: never; + path?: never; + query: { + /** + * Dummy input param + */ + nonAsciiParamæøåÆØÅöôêÊ: number; + }; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { + /** + * Successful response + */ + 200: Array; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; + +export type PutWithFormUrlEncodedData = { + body: ArrayWithStrings; + path?: never; + query?: never; + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; +}; + +export type ClientOptions = { + baseUrl: 'http://localhost:3000/base' | (string & {}); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiError.ts new file mode 100644 index 000000000..36675d288 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiError.ts @@ -0,0 +1,21 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; + +export class ApiError extends Error { + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: unknown; + public readonly request: ApiRequestOptions; + + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); + + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiRequestOptions.ts new file mode 100644 index 000000000..939a0aa4c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiRequestOptions.ts @@ -0,0 +1,21 @@ +export type ApiRequestOptions = { + readonly body?: any; + readonly cookies?: Record; + readonly errors?: Record; + readonly formData?: Record | any[] | Blob | File; + readonly headers?: Record; + readonly mediaType?: string; + readonly method: + | 'DELETE' + | 'GET' + | 'HEAD' + | 'OPTIONS' + | 'PATCH' + | 'POST' + | 'PUT'; + readonly path?: Record; + readonly query?: Record; + readonly responseHeader?: string; + readonly responseTransformer?: (data: unknown) => Promise; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiResult.ts new file mode 100644 index 000000000..4c58e3913 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiResult.ts @@ -0,0 +1,7 @@ +export type ApiResult = { + readonly body: TData; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_xhr/core/CancelablePromise.ts new file mode 100644 index 000000000..ccc082e8f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_xhr/core/CancelablePromise.ts @@ -0,0 +1,126 @@ +export class CancelError extends Error { + constructor(message: string) { + super(message); + this.name = 'CancelError'; + } + + public get isCancelled(): boolean { + return true; + } +} + +export interface OnCancel { + readonly isResolved: boolean; + readonly isRejected: boolean; + readonly isCancelled: boolean; + + (cancelHandler: () => void): void; +} + +export class CancelablePromise implements Promise { + private _isResolved: boolean; + private _isRejected: boolean; + private _isCancelled: boolean; + readonly cancelHandlers: (() => void)[]; + readonly promise: Promise; + private _resolve?: (value: T | PromiseLike) => void; + private _reject?: (reason?: unknown) => void; + + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason?: unknown) => void, + onCancel: OnCancel + ) => void + ) { + this._isResolved = false; + this._isRejected = false; + this._isCancelled = false; + this.cancelHandlers = []; + this.promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + + const onResolve = (value: T | PromiseLike): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isResolved = true; + if (this._resolve) this._resolve(value); + }; + + const onReject = (reason?: unknown): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isRejected = true; + if (this._reject) this._reject(reason); + }; + + const onCancel = (cancelHandler: () => void): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this.cancelHandlers.push(cancelHandler); + }; + + Object.defineProperty(onCancel, 'isResolved', { + get: (): boolean => this._isResolved, + }); + + Object.defineProperty(onCancel, 'isRejected', { + get: (): boolean => this._isRejected, + }); + + Object.defineProperty(onCancel, 'isCancelled', { + get: (): boolean => this._isCancelled, + }); + + return executor(onResolve, onReject, onCancel as OnCancel); + }); + } + + get [Symbol.toStringTag]() { + return "Cancellable Promise"; + } + + public then( + onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null + ): Promise { + return this.promise.then(onFulfilled, onRejected); + } + + public catch( + onRejected?: ((reason: unknown) => TResult | PromiseLike) | null + ): Promise { + return this.promise.catch(onRejected); + } + + public finally(onFinally?: (() => void) | null): Promise { + return this.promise.finally(onFinally); + } + + public cancel(): void { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isCancelled = true; + if (this.cancelHandlers.length) { + try { + for (const cancelHandler of this.cancelHandlers) { + cancelHandler(); + } + } catch (error) { + console.warn('Cancellation threw an error', error); + return; + } + } + this.cancelHandlers.length = 0; + if (this._reject) this._reject(new CancelError('Request aborted')); + } + + public get isCancelled(): boolean { + return this._isCancelled; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_xhr/core/OpenAPI.ts new file mode 100644 index 000000000..0317507fa --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_xhr/core/OpenAPI.ts @@ -0,0 +1,56 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; + +type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware): void { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Middleware): void { + this._fns = [...this._fns, fn]; + } +} + +export type OpenAPIConfig = { + BASE: string; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + VERSION: string; + WITH_CREDENTIALS: boolean; + interceptors: { + request: Interceptors; + response: Interceptors; + }; +}; + +export const OpenAPI: OpenAPIConfig = { + BASE: 'http://localhost:3000/base', + CREDENTIALS: 'include', + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + TOKEN: undefined, + USERNAME: undefined, + VERSION: '1.0', + WITH_CREDENTIALS: false, + interceptors: { + request: new Interceptors(), + response: new Interceptors(), + }, +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_xhr/core/request.ts new file mode 100644 index 000000000..9b08a59cd --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_xhr/core/request.ts @@ -0,0 +1,350 @@ +import { ApiError } from './ApiError'; +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; +import { CancelablePromise } from './CancelablePromise'; +import type { OnCancel } from './CancelablePromise'; +import type { OpenAPIConfig } from './OpenAPI'; + +export const isString = (value: unknown): value is string => { + return typeof value === 'string'; +}; + +export const isStringWithValue = (value: unknown): value is string => { + return isString(value) && value !== ''; +}; + +export const isBlob = (value: any): value is Blob => { + return value instanceof Blob; +}; + +export const isFormData = (value: unknown): value is FormData => { + return value instanceof FormData; +}; + +export const isSuccess = (status: number): boolean => { + return status >= 200 && status < 300; +}; + +export const base64 = (str: string): string => { + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } +}; + +export const getQueryString = (params: Record): string => { + const qs: string[] = []; + + const append = (key: string, value: unknown) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; + + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; + } + + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { + value.forEach(v => encodePair(key, v)); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); + } + }; + + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); + + return qs.length ? `?${qs.join('&')}` : ''; +}; + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI; + + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); + + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; +}; + +export const getFormData = (options: ApiRequestOptions): FormData | undefined => { + if (options.formData) { + const formData = new FormData(); + + const process = (key: string, value: unknown) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; + + Object.entries(options.formData) + .filter(([, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); + + return formData; + } + return undefined; +}; + +type Resolver = (options: ApiRequestOptions) => Promise; + +export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; +}; + +export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { + const [token, username, password, additionalHeaders] = await Promise.all([ + // @ts-ignore + resolve(options, config.TOKEN), + // @ts-ignore + resolve(options, config.USERNAME), + // @ts-ignore + resolve(options, config.PASSWORD), + // @ts-ignore + resolve(options, config.HEADERS), + ]); + + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + }) + .filter(([, value]) => value !== undefined && value !== null) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); + + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } + + return new Headers(headers); +}; + +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body !== undefined) { + if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { + return JSON.stringify(options.body); + } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { + return options.body; + } else { + return JSON.stringify(options.body); + } + } + return undefined; +}; + +export const sendRequest = async ( + config: OpenAPIConfig, + options: ApiRequestOptions, + url: string, + body: any, + formData: FormData | undefined, + headers: Headers, + onCancel: OnCancel +): Promise => { + let xhr = new XMLHttpRequest(); + xhr.open(options.method, url, true); + xhr.withCredentials = config.WITH_CREDENTIALS; + + headers.forEach((value, key) => { + xhr.setRequestHeader(key, value); + }); + + return new Promise(async (resolve, reject) => { + xhr.onload = () => resolve(xhr); + xhr.onabort = () => reject(new Error('Request aborted')); + xhr.onerror = () => reject(new Error('Network error')); + + for (const fn of config.interceptors.request._fns) { + xhr = await fn(xhr); + } + + xhr.send(body ?? formData); + + onCancel(() => xhr.abort()); + }); +}; + +export const getResponseHeader = (xhr: XMLHttpRequest, responseHeader?: string): string | undefined => { + if (responseHeader) { + const content = xhr.getResponseHeader(responseHeader); + if (isString(content)) { + return content; + } + } + return undefined; +}; + +export const getResponseBody = (xhr: XMLHttpRequest): unknown => { + if (xhr.status !== 204) { + try { + const contentType = xhr.getResponseHeader('Content-Type'); + if (contentType) { + if (contentType.includes('application/json') || contentType.includes('+json')) { + return JSON.parse(xhr.responseText); + } else { + return xhr.responseText; + } + } + } catch (error) { + console.error(error); + } + } + return undefined; +}; + +export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Payload Too Large', + 414: 'URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Range Not Satisfiable', + 417: 'Expectation Failed', + 418: 'Im a teapot', + 421: 'Misdirected Request', + 422: 'Unprocessable Content', + 423: 'Locked', + 424: 'Failed Dependency', + 425: 'Too Early', + 426: 'Upgrade Required', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', + 451: 'Unavailable For Legal Reasons', + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 508: 'Loop Detected', + 510: 'Not Extended', + 511: 'Network Authentication Required', + ...options.errors, + } + + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } + + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } +}; + +/** + * Request method + * @param config The OpenAPI configuration object + * @param options The request options from the service + * @returns CancelablePromise + * @throws ApiError + */ +export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { + return new CancelablePromise(async (resolve, reject, onCancel) => { + try { + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); + const headers = await getHeaders(config, options); + + if (!onCancel.isCancelled) { + let response = await sendRequest(config, options, url, body, formData, headers, onCancel); + + for (const fn of config.interceptors.response._fns) { + response = await fn(response); + } + + const responseBody = getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + + let transformedBody = responseBody; + if (options.responseTransformer && isSuccess(response.status)) { + transformedBody = await options.responseTransformer(responseBody) + } + + const result: ApiResult = { + url, + ok: isSuccess(response.status), + status: response.status, + statusText: response.statusText, + body: responseHeader ?? transformedBody, + }; + + catchErrorCodes(options, result); + + resolve(result.body); + } + } catch (error) { + reject(error); + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr/index.ts b/packages/openapi-ts-tests/test/generated/v3_xhr/index.ts new file mode 100644 index 000000000..50a1dd734 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_xhr/index.ts @@ -0,0 +1,6 @@ +// This file is auto-generated by @hey-api/openapi-ts +export { ApiError } from './core/ApiError'; +export { CancelablePromise, CancelError } from './core/CancelablePromise'; +export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_xhr/sdk.gen.ts new file mode 100644 index 000000000..f62288bcf --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_xhr/sdk.gen.ts @@ -0,0 +1,913 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CancelablePromise } from './core/CancelablePromise'; +import { OpenAPI } from './core/OpenAPI'; +import { request as __request } from './core/request'; +import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; + +export class CollectionFormatService { + /** + * @param data The data for the request. + * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) + * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) + * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) + * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) + * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) + * @throws ApiError + */ + public static collectionFormat(data: CollectionFormatData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/collectionFormat', + query: { + parameterArrayCSV: data.parameterArrayCsv, + parameterArraySSV: data.parameterArraySsv, + parameterArrayTSV: data.parameterArrayTsv, + parameterArrayPipes: data.parameterArrayPipes, + parameterArrayMulti: data.parameterArrayMulti + } + }); + } + +} + +export class ComplexService { + /** + * @param data The data for the request. + * @param data.parameterObject Parameter containing object + * @param data.parameterReference Parameter containing reference + * @returns ModelWithString Successful response + * @throws ApiError + */ + public static complexTypes(data: ComplexTypesData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/complex', + query: { + parameterObject: data.parameterObject, + parameterReference: data.parameterReference + }, + errors: { + 400: '400 `server` error', + 500: '500 server error' + } + }); + } + + /** + * @param data The data for the request. + * @param data.id + * @param data.requestBody + * @returns ModelWithString Success + * @throws ApiError + */ + public static complexParams(data: ComplexParamsData): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/complex/{id}', + path: { + id: data.id + }, + body: data.requestBody, + mediaType: 'application/json-patch+json' + }); + } + +} + +export class DefaultService { + /** + * @throws ApiError + */ + public static export(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public static patchApiNoTag(): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @param data The data for the request. + * @param data.requestBody + * @returns Model_From_Zendesk Success + * @returns ModelWithReadOnlyAndWriteOnly Default success response + * @throws ApiError + */ + public static import(data: ImportData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/no+tag', + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public static fooWow(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/no+tag' + }); + } + + /** + * @param data The data for the request. + * @param data.fooParam foo in method + * @returns number Response is a simple number + * @throws ApiError + */ + public static getApiSimpleOperation(data: GetApiSimpleOperationData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple:operation', + path: { + foo_param: data.fooParam + }, + errors: { + default: 'Default error response' + } + }); + } + +} + +export class DefaultsService { + /** + * @param data The data for the request. + * @param data.parameterString This is a simple string with default value + * @param data.parameterNumber This is a simple number with default value + * @param data.parameterBoolean This is a simple boolean with default value + * @param data.parameterEnum This is a simple enum with default value + * @param data.parameterModel This is a simple model with default value + * @throws ApiError + */ + public static callWithDefaultParameters(data: CallWithDefaultParametersData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterString This is a simple string that is optional with default value + * @param data.parameterNumber This is a simple number that is optional with default value + * @param data.parameterBoolean This is a simple boolean that is optional with default value + * @param data.parameterEnum This is a simple enum that is optional with default value + * @param data.parameterModel This is a simple model that is optional with default value + * @throws ApiError + */ + public static callWithDefaultOptionalParameters(data: CallWithDefaultOptionalParametersData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/defaults', + query: { + parameterString: data.parameterString, + parameterNumber: data.parameterNumber, + parameterBoolean: data.parameterBoolean, + parameterEnum: data.parameterEnum, + parameterModel: data.parameterModel + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterStringWithNoDefault This is a string with no default + * @param data.parameterOptionalStringWithDefault This is a optional string with default + * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default + * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default + * @param data.parameterStringWithDefault This is a string with default + * @param data.parameterStringWithEmptyDefault This is a string with empty default + * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default + * @param data.parameterStringNullableWithDefault This is a string that can be null with default + * @throws ApiError + */ + public static callToTestOrderOfParams(data: CallToTestOrderOfParamsData): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/defaults', + query: { + parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, + parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, + parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, + parameterStringWithDefault: data.parameterStringWithDefault, + parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, + parameterStringWithNoDefault: data.parameterStringWithNoDefault, + parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, + parameterStringNullableWithDefault: data.parameterStringNullableWithDefault + } + }); + } + +} + +export class DeprecatedService { + /** + * @deprecated + * @param data The data for the request. + * @param data.parameter This parameter is deprecated + * @throws ApiError + */ + public static deprecatedCall(data: DeprecatedCallData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/deprecated', + headers: { + parameter: data.parameter + } + }); + } + +} + +export class DescriptionsService { + /** + * @param data The data for the request. + * @param data.parameterWithBreaks Testing multiline comments in string: First line + * Second line + * + * Fourth line + * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work + * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work + * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work + * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work + * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work + * @throws ApiError + */ + public static callWithDescriptions(data: CallWithDescriptionsData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/descriptions/', + query: { + parameterWithBreaks: data.parameterWithBreaks, + parameterWithBackticks: data.parameterWithBackticks, + parameterWithSlashes: data.parameterWithSlashes, + parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders, + parameterWithQuotes: data.parameterWithQuotes, + parameterWithReservedCharacters: data.parameterWithReservedCharacters + } + }); + } + +} + +export class DuplicateService { + /** + * @throws ApiError + */ + public static duplicateName(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public static duplicateName1(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public static duplicateName2(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/duplicate' + }); + } + + /** + * @throws ApiError + */ + public static duplicateName3(): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/duplicate' + }); + } + +} + +export class ErrorService { + /** + * @param data The data for the request. + * @param data.status Status code to return + * @returns unknown Custom message: Successful response + * @throws ApiError + */ + public static testErrorCode(data: TestErrorCodeData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/error', + query: { + status: data.status + }, + errors: { + 500: 'Custom message: Internal Server Error', + 501: 'Custom message: Not Implemented', + 502: 'Custom message: Bad Gateway', + 503: 'Custom message: Service Unavailable' + } + }); + } + +} + +export class FileResponseService { + /** + * @param data The data for the request. + * @param data.id + * @returns binary Success + * @throws ApiError + */ + public static fileResponse(data: FileResponseData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/file/{id}', + path: { + id: data.id + } + }); + } + +} + +export class FormDataService { + /** + * @param data The data for the request. + * @param data.parameter This is a reusable parameter + * @param data.formData A reusable request body + * @throws ApiError + */ + public static postApiFormData(data: PostApiFormDataData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/formData/', + query: { + parameter: data.parameter + }, + formData: data.formData, + mediaType: 'multipart/form-data' + }); + } + +} + +export class HeaderService { + /** + * @returns string Successful response + * @throws ApiError + */ + public static callWithResultFromHeader(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/header', + responseHeader: 'operation-location', + errors: { + 400: '400 server error', + 500: '500 server error' + } + }); + } + +} + +export class MultipartService { + /** + * @param data The data for the request. + * @param data.formData + * @throws ApiError + */ + public static multipartRequest(data: MultipartRequestData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/multipart', + formData: data.formData, + mediaType: 'multipart/form-data' + }); + } + + /** + * @returns unknown OK + * @throws ApiError + */ + public static multipartResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multipart' + }); + } + +} + +export class MultipleTags1Service { + /** + * @returns _400 + * @throws ApiError + */ + public static dummyA(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/a' + }); + } + + /** + * @returns void Success + * @throws ApiError + */ + public static dummyB(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class MultipleTags2Service { + /** + * @returns _400 + * @throws ApiError + */ + public static dummyA(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/a' + }); + } + + /** + * @returns void Success + * @throws ApiError + */ + public static dummyB(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class MultipleTags3Service { + /** + * @returns void Success + * @throws ApiError + */ + public static dummyB(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/b' + }); + } + +} + +export class NoContentService { + /** + * @returns void Success + * @throws ApiError + */ + public static callWithNoContentResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/no-content' + }); + } + + /** + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public static callWithResponseAndNoContentResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/response-and-no-content' + }); + } + +} + +export class NonAsciiÆøåÆøÅöôêÊService { + /** + * @param data The data for the request. + * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param + * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response + * @throws ApiError + */ + public static nonAsciiæøåÆøÅöôêÊ字符串(data: NonAsciiæøåÆøÅöôêÊ字符串Data): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + query: { + 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ + } + }); + } + + /** + * Login User + * @param data The data for the request. + * @param data.formData + * @throws ApiError + */ + public static putWithFormUrlEncoded(data: PutWithFormUrlEncodedData): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', + formData: data.formData, + mediaType: 'application/x-www-form-urlencoded' + }); + } + +} + +export class ParametersService { + /** + * @param data The data for the request. + * @param data.fooParam foo in method + * @param data.barParam bar in method + * @param data.xFooBar Parameter with illegal characters + * @throws ApiError + */ + public static deleteFoo(data: DeleteFooData3): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', + path: { + foo_param: data.fooParam, + BarParam: data.barParam + }, + headers: { + 'x-Foo-Bar': data.xFooBar + } + }); + } + + /** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the header + * @param data.fooAllOfEnum + * @param data.cursor This is the parameter that goes into the query params + * @param data.parameterCookie This is the parameter that goes into the cookie + * @param data.parameterPath This is the parameter that goes into the path + * @param data.requestBody This is the parameter that goes into the body + * @param data.fooRefEnum + * @throws ApiError + */ + public static callWithParameters(data: CallWithParametersData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/{parameterPath}', + path: { + parameterPath: data.parameterPath + }, + cookies: { + parameterCookie: data.parameterCookie + }, + headers: { + parameterHeader: data.parameterHeader + }, + query: { + foo_ref_enum: data.fooRefEnum, + foo_all_of_enum: data.fooAllOfEnum, + cursor: data.cursor + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.parameterHeader This is the parameter that goes into the request header + * @param data.parameterQuery This is the parameter that goes into the request query params + * @param data.parameterCookie This is the parameter that goes into the cookie + * @param data.requestBody This is the parameter that goes into the body + * @param data.parameterPath1 This is the parameter that goes into the path + * @param data.parameterPath2 This is the parameter that goes into the path + * @param data.parameterPath3 This is the parameter that goes into the path + * @param data._default This is the parameter with a reserved keyword + * @throws ApiError + */ + public static callWithWeirdParameterNames(data: CallWithWeirdParameterNamesData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', + path: { + 'parameter.path.1': data.parameterPath1, + 'parameter-path-2': data.parameterPath2, + 'PARAMETER-PATH-3': data.parameterPath3 + }, + cookies: { + 'PARAMETER-COOKIE': data.parameterCookie + }, + headers: { + 'parameter.header': data.parameterHeader + }, + query: { + default: data._default, + 'parameter-query': data.parameterQuery + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.requestBody This is a required parameter + * @param data.page This is an optional parameter + * @throws ApiError + */ + public static getCallWithOptionalParam(data: GetCallWithOptionalParamData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/parameters/', + query: { + page: data.page + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + + /** + * @param data The data for the request. + * @param data.parameter This is a required parameter + * @param data.requestBody This is an optional parameter + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public static postCallWithOptionalParam(data: PostCallWithOptionalParamData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/parameters/', + query: { + parameter: data.parameter + }, + body: data.requestBody, + mediaType: 'application/json' + }); + } + +} + +export class RequestBodyService { + /** + * @param data The data for the request. + * @param data.parameter This is a reusable parameter + * @param data.foo A reusable request body + * @throws ApiError + */ + public static postApiRequestBody(data: PostApiRequestBodyData = {}): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/requestBody/', + query: { + parameter: data.parameter + }, + body: data.foo, + mediaType: 'application/json' + }); + } + +} + +export class ResponseService { + /** + * @returns number Response is a simple number + * @returns void Success + * @throws ApiError + */ + public static callWithResponseAndNoContentResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/multiple-tags/response-and-no-content' + }); + } + + /** + * @returns import + * @throws ApiError + */ + public static callWithResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/response' + }); + } + + /** + * @returns unknown Message for 200 response + * @returns ModelWithString Message for 201 response + * @returns ModelWithString Message for 202 response + * @throws ApiError + */ + public static callWithDuplicateResponses(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/response', + errors: { + 500: 'Message for 500 error', + 501: 'Message for 501 error', + 502: 'Message for 502 error', + '4XX': 'Message for 4XX errors', + default: 'Default error response' + } + }); + } + + /** + * @returns unknown Message for 200 response + * @returns ModelThatExtends Message for 201 response + * @returns ModelThatExtendsExtends Message for 202 response + * @throws ApiError + */ + public static callWithResponses(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/response', + errors: { + 500: 'Message for 500 error', + 501: 'Message for 501 error', + 502: 'Message for 502 error', + default: 'Message for default response' + } + }); + } + +} + +export class SimpleService { + /** + * @returns Model_From_Zendesk Success + * @throws ApiError + */ + public static apiVVersionODataControllerCount(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple/$count' + }); + } + + /** + * @throws ApiError + */ + public static getCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static putCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static postCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static deleteCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static optionsCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'OPTIONS', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static headCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'HEAD', + url: '/api/v{api-version}/simple' + }); + } + + /** + * @throws ApiError + */ + public static patchCallWithoutParametersAndResponse(): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v{api-version}/simple' + }); + } + +} + +export class TypesService { + /** + * @param data The data for the request. + * @param data.parameterArray This is an array parameter + * @param data.parameterDictionary This is a dictionary parameter + * @param data.parameterEnum This is an enum parameter + * @param data.parameterTuple This is tuple parameter + * @param data.parameterNumber This is a number parameter + * @param data.parameterString This is a string parameter + * @param data.parameterBoolean This is a boolean parameter + * @param data.parameterObject This is an object parameter + * @param data.id This is a number parameter + * @returns number Response is a simple number + * @returns string Response is a simple string + * @returns boolean Response is a simple boolean + * @returns unknown Response is a simple object + * @throws ApiError + */ + public static types(data: TypesData): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v{api-version}/types', + path: { + id: data.id + }, + query: { + parameterNumber: data.parameterNumber, + parameterString: data.parameterString, + parameterBoolean: data.parameterBoolean, + parameterObject: data.parameterObject, + parameterArray: data.parameterArray, + parameterDictionary: data.parameterDictionary, + parameterEnum: data.parameterEnum, + parameterTuple: data.parameterTuple + } + }); + } + +} + +export class UploadService { + /** + * @param data The data for the request. + * @param data.formData + * @returns boolean + * @throws ApiError + */ + public static uploadFile(data: UploadFileData): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v{api-version}/upload', + formData: data.formData, + mediaType: 'application/x-www-form-urlencoded' + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_xhr/types.gen.ts new file mode 100644 index 000000000..d20c92660 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_xhr/types.gen.ts @@ -0,0 +1,1537 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type _3e_num_1Период = 'Bird' | 'Dog'; + +export const _3e_num_1Период = { + BIRD: 'Bird', + DOG: 'Dog' +} as const; + +/** + * Model with number-only name + */ +export type _400 = string; + +export type _default = { + name?: string; +}; + +/** + * Model with restricted keyword name + */ +export type _import = string; + +export type AdditionalPropertiesIntegerIssue = { + value: number; + [key: string]: (number) | undefined; +}; + +export type AdditionalPropertiesUnknownIssue = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue2 = { + [key: string]: (string | number); +}; + +export type AdditionalPropertiesUnknownIssue3 = string & { + entries: { + [key: string]: AdditionalPropertiesUnknownIssue; + }; +}; + +export type AnyOfAnyAndNull = { + data?: (unknown | null); +}; + +/** + * This is a simple array with any of properties + */ +export type AnyOfArrays = { + results?: Array<({ + foo?: string; +} | { + bar?: string; +})>; +}; + +/** + * This is a simple array with any of properties + */ +export type ArrayWithAnyOfProperties = Array<({ + foo?: string; +} | { + bar?: string; +})>; + +/** + * This is a simple array containing an array + */ +export type ArrayWithArray = Array>; + +/** + * This is a simple array with booleans + */ +export type ArrayWithBooleans = Array<(boolean)>; + +/** + * This is a simple array with numbers + */ +export type ArrayWithNumbers = Array<(number)>; + +/** + * This is a simple array with properties + */ +export type ArrayWithProperties = Array<{ + '16x16'?: camelCaseCommentWithBreaks; + bar?: string; +}>; + +/** + * This is a simple array with references + */ +export type ArrayWithReferences = Array; + +/** + * This is a simple array with strings + */ +export type ArrayWithStrings = Array<(string)>; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type camelCaseCommentWithBreaks = number; + +/** + * Some % character + */ +export type CharactersInDescription = string; + +/** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ +export type CommentWithBackticks = number; + +/** + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work + */ +export type CommentWithBackticksAndQuotes = number; + +/** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ +export type CommentWithBreaks = number; + +/** + * Testing expression placeholders in string: ${expression} should work + */ +export type CommentWithExpressionPlaceholders = number; + +/** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ +export type CommentWithQuotes = number; + +/** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ +export type CommentWithReservedCharacters = number; + +/** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ +export type CommentWithSlashes = number; + +/** + * This is a base model with two simple optional properties + */ +export type CompositionBaseModel = { + firstName?: string; + lastname?: string; +}; + +/** + * This is a model that extends the base model + */ +export type CompositionExtendedModel = CompositionBaseModel & { + firstName: string; + lastname: string; + age: number; +}; + +/** + * This is a model with one property with a 'all of' relationship + */ +export type CompositionWithAllOfAndNullable = { + propA?: (({ + boolean?: boolean; +} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model with one property with a 'any of' relationship + */ +export type CompositionWithAnyOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithAnyOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with nested 'any of' property with a type null + */ +export type CompositionWithNestedAnyAndTypeNull = { + propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); +}; + +/** + * This is a model with one property with a 'any of' relationship where the options are not $ref + */ +export type CompositionWithNestedAnyOfAndNull = { + propA?: (Array<(_3e_num_1Период | ConstValue)> | null); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOf = { + propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); +}; + +/** + * This is a model that contains a dictionary of complex arrays (composited) within composition + */ +export type CompositionWithOneOfAndComplexArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(number | string)>; +}); +}; + +/** + * This is a model with one property with a 'one of' relationship + */ +export type CompositionWithOneOfAndNullable = { + propA?: (({ + boolean?: boolean; +} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); +}; + +export type CompositionWithOneOfAndProperties = ({ + foo: ParameterSimpleParameter; +} | { + bar: NonAsciiStringæøåÆØÅöôêÊ字符串; +}) & { + baz: (number) | null; + qux: number; +}; + +/** + * This is a model that contains a dictionary of simple arrays within composition + */ +export type CompositionWithOneOfAndSimpleArrayDictionary = { + propA?: (boolean | { + [key: string]: Array<(boolean)>; +}); +}; + +/** + * This is a model that contains a simple dictionary within composition + */ +export type CompositionWithOneOfAndSimpleDictionary = { + propA?: (boolean | { + [key: string]: (number); +}); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfAnonymous = { + propA?: ({ + propA?: string; +} | string | number); +}; + +/** + * This is a model with one property with a 'one of' relationship where the options are not $ref + */ +export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; + +export type ConstValue = "ConstValue"; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData = string; + +/** + * Model used to test deduplication strategy + */ +export type DeleteFooData2 = string; + +/** + * This is a deprecated model with a deprecated property + * @deprecated + */ +export type DeprecatedModel = { + /** + * This is a deprecated property + * @deprecated + */ + prop?: string; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithArray = { + [key: string]: Array; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithDictionary = { + [key: string]: { + [key: string]: (string); + }; +}; + +/** + * This is a complex dictionary + */ +export type DictionaryWithProperties = { + [key: string]: { + foo?: string; + bar?: string; + }; +}; + +export type DictionaryWithPropertiesAndAdditionalProperties = { + foo?: number; + bar?: boolean; + [key: string]: (string | number | boolean) | undefined; +}; + +/** + * This is a string reference + */ +export type DictionaryWithReference = { + [key: string]: ModelWithString; +}; + +/** + * This is a string dictionary + */ +export type DictionaryWithString = { + [key: string]: (string); +}; + +/** + * Success=1,Warning=2,Error=3 + */ +export type EnumFromDescription = number; + +/** + * This is a simple enum with numbers + */ +export type EnumWithExtensions = 200 | 400 | 500; + +/** + * This is a simple enum with numbers + */ +export const EnumWithExtensions = { + /** + * Used when the status of something is successful + */ + CUSTOM_SUCCESS: 200, + /** + * Used when the status of something has a warning + */ + CUSTOM_WARNING: 400, + /** + * Used when the status of something has an error + */ + CUSTOM_ERROR: 500 +} as const; + +/** + * This is a simple enum with numbers + */ +export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; + +/** + * This is a simple enum with numbers + */ +export const EnumWithNumbers = { + '_1': 1, + '_2': 2, + '_3': 3, + '_1.1': 1.1, + '_1.2': 1.2, + '_1.3': 1.3, + '_100': 100, + '_200': 200, + '_300': 300, + '_-100': -100, + '_-200': -200, + '_-300': -300, + '_-1.1': -1.1, + '_-1.2': -1.2, + '_-1.3': -1.3 +} as const; + +export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; + +export const EnumWithReplacedCharacters = { + _SINGLE_QUOTE_: "'Single Quote'", + _DOUBLE_QUOTES_: '"Double Quotes"', + 'ØÆÅÔÖ_ØÆÅÔÖ字符串': 'øæåôöØÆÅÔÖ字符串', + '_3.1': 3.1, + EMPTY_STRING: '' +} as const; + +/** + * This is a simple enum with strings + */ +export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; + +/** + * This is a simple enum with strings + */ +export const EnumWithStrings = { + SUCCESS: 'Success', + WARNING: 'Warning', + ERROR: 'Error', + _SINGLE_QUOTE_: "'Single Quote'", + _DOUBLE_QUOTES_: '"Double Quotes"', + 'NON_ASCII__ØÆÅÔÖ_ØÆÅÔÖ字符串': 'Non-ascii: øæåôöØÆÅÔÖ字符串' +} as const; + +export type EnumWithXEnumNames = 0 | 1 | 2; + +export const EnumWithXEnumNames = { + zero: 0, + one: 1, + two: 2 +} as const; + +export type File = { + readonly id?: string; + readonly updated_at?: string; + readonly created_at?: string; + mime: string; + readonly file?: string; +}; + +/** + * This is a free-form object with additionalProperties: {}. + */ +export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { + [key: string]: unknown; +}; + +/** + * This is a free-form object with additionalProperties: true. + */ +export type FreeFormObjectWithAdditionalPropertiesEqTrue = { + [key: string]: unknown; +}; + +/** + * This is a free-form object without additionalProperties. + */ +export type FreeFormObjectWithoutAdditionalProperties = { + [key: string]: unknown; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { + item?: boolean; + error?: (string) | null; + readonly hasError?: boolean; + data?: { + [key: string]: unknown; + }; +}; + +export type Generic_Schema_Duplicate_Issue_1_System_String_ = { + item?: (string) | null; + error?: (string) | null; + readonly hasError?: boolean; +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { + /** + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. + */ + preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); +}; + +/** + * This schema was giving PascalCase transformations a hard time + */ +export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { + /** + * Specifies the target ResourceVersion + */ + resourceVersion?: string; + /** + * Specifies the target UID. + */ + uid?: string; +}; + +/** + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) + */ +export type Model_From_Zendesk = string; + +/** + * Circle + */ +export type ModelCircle = { + kind: 'circle'; + radius?: number; +}; + +/** + * Square + */ +export type ModelSquare = { + kind: 'square'; + sideLength?: number; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtends = ModelWithString & { + propExtendsA?: string; + propExtendsB?: ModelWithString; +}; + +/** + * This is a model that extends another model + */ +export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { + propExtendsC?: string; + propExtendsD?: ModelWithString; +}; + +/** + * This is a model with one property and additionalProperties: true + */ +export type ModelWithAdditionalPropertiesEqTrue = { + /** + * This is a simple string property + */ + prop?: string; + [key: string]: unknown | string; +}; + +export type ModelWithAnyOfConstantSizeArray = [ + (number | string), + (number | string), + (number | string) +]; + +export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ + (number & string), + (number & string) +]; + +export type ModelWithAnyOfConstantSizeArrayNullable = [ + ((number) | null | string), + ((number) | null | string), + ((number) | null | string) +]; + +export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ + (number | _import), + (number | _import) +]; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArray = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * This is a model with one property containing an array + */ +export type ModelWithArrayReadOnlyAndWriteOnly = { + prop?: Array; + propWithFile?: Array<((Blob | File))>; + propWithNumber?: Array<(number)>; +}; + +/** + * Some description with `back ticks` + */ +export type ModelWithBackticksInDescription = { + /** + * The template `that` should be used for parsing and importing the contents of the CSV file. + * + *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

+ *
+     * [
+     * {
+     * "resourceType": "Asset",
+     * "identifier": {
+     * "name": "${1}",
+     * "domain": {
+     * "name": "${2}",
+     * "community": {
+     * "name": "Some Community"
+     * }
+     * }
+     * },
+     * "attributes" : {
+     * "00000000-0000-0000-0000-000000003115" : [ {
+     * "value" : "${3}"
+     * } ],
+     * "00000000-0000-0000-0000-000000000222" : [ {
+     * "value" : "${4}"
+     * } ]
+     * }
+     * }
+     * ]
+     * 
+ */ + template?: string; +}; + +/** + * This is a model with one boolean property + */ +export type ModelWithBoolean = { + /** + * This is a simple boolean property + */ + prop?: boolean; +}; + +/** + * This is a model with one property containing a circular reference + */ +export type ModelWithCircularReference = { + prop?: ModelWithCircularReference; +}; + +export type ModelWithConst = { + String?: "String"; + number?: 0; + null?: null; + withType?: "Some string"; +}; + +export type ModelWithConstantSizeArray = [ + number, + number +]; + +/** + * This is a model with one property containing a dictionary + */ +export type ModelWithDictionary = { + prop?: { + [key: string]: (string); + }; +}; + +/** + * This is a model with duplicated imports + */ +export type ModelWithDuplicateImports = { + propA?: ModelWithString; + propB?: ModelWithString; + propC?: ModelWithString; +}; + +/** + * This is a model with duplicated properties + */ +export type ModelWithDuplicateProperties = { + prop?: ModelWithString; +}; + +/** + * This is a model with one enum + */ +export type ModelWithEnum = { + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + /** + * These are the HTTP error code enums + */ + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + /** + * Simple boolean enum + */ + bool?: boolean; +}; + +/** + * This is a simple enum with strings + */ +export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; + +/** + * This is a simple enum with strings + */ +export const foo_bar_enum = { + SUCCESS: 'Success', + WARNING: 'Warning', + ERROR: 'Error', + 'ØÆÅ字符串': 'ØÆÅ字符串' +} as const; + +/** + * These are the HTTP error code enums + */ +export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; + +/** + * These are the HTTP error code enums + */ +export const statusCode = { + _100: '100', + _200_FOO: '200 FOO', + _300_FOO_BAR: '300 FOO_BAR', + _400_FOO_BAR: '400 foo-bar', + _500_FOO_BAR: '500 foo.bar', + _600_FOO_BAR: '600 foo&bar' +} as const; + +/** + * This is a model with one enum + */ +export type ModelWithEnumFromDescription = { + /** + * Success=1,Warning=2,Error=3 + */ + test?: number; +}; + +/** + * This is a model with one enum with escaped name + */ +export type ModelWithEnumWithHyphen = { + 'foo-bar-baz-qux'?: '3.0'; +}; + +export type foo_bar_baz_qux = '3.0'; + +export const foo_bar_baz_qux = { + _3_0: '3.0' +} as const; + +/** + * This is a model with one number property + */ +export type ModelWithInteger = { + /** + * This is a simple number property + */ + prop?: number; +}; + +export type ModelWithNestedArrayEnums = { + array_strings?: Array<(string)>; + data?: (ModelWithNestedArrayEnumsData); +}; + +export type ModelWithNestedArrayEnumsData = { + foo?: Array; + bar?: Array; +}; + +export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; + +export const ModelWithNestedArrayEnumsDataBar = { + BAZ: 'baz', + QUX: 'qux' +} as const; + +export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; + +export const ModelWithNestedArrayEnumsDataFoo = { + FOO: 'foo', + BAR: 'bar' +} as const; + +export type ModelWithNestedCompositionEnums = { + foo?: (ModelWithNestedArrayEnumsDataFoo); +}; + +/** + * This is a model with nested enums + */ +export type ModelWithNestedEnums = { + dictionaryWithEnum?: { + [key: string]: ('Success' | 'Warning' | 'Error'); + }; + dictionaryWithEnumFromDescription?: { + [key: string]: (number); + }; + arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; + arrayWithDescription?: Array<(number)>; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +/** + * This is a model with one nested property + */ +export type ModelWithNestedProperties = { + readonly first: { + readonly second: { + readonly third: (string) | null; + } | null; + } | null; +}; + +export type ModelWithNullableObject = { + data?: NullableObject; +}; + +/** + * This is a model with one string property + */ +export type ModelWithNullableString = { + /** + * This is a simple string property + */ + nullableProp1?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp1: (string) | null; + /** + * This is a simple string property + */ + nullableProp2?: (string) | null; + /** + * This is a simple string property + */ + nullableRequiredProp2: (string) | null; + /** + * This is a simple enum with strings + */ + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; +}; + +export type ModelWithNumericEnumUnion = { + /** + * Период + */ + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; +}; + +/** + * Период + */ +export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; + +/** + * Период + */ +export const value = { + '_-10': -10, + '_-1': -1, + '_0': 0, + '_1': 1, + '_3': 3, + '_6': 6, + '_12': 12 +} as const; + +export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { + baz: (number) | null; + qux: number; +}; + +export type ModelWithOneOfEnum = { + foo: 'Bar'; +} | { + foo: 'Baz'; +} | { + foo: 'Qux'; +} | { + content: string; + foo: 'Quux'; +} | { + content: [ + (string), + (string) + ]; + foo: 'Corge'; +}; + +export type foo = 'Bar'; + +export const foo = { + BAR: 'Bar' +} as const; + +/** + * This is a model with ordered properties + */ +export type ModelWithOrderedProperties = { + zebra?: string; + apple?: string; + hawaii?: string; +}; + +/** + * This is a model that contains a some patterns + */ +export type ModelWithPattern = { + key: string; + name: string; + readonly enabled?: boolean; + readonly modified?: string; + id?: string; + text?: string; + patternWithSingleQuotes?: string; + patternWithNewline?: string; + patternWithBacktick?: string; +}; + +export type ModelWithPrefixItemsConstantSizeArray = [ + ModelWithInteger, + (number | string), + string +]; + +/** + * This is a model with one nested property + */ +export type ModelWithProperties = { + required: string; + readonly requiredAndReadOnly: string; + requiredAndNullable: (string) | null; + string?: string; + number?: number; + boolean?: boolean; + reference?: ModelWithString; + 'property with space'?: string; + default?: string; + try?: string; + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; +}; + +export type ModelWithReadOnlyAndWriteOnly = { + foo: string; + readonly bar: string; + baz: string; +}; + +/** + * This is a model with one property containing a reference + */ +export type ModelWithReference = { + prop?: ModelWithProperties; +}; + +/** + * This is a model with one string property + */ +export type ModelWithString = { + /** + * This is a simple string property + */ + prop?: string; +}; + +/** + * This is a model with one string property + */ +export type ModelWithStringError = { + /** + * This is a simple string property + */ + prop?: string; +}; + +export type NestedAnyOfArraysNullable = { + nullableArray?: (Array<(string | boolean)> | null); +}; + +/** + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) + */ +export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; + +/** + * An object that can be null + */ +export type NullableObject = { + foo?: string; +} | null; + +export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; + +export type Pageable = { + page?: number; + size?: number; + sort?: Array<(string)>; +}; + +/** + * This is a reusable parameter + */ +export type ParameterSimpleParameter = string; + +/** + * Model used to test deduplication strategy (unused) + */ +export type ParameterSimpleParameterUnused = string; + +/** + * Parameter with illegal characters + */ +export type Parameterx_Foo_Bar = ModelWithString; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse = string; + +/** + * Model used to test deduplication strategy + */ +export type PostServiceWithEmptyTagResponse2 = string; + +export type SchemaWithFormRestrictedKeys = { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + object?: { + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; + }; + array?: Array<({ + description?: string; + 'x-enum-descriptions'?: string; + 'x-enum-varnames'?: string; + 'x-enumNames'?: string; + title?: string; +})>; +}; + +/** + * This is a simple boolean + */ +export type SimpleBoolean = boolean; + +/** + * This is a simple file + */ +export type SimpleFile = (Blob | File); + +/** + * This is a simple number + */ +export type SimpleInteger = number; + +/** + * This is a simple reference + */ +export type SimpleReference = ModelWithString; + +/** + * This is a simple string + */ +export type SimpleString = string; + +/** + * This is a simple string + */ +export type SimpleStringWithPattern = (string) | null; + +export type CollectionFormatData = { + /** + * This is an array parameter that is sent as csv format (comma-separated values) + */ + parameterArrayCsv: Array<(string)> | null; + /** + * This is an array parameter that is sent as multi format (multiple parameter instances) + */ + parameterArrayMulti: Array<(string)> | null; + /** + * This is an array parameter that is sent as pipes format (pipe-separated values) + */ + parameterArrayPipes: Array<(string)> | null; + /** + * This is an array parameter that is sent as ssv format (space-separated values) + */ + parameterArraySsv: Array<(string)> | null; + /** + * This is an array parameter that is sent as tsv format (tab-separated values) + */ + parameterArrayTsv: Array<(string)> | null; +}; + +export type ComplexTypesData = { + /** + * Parameter containing object + */ + parameterObject: { + first?: { + second?: { + third?: string; + }; + }; + }; + /** + * Parameter containing reference + */ + parameterReference: ModelWithString; +}; + +export type ComplexTypesResponse = (Array); + +export type ComplexParamsData = { + id: number; + requestBody?: { + readonly key: (string) | null; + name: (string) | null; + enabled?: boolean; + readonly type: 'Monkey' | 'Horse' | 'Bird'; + listOfModels?: Array | null; + listOfStrings?: Array<(string)> | null; + parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); + readonly user?: { + readonly id?: number; + readonly name?: (string) | null; + }; + }; +}; + +export type ComplexParamsResponse = (ModelWithString); + +export type PatchApiNoTagResponse = (unknown); + +export type ImportData = { + requestBody: (ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly); +}; + +export type ImportResponse = (Model_From_Zendesk | ModelWithReadOnlyAndWriteOnly); + +export type FooWowResponse = (unknown); + +export type GetApiSimpleOperationData = { + /** + * foo in method + */ + fooParam: string; +}; + +export type GetApiSimpleOperationResponse = (number); + +export type CallWithDefaultParametersData = { + /** + * This is a simple boolean with default value + */ + parameterBoolean?: (boolean) | null; + /** + * This is a simple enum with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model with default value + */ + parameterModel?: (ModelWithString) | null; + /** + * This is a simple number with default value + */ + parameterNumber?: (number) | null; + /** + * This is a simple string with default value + */ + parameterString?: (string) | null; +}; + +export type CallWithDefaultOptionalParametersData = { + /** + * This is a simple boolean that is optional with default value + */ + parameterBoolean?: boolean; + /** + * This is a simple enum that is optional with default value + */ + parameterEnum?: 'Success' | 'Warning' | 'Error'; + /** + * This is a simple model that is optional with default value + */ + parameterModel?: ModelWithString; + /** + * This is a simple number that is optional with default value + */ + parameterNumber?: number; + /** + * This is a simple string that is optional with default value + */ + parameterString?: string; +}; + +export type CallToTestOrderOfParamsData = { + /** + * This is a optional string with default + */ + parameterOptionalStringWithDefault?: string; + /** + * This is a optional string with empty default + */ + parameterOptionalStringWithEmptyDefault?: string; + /** + * This is a optional string with no default + */ + parameterOptionalStringWithNoDefault?: string; + /** + * This is a string that can be null with default + */ + parameterStringNullableWithDefault?: (string) | null; + /** + * This is a string that can be null with no default + */ + parameterStringNullableWithNoDefault?: (string) | null; + /** + * This is a string with default + */ + parameterStringWithDefault: string; + /** + * This is a string with empty default + */ + parameterStringWithEmptyDefault: string; + /** + * This is a string with no default + */ + parameterStringWithNoDefault: string; +}; + +export type DeprecatedCallData = { + /** + * This parameter is deprecated + * @deprecated + */ + parameter: (DeprecatedModel) | null; +}; + +export type CallWithDescriptionsData = { + /** + * Testing backticks in string: `backticks` and ```multiple backticks``` should work + */ + parameterWithBackticks?: unknown; + /** + * Testing multiline comments in string: First line + * Second line + * + * Fourth line + */ + parameterWithBreaks?: unknown; + /** + * Testing expression placeholders in string: ${expression} should work + */ + parameterWithExpressionPlaceholders?: unknown; + /** + * Testing quotes in string: 'single quote''' and "double quotes""" should work + */ + parameterWithQuotes?: unknown; + /** + * Testing reserved characters in string: * inline * and ** inline ** should work + */ + parameterWithReservedCharacters?: unknown; + /** + * Testing slashes in string: \backwards\\\ and /forwards/// should work + */ + parameterWithSlashes?: unknown; +}; + +export type TestErrorCodeData = { + /** + * Status code to return + */ + status: number; +}; + +export type TestErrorCodeResponse = (unknown); + +export type FileResponseData = { + id: string; +}; + +export type FileResponseResponse = ((Blob | File)); + +export type PostApiFormDataData = { + /** + * A reusable request body + */ + formData?: ModelWithString; + /** + * This is a reusable parameter + */ + parameter?: string; +}; + +export type CallWithResultFromHeaderResponse = (string); + +export type MultipartRequestData = { + formData?: { + content?: (Blob | File); + data?: ((ModelWithString) | null); + }; +}; + +export type MultipartResponseResponse = ({ + file?: (Blob | File); + metadata?: { + foo?: string; + bar?: string; + }; +}); + +export type DummyAResponse = (_400); + +export type DummyBResponse = (void); + +export type CallWithNoContentResponseResponse = (void); + +export type CallWithResponseAndNoContentResponseResponse = (number | void); + +export type NonAsciiæøåÆøÅöôêÊ字符串Data = { + /** + * Dummy input param + */ + nonAsciiParamæøåÆøÅöôêÊ: number; +}; + +export type NonAsciiæøåÆøÅöôêÊ字符串Response = (Array); + +export type PutWithFormUrlEncodedData = { + formData: ArrayWithStrings; +}; + +export type DeleteFooData3 = { + /** + * bar in method + */ + barParam: string; + /** + * foo in method + */ + fooParam: string; + /** + * Parameter with illegal characters + */ + xFooBar: ModelWithString; +}; + +export type CallWithParametersData = { + /** + * This is the parameter that goes into the query params + */ + cursor: (string) | null; + fooAllOfEnum: (ModelWithNestedArrayEnumsDataFoo); + fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; + /** + * This is the parameter that goes into the cookie + */ + parameterCookie: (string) | null; + /** + * This is the parameter that goes into the header + */ + parameterHeader: (string) | null; + /** + * This is the parameter that goes into the path + */ + parameterPath: (string) | null; + /** + * This is the parameter that goes into the body + */ + requestBody: { + [key: string]: unknown; + } | null; +}; + +export type CallWithWeirdParameterNamesData = { + /** + * This is the parameter with a reserved keyword + */ + _default?: string; + /** + * This is the parameter that goes into the cookie + */ + parameterCookie: (string) | null; + /** + * This is the parameter that goes into the request header + */ + parameterHeader: (string) | null; + /** + * This is the parameter that goes into the path + */ + parameterPath1?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath2?: string; + /** + * This is the parameter that goes into the path + */ + parameterPath3?: string; + /** + * This is the parameter that goes into the request query params + */ + parameterQuery: (string) | null; + /** + * This is the parameter that goes into the body + */ + requestBody: (ModelWithString) | null; +}; + +export type GetCallWithOptionalParamData = { + /** + * This is an optional parameter + */ + page?: number; + /** + * This is a required parameter + */ + requestBody: ModelWithOneOfEnum; +}; + +export type PostCallWithOptionalParamData = { + /** + * This is a required parameter + */ + parameter: Pageable; + /** + * This is an optional parameter + */ + requestBody?: { + offset?: (number) | null; + }; +}; + +export type PostCallWithOptionalParamResponse = (number | void); + +export type PostApiRequestBodyData = { + /** + * A reusable request body + */ + foo?: ModelWithString; + /** + * This is a reusable parameter + */ + parameter?: string; +}; + +export type CallWithResponseResponse = (_import); + +export type CallWithDuplicateResponsesResponse = ((ModelWithBoolean & ModelWithInteger) | ModelWithString); + +export type CallWithResponsesResponse = ({ + readonly '@namespace.string'?: string; + readonly '@namespace.integer'?: number; + readonly value?: Array; +} | ModelThatExtends | ModelThatExtendsExtends); + +export type ApiVVersionODataControllerCountResponse = (Model_From_Zendesk); + +export type TypesData = { + /** + * This is a number parameter + */ + id?: number; + /** + * This is an array parameter + */ + parameterArray: Array<(string)> | null; + /** + * This is a boolean parameter + */ + parameterBoolean: (boolean) | null; + /** + * This is a dictionary parameter + */ + parameterDictionary: { + [key: string]: unknown; + } | null; + /** + * This is an enum parameter + */ + parameterEnum: ('Success' | 'Warning' | 'Error') | null; + /** + * This is a number parameter + */ + parameterNumber: number; + /** + * This is an object parameter + */ + parameterObject: { + [key: string]: unknown; + } | null; + /** + * This is a string parameter + */ + parameterString: (string) | null; + /** + * This is tuple parameter + */ + parameterTuple: [ + number, + number, + number, + number + ]; +}; + +export type TypesResponse = (number | string | boolean | { + [key: string]: unknown; +}); + +export type UploadFileData = { + formData: (Blob | File); +}; + +export type UploadFileResponse = (boolean); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiError.ts new file mode 100644 index 000000000..36675d288 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiError.ts @@ -0,0 +1,21 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; + +export class ApiError extends Error { + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: unknown; + public readonly request: ApiRequestOptions; + + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); + + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiRequestOptions.ts new file mode 100644 index 000000000..939a0aa4c --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiRequestOptions.ts @@ -0,0 +1,21 @@ +export type ApiRequestOptions = { + readonly body?: any; + readonly cookies?: Record; + readonly errors?: Record; + readonly formData?: Record | any[] | Blob | File; + readonly headers?: Record; + readonly mediaType?: string; + readonly method: + | 'DELETE' + | 'GET' + | 'HEAD' + | 'OPTIONS' + | 'PATCH' + | 'POST' + | 'PUT'; + readonly path?: Record; + readonly query?: Record; + readonly responseHeader?: string; + readonly responseTransformer?: (data: unknown) => Promise; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiResult.ts new file mode 100644 index 000000000..4c58e3913 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiResult.ts @@ -0,0 +1,7 @@ +export type ApiResult = { + readonly body: TData; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly url: string; +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/CancelablePromise.ts new file mode 100644 index 000000000..ccc082e8f --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/CancelablePromise.ts @@ -0,0 +1,126 @@ +export class CancelError extends Error { + constructor(message: string) { + super(message); + this.name = 'CancelError'; + } + + public get isCancelled(): boolean { + return true; + } +} + +export interface OnCancel { + readonly isResolved: boolean; + readonly isRejected: boolean; + readonly isCancelled: boolean; + + (cancelHandler: () => void): void; +} + +export class CancelablePromise implements Promise { + private _isResolved: boolean; + private _isRejected: boolean; + private _isCancelled: boolean; + readonly cancelHandlers: (() => void)[]; + readonly promise: Promise; + private _resolve?: (value: T | PromiseLike) => void; + private _reject?: (reason?: unknown) => void; + + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason?: unknown) => void, + onCancel: OnCancel + ) => void + ) { + this._isResolved = false; + this._isRejected = false; + this._isCancelled = false; + this.cancelHandlers = []; + this.promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + + const onResolve = (value: T | PromiseLike): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isResolved = true; + if (this._resolve) this._resolve(value); + }; + + const onReject = (reason?: unknown): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isRejected = true; + if (this._reject) this._reject(reason); + }; + + const onCancel = (cancelHandler: () => void): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this.cancelHandlers.push(cancelHandler); + }; + + Object.defineProperty(onCancel, 'isResolved', { + get: (): boolean => this._isResolved, + }); + + Object.defineProperty(onCancel, 'isRejected', { + get: (): boolean => this._isRejected, + }); + + Object.defineProperty(onCancel, 'isCancelled', { + get: (): boolean => this._isCancelled, + }); + + return executor(onResolve, onReject, onCancel as OnCancel); + }); + } + + get [Symbol.toStringTag]() { + return "Cancellable Promise"; + } + + public then( + onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null + ): Promise { + return this.promise.then(onFulfilled, onRejected); + } + + public catch( + onRejected?: ((reason: unknown) => TResult | PromiseLike) | null + ): Promise { + return this.promise.catch(onRejected); + } + + public finally(onFinally?: (() => void) | null): Promise { + return this.promise.finally(onFinally); + } + + public cancel(): void { + if (this._isResolved || this._isRejected || this._isCancelled) { + return; + } + this._isCancelled = true; + if (this.cancelHandlers.length) { + try { + for (const cancelHandler of this.cancelHandlers) { + cancelHandler(); + } + } catch (error) { + console.warn('Cancellation threw an error', error); + return; + } + } + this.cancelHandlers.length = 0; + if (this._reject) this._reject(new CancelError('Request aborted')); + } + + public get isCancelled(): boolean { + return this._isCancelled; + } +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/OpenAPI.ts new file mode 100644 index 000000000..0317507fa --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/OpenAPI.ts @@ -0,0 +1,56 @@ +import type { ApiRequestOptions } from './ApiRequestOptions'; + +type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware): void { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Middleware): void { + this._fns = [...this._fns, fn]; + } +} + +export type OpenAPIConfig = { + BASE: string; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + VERSION: string; + WITH_CREDENTIALS: boolean; + interceptors: { + request: Interceptors; + response: Interceptors; + }; +}; + +export const OpenAPI: OpenAPIConfig = { + BASE: 'http://localhost:3000/base', + CREDENTIALS: 'include', + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + TOKEN: undefined, + USERNAME: undefined, + VERSION: '1.0', + WITH_CREDENTIALS: false, + interceptors: { + request: new Interceptors(), + response: new Interceptors(), + }, +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/request.ts new file mode 100644 index 000000000..9b08a59cd --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/request.ts @@ -0,0 +1,350 @@ +import { ApiError } from './ApiError'; +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; +import { CancelablePromise } from './CancelablePromise'; +import type { OnCancel } from './CancelablePromise'; +import type { OpenAPIConfig } from './OpenAPI'; + +export const isString = (value: unknown): value is string => { + return typeof value === 'string'; +}; + +export const isStringWithValue = (value: unknown): value is string => { + return isString(value) && value !== ''; +}; + +export const isBlob = (value: any): value is Blob => { + return value instanceof Blob; +}; + +export const isFormData = (value: unknown): value is FormData => { + return value instanceof FormData; +}; + +export const isSuccess = (status: number): boolean => { + return status >= 200 && status < 300; +}; + +export const base64 = (str: string): string => { + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } +}; + +export const getQueryString = (params: Record): string => { + const qs: string[] = []; + + const append = (key: string, value: unknown) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; + + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; + } + + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { + value.forEach(v => encodePair(key, v)); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); + } + }; + + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); + + return qs.length ? `?${qs.join('&')}` : ''; +}; + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI; + + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); + + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; +}; + +export const getFormData = (options: ApiRequestOptions): FormData | undefined => { + if (options.formData) { + const formData = new FormData(); + + const process = (key: string, value: unknown) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; + + Object.entries(options.formData) + .filter(([, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); + + return formData; + } + return undefined; +}; + +type Resolver = (options: ApiRequestOptions) => Promise; + +export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; +}; + +export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { + const [token, username, password, additionalHeaders] = await Promise.all([ + // @ts-ignore + resolve(options, config.TOKEN), + // @ts-ignore + resolve(options, config.USERNAME), + // @ts-ignore + resolve(options, config.PASSWORD), + // @ts-ignore + resolve(options, config.HEADERS), + ]); + + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + }) + .filter(([, value]) => value !== undefined && value !== null) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); + + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } + + return new Headers(headers); +}; + +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body !== undefined) { + if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { + return JSON.stringify(options.body); + } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { + return options.body; + } else { + return JSON.stringify(options.body); + } + } + return undefined; +}; + +export const sendRequest = async ( + config: OpenAPIConfig, + options: ApiRequestOptions, + url: string, + body: any, + formData: FormData | undefined, + headers: Headers, + onCancel: OnCancel +): Promise => { + let xhr = new XMLHttpRequest(); + xhr.open(options.method, url, true); + xhr.withCredentials = config.WITH_CREDENTIALS; + + headers.forEach((value, key) => { + xhr.setRequestHeader(key, value); + }); + + return new Promise(async (resolve, reject) => { + xhr.onload = () => resolve(xhr); + xhr.onabort = () => reject(new Error('Request aborted')); + xhr.onerror = () => reject(new Error('Network error')); + + for (const fn of config.interceptors.request._fns) { + xhr = await fn(xhr); + } + + xhr.send(body ?? formData); + + onCancel(() => xhr.abort()); + }); +}; + +export const getResponseHeader = (xhr: XMLHttpRequest, responseHeader?: string): string | undefined => { + if (responseHeader) { + const content = xhr.getResponseHeader(responseHeader); + if (isString(content)) { + return content; + } + } + return undefined; +}; + +export const getResponseBody = (xhr: XMLHttpRequest): unknown => { + if (xhr.status !== 204) { + try { + const contentType = xhr.getResponseHeader('Content-Type'); + if (contentType) { + if (contentType.includes('application/json') || contentType.includes('+json')) { + return JSON.parse(xhr.responseText); + } else { + return xhr.responseText; + } + } + } catch (error) { + console.error(error); + } + } + return undefined; +}; + +export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Payload Too Large', + 414: 'URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Range Not Satisfiable', + 417: 'Expectation Failed', + 418: 'Im a teapot', + 421: 'Misdirected Request', + 422: 'Unprocessable Content', + 423: 'Locked', + 424: 'Failed Dependency', + 425: 'Too Early', + 426: 'Upgrade Required', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', + 451: 'Unavailable For Legal Reasons', + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 508: 'Loop Detected', + 510: 'Not Extended', + 511: 'Network Authentication Required', + ...options.errors, + } + + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } + + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } +}; + +/** + * Request method + * @param config The OpenAPI configuration object + * @param options The request options from the service + * @returns CancelablePromise + * @throws ApiError + */ +export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { + return new CancelablePromise(async (resolve, reject, onCancel) => { + try { + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); + const headers = await getHeaders(config, options); + + if (!onCancel.isCancelled) { + let response = await sendRequest(config, options, url, body, formData, headers, onCancel); + + for (const fn of config.interceptors.response._fns) { + response = await fn(response); + } + + const responseBody = getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + + let transformedBody = responseBody; + if (options.responseTransformer && isSuccess(response.status)) { + transformedBody = await options.responseTransformer(responseBody) + } + + const result: ApiResult = { + url, + ok: isSuccess(response.status), + status: response.status, + statusText: response.statusText, + body: responseHeader ?? transformedBody, + }; + + catchErrorCodes(options, result); + + resolve(result.body); + } + } catch (error) { + reject(error); + } + }); +}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/index.ts b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/index.ts new file mode 100644 index 000000000..50a1dd734 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/index.ts @@ -0,0 +1,6 @@ +// This file is auto-generated by @hey-api/openapi-ts +export { ApiError } from './core/ApiError'; +export { CancelablePromise, CancelError } from './core/CancelablePromise'; +export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/sdk.gen.ts new file mode 100644 index 000000000..5211e9979 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/sdk.gen.ts @@ -0,0 +1,80 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CancelablePromise } from './core/CancelablePromise'; +import { OpenAPI } from './core/OpenAPI'; +import { request as __request } from './core/request'; +import { type ParentModelWithDatesResponse, type ModelWithDatesResponse, type ModelWithDatesArrayResponse, type ArrayOfDatesResponse, type DateResponse, type MultipleResponsesResponse, ParentModelWithDatesResponseTransformer, ModelWithDatesResponseTransformer, ModelWithDatesArrayResponseTransformer } from './types.gen'; + +export class DefaultService { + /** + * @returns ParentModelWithDates Success + * @returns unknown Success + * @throws ApiError + */ + public static parentModelWithDates(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/model-with-dates', + responseTransformer: ParentModelWithDatesResponseTransformer + }); + } + + /** + * @returns ModelWithDates Success + * @throws ApiError + */ + public static modelWithDates(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/model-with-dates', + responseTransformer: ModelWithDatesResponseTransformer + }); + } + + /** + * @returns ModelWithDates Success + * @throws ApiError + */ + public static modelWithDatesArray(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/model-with-dates-array', + responseTransformer: ModelWithDatesArrayResponseTransformer + }); + } + + /** + * @returns string Success + * @throws ApiError + */ + public static arrayOfDates(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/array-of-dates' + }); + } + + /** + * @returns string Success + * @throws ApiError + */ + public static date(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/date' + }); + } + + /** + * @returns ModelWithDates Updated + * @returns SimpleModel Created + * @throws ApiError + */ + public static multipleResponses(): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/multiple-responses' + }); + } + +} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/types.gen.ts new file mode 100644 index 000000000..8c9227850 --- /dev/null +++ b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/types.gen.ts @@ -0,0 +1,106 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * This is a model that contains a some dates + */ +export type ModelWithDates = { + id: number; + name: string; + readonly enabled: boolean; + readonly modified: Date; + readonly expires?: Date; +}; + +/** + * This is a model that contains a some dates and arrays + */ +export type ParentModelWithDates = { + id: number; + readonly modified?: Date; + items?: Array; + item?: ModelWithDates; + 'nullable-date'?: Array<(Date | null)>; + simpleItems?: Array; + simpleItem?: SimpleModel; + dates?: Array<(Date)>; + strings?: Array<(string)>; +}; + +/** + * This is a model that contains a some dates + */ +export type SimpleModel = { + id: number; + name: string; + readonly enabled: boolean; +}; + +export type ParentModelWithDatesResponse = (ParentModelWithDates | unknown); + +export type ModelWithDatesResponse = (ModelWithDates); + +export type ModelWithDatesArrayResponse = (Array); + +export type ArrayOfDatesResponse = (Array<(Date)>); + +export type DateResponse = (Date); + +export type MultipleResponsesResponse = (Array | Array); + +export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; + +export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; + +export type ModelWithDatesModelResponseTransformer = (data: any) => ModelWithDates; + +export const ModelWithDatesModelResponseTransformer: ModelWithDatesModelResponseTransformer = data => { + if (data?.modified) { + data.modified = new Date(data.modified); + } + if (data?.expires) { + data.expires = new Date(data.expires); + } + return data; +}; + +export const ParentModelWithDatesModelResponseTransformer: ParentModelWithDatesModelResponseTransformer = data => { + if (data?.modified) { + data.modified = new Date(data.modified); + } + if (Array.isArray(data?.items)) { + data.items.forEach(ModelWithDatesModelResponseTransformer); + } + if (data?.item) { + ModelWithDatesModelResponseTransformer(data.item); + } + if (Array.isArray(data?.['nullable-date'])) { + data['nullable-date'] = data['nullable-date'].map(item => item ? new Date(item) : item); + } + if (Array.isArray(data?.dates)) { + data.dates = data.dates.map(item => item ? new Date(item) : item); + } + return data; +}; + +export const ParentModelWithDatesResponseTransformer: ParentModelWithDatesResponseTransformer = async (data) => { + if (data) { + ParentModelWithDatesModelResponseTransformer(data); + } + return data; +}; + +export type ModelWithDatesResponseTransformer = (data: any) => Promise; + +export const ModelWithDatesResponseTransformer: ModelWithDatesResponseTransformer = async (data) => { + ModelWithDatesModelResponseTransformer(data); + return data; +}; + +export type ModelWithDatesArrayResponseTransformer = (data: any) => Promise; + +export const ModelWithDatesArrayResponseTransformer: ModelWithDatesArrayResponseTransformer = async (data) => { + if (Array.isArray(data)) { + data.forEach(ModelWithDatesModelResponseTransformer); + } + return data; +}; \ No newline at end of file From 57dda7f057f9cc56177e68d675735e5fc82e6101 Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Mon, 14 Apr 2025 18:35:06 -0400 Subject: [PATCH 10/26] feat(config): update setup file reference in Vitest base config to use module path --- packages/config-vite-base/package.json | 3 ++- packages/config-vite-base/src/vitest.base.config.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/config-vite-base/package.json b/packages/config-vite-base/package.json index 0258265d6..f6aa21d9b 100644 --- a/packages/config-vite-base/package.json +++ b/packages/config-vite-base/package.json @@ -20,7 +20,8 @@ "types": "./dist/index.d.cts", "default": "./dist/index.cjs" } - } + }, + "./setup": "./src/setup.ts" }, "dependencies": { "vite": "^6.2.7", diff --git a/packages/config-vite-base/src/vitest.base.config.ts b/packages/config-vite-base/src/vitest.base.config.ts index b82e693cb..31f223247 100644 --- a/packages/config-vite-base/src/vitest.base.config.ts +++ b/packages/config-vite-base/src/vitest.base.config.ts @@ -25,7 +25,7 @@ export function createVitestConfig( }, }, root, - setupFiles: ['./setup.ts'], + setupFiles: ['@config/vite-base/setup'], testTimeout: platform() === 'win32' ? 10000 : 5000, }, }); From ad16a4ed9d0286073cf634f6d8976c61cba8dcba Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Mon, 14 Apr 2025 18:35:37 -0400 Subject: [PATCH 11/26] feat(turbo.json): add build task configuration for Nuxt project --- examples/openapi-ts-nuxt/turbo.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 examples/openapi-ts-nuxt/turbo.json diff --git a/examples/openapi-ts-nuxt/turbo.json b/examples/openapi-ts-nuxt/turbo.json new file mode 100644 index 000000000..91b0b247f --- /dev/null +++ b/examples/openapi-ts-nuxt/turbo.json @@ -0,0 +1,11 @@ +{ + "$schema": "../../node_modules/turbo/schema.json", + "extends": ["//"], + "tasks": { + "build": { + "cache": true, + "dependsOn": ["^build"], + "outputs": [".nuxt/**"] + } + } +} From 4cc4da00a1cb4dc0de9b1f7e7614a32b2c0bffcd Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Wed, 16 Apr 2025 21:35:54 -0400 Subject: [PATCH 12/26] fix(nx-plugin): fix plugin build output and enhance caching - fix typo in vitest.config output - change vitest.config to mts for better type support - list vite and vitest as a dep if enabled - change vitest to single fork runner - change build to only output cjs to support nx plugins - add caching and nx linking if spec file is in another project --- .../src/vitest.base.config.ts | 6 +- packages/nx-plugin/README.md | 7 + packages/nx-plugin/executors.json | 4 +- packages/nx-plugin/generators.json | 4 +- packages/nx-plugin/package.json | 17 +- .../{schema.json => updateApi.schema.json} | 0 .../{index.spec.ts => updateApi.spec.ts} | 4 +- .../update-api/{index.ts => updateApi.ts} | 5 +- ...{schema.json => openapiClient.schema.json} | 0 .../{index.spec.ts => openapiClient.spec.ts} | 8 +- .../{index.ts => openapiClient.ts} | 255 +++++++++++++----- .../tests/vitest/tsconfig.spec.json.template | 2 +- ...g.ts.template => vite.config.mts.template} | 3 +- packages/nx-plugin/src/test-utils.ts | 2 +- packages/nx-plugin/src/vars.ts | 2 +- packages/nx-plugin/tsup.config.ts | 26 +- 16 files changed, 221 insertions(+), 124 deletions(-) rename packages/nx-plugin/src/executors/update-api/{schema.json => updateApi.schema.json} (100%) rename packages/nx-plugin/src/executors/update-api/{index.spec.ts => updateApi.spec.ts} (98%) rename packages/nx-plugin/src/executors/update-api/{index.ts => updateApi.ts} (99%) rename packages/nx-plugin/src/generators/openapi-client/{schema.json => openapiClient.schema.json} (100%) rename packages/nx-plugin/src/generators/openapi-client/{index.spec.ts => openapiClient.spec.ts} (97%) rename packages/nx-plugin/src/generators/openapi-client/{index.ts => openapiClient.ts} (75%) rename packages/nx-plugin/src/generators/openapi-client/tests/vitest/{vite.config.ts.template => vite.config.mts.template} (90%) diff --git a/packages/config-vite-base/src/vitest.base.config.ts b/packages/config-vite-base/src/vitest.base.config.ts index 31f223247..695463e3d 100644 --- a/packages/config-vite-base/src/vitest.base.config.ts +++ b/packages/config-vite-base/src/vitest.base.config.ts @@ -15,13 +15,13 @@ export function createVitestConfig( provider: 'v8', }, exclude: [...configDefaults.exclude], - pool: platform() === 'win32' ? 'threads' : 'forks', + pool: 'forks', poolOptions: { forks: { - singleFork: false, + singleFork: true, }, threads: { - singleThread: false, + singleThread: true, }, }, root, diff --git a/packages/nx-plugin/README.md b/packages/nx-plugin/README.md index 2edd5d60f..8636ad92b 100644 --- a/packages/nx-plugin/README.md +++ b/packages/nx-plugin/README.md @@ -56,3 +56,10 @@ Run `nx run @my-org/my-generated-package:updateApi` - `client`: The type of client to generate. [ string ] (optional) (default: `@hey-api/client-fetch`) - `directory`: The directory to create the project in. [ string ] (optional) (default: `libs`) - `plugins`: Additional plugins to provide to the client api. [ string[] ] (optional) (default:[]) + +###### Spec File Notes + +If the spec file is a relative path and is located in the workspace then the containing project will be listed as an implicit dependency. +The assumption is made that that project will generate the API spec file on build. + +If the spec file is a URL then we fetch the spec during cache checks to determine if we should rebuild the client code. diff --git a/packages/nx-plugin/executors.json b/packages/nx-plugin/executors.json index d711dc0d2..bb1b90da0 100644 --- a/packages/nx-plugin/executors.json +++ b/packages/nx-plugin/executors.json @@ -1,8 +1,8 @@ { "executors": { "update-api": { - "implementation": "./dist/updateApi.js", - "schema": "./dist/executors/update-api/schema.json", + "implementation": "./dist/updateApi.cjs", + "schema": "./dist/executors/update-api/updateApi.schema.json", "description": "Updates the OpenAPI spec file and generates new client code if needed." } } diff --git a/packages/nx-plugin/generators.json b/packages/nx-plugin/generators.json index 9cd238e48..c4ea380fd 100644 --- a/packages/nx-plugin/generators.json +++ b/packages/nx-plugin/generators.json @@ -3,8 +3,8 @@ "version": "0.0.1", "generators": { "openapi-client": { - "factory": "./dist/openapiClient.js", - "schema": "./dist/generators/openapi-client/schema.json", + "factory": "./dist/openapiClient.cjs", + "schema": "./dist/generators/openapi-client/openapiClient.schema.json", "description": "Generate an OpenAPI client library from an OpenAPI spec file." } } diff --git a/packages/nx-plugin/package.json b/packages/nx-plugin/package.json index e7a6456fc..256cf31b6 100644 --- a/packages/nx-plugin/package.json +++ b/packages/nx-plugin/package.json @@ -25,13 +25,12 @@ "nx", "swagger" ], - "type": "module", + "type": "commonjs", "main": "./dist/index.cjs", - "module": "./dist/index.js", + "module": "./dist/index.cjs", "types": "./dist/index.d.ts", "scripts": { - "build": "tsup && pnpm check-exports", - "check-exports": "attw --pack .", + "build": "tsup", "test:watch": "vitest watch --config vitest.config.ts", "test": "vitest run --config vitest.config.ts", "typecheck": "tsc --noEmit", @@ -39,10 +38,6 @@ }, "exports": { ".": { - "import": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - }, "require": { "types": "./dist/index.d.cts", "default": "./dist/index.cjs" @@ -50,8 +45,8 @@ }, "./package.json": "./package.json" }, - "executors": "./dist/executors.json", - "generators": "./dist/generators.json", + "executors": "./executors.json", + "generators": "./generators.json", "dependencies": { "@hey-api/json-schema-ref-parser": "1.0.4", "@hey-api/openapi-ts": "workspace:*", @@ -67,6 +62,8 @@ "vitest": "3.1.1" }, "files": [ + "executors.json", + "generators.json", "package.json", "dist", "LICENSE.md" diff --git a/packages/nx-plugin/src/executors/update-api/schema.json b/packages/nx-plugin/src/executors/update-api/updateApi.schema.json similarity index 100% rename from packages/nx-plugin/src/executors/update-api/schema.json rename to packages/nx-plugin/src/executors/update-api/updateApi.schema.json diff --git a/packages/nx-plugin/src/executors/update-api/index.spec.ts b/packages/nx-plugin/src/executors/update-api/updateApi.spec.ts similarity index 98% rename from packages/nx-plugin/src/executors/update-api/index.spec.ts rename to packages/nx-plugin/src/executors/update-api/updateApi.spec.ts index f99251a60..cb6a07fe8 100644 --- a/packages/nx-plugin/src/executors/update-api/index.spec.ts +++ b/packages/nx-plugin/src/executors/update-api/updateApi.spec.ts @@ -7,11 +7,11 @@ import { type ExecutorContext, logger } from '@nx/devkit'; import { randomUUID } from 'crypto'; import { afterAll, describe, expect, it, vi } from 'vitest'; -import generator from '../../generators/openapi-client'; +import generator from '../../generators/openapi-client/openapiClient'; import { getGeneratorOptions, TestOptions } from '../../test-utils'; import { CONSTANTS } from '../../vars'; -import executor from '.'; import type { UpdateApiExecutorSchema } from './schema'; +import executor from './updateApi'; vi.mock('@hey-api/openapi-ts/internal', async (importOriginal) => { const actual = diff --git a/packages/nx-plugin/src/executors/update-api/index.ts b/packages/nx-plugin/src/executors/update-api/updateApi.ts similarity index 99% rename from packages/nx-plugin/src/executors/update-api/index.ts rename to packages/nx-plugin/src/executors/update-api/updateApi.ts index e694645a5..9e483d5e7 100644 --- a/packages/nx-plugin/src/executors/update-api/index.ts +++ b/packages/nx-plugin/src/executors/update-api/updateApi.ts @@ -160,7 +160,6 @@ const runExecutor: PromiseExecutor = async ( logger.info('No changes detected in the API spec.'); if (!force) { logger.info('Force flag is false. Skipping client code generation.'); - await cleanup(absoluteTempFolder); return { success: true }; } else { logger.info('Force flag is true. Generating new client code...'); @@ -237,13 +236,13 @@ const runExecutor: PromiseExecutor = async ( }); logger.info('Successfully updated API client and spec files.'); - await cleanup(absoluteTempFolder); return { success: true }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); logger.debug(`Error details: ${errorMessage}.`); - await cleanup(absoluteTempFolder); return { success: false }; + } finally { + await cleanup(absoluteTempFolder); } }; diff --git a/packages/nx-plugin/src/generators/openapi-client/schema.json b/packages/nx-plugin/src/generators/openapi-client/openapiClient.schema.json similarity index 100% rename from packages/nx-plugin/src/generators/openapi-client/schema.json rename to packages/nx-plugin/src/generators/openapi-client/openapiClient.schema.json diff --git a/packages/nx-plugin/src/generators/openapi-client/index.spec.ts b/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts similarity index 97% rename from packages/nx-plugin/src/generators/openapi-client/index.spec.ts rename to packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts index e54195dc2..4b4caa5f5 100644 --- a/packages/nx-plugin/src/generators/openapi-client/index.spec.ts +++ b/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts @@ -8,13 +8,13 @@ import { afterAll, beforeEach, describe, expect, it, vi } from 'vitest'; import { getGeneratorOptions } from '../../test-utils'; import { generateClientCode } from '../../utils'; -import generator, { updateTsConfig } from './index'; +import generator, { updateTsConfig } from './openapiClient'; import { generateApi, generateNxProject, normalizeOptions, updatePackageJson, -} from './index'; +} from './openapiClient'; vi.mock('@hey-api/openapi-ts', async (importOriginal) => { const actual = await importOriginal(); @@ -128,7 +128,7 @@ describe('openapi-client generator', () => { }); const normalizedOptions = normalizeOptions(options); - generateNxProject({ clientPlugins: {}, normalizedOptions, tree }); + await generateNxProject({ clientPlugins: {}, normalizedOptions, tree }); const config = readJson( tree, @@ -147,7 +147,7 @@ describe('openapi-client generator', () => { }); const normalizedOptions = normalizeOptions(options); - generateNxProject({ clientPlugins: {}, normalizedOptions, tree }); + await generateNxProject({ clientPlugins: {}, normalizedOptions, tree }); expect( tree.exists(`${normalizedOptions.projectRoot}/tsconfig.json`), diff --git a/packages/nx-plugin/src/generators/openapi-client/index.ts b/packages/nx-plugin/src/generators/openapi-client/openapiClient.ts similarity index 75% rename from packages/nx-plugin/src/generators/openapi-client/index.ts rename to packages/nx-plugin/src/generators/openapi-client/openapiClient.ts index 1eb856eff..2aab962ef 100644 --- a/packages/nx-plugin/src/generators/openapi-client/index.ts +++ b/packages/nx-plugin/src/generators/openapi-client/openapiClient.ts @@ -1,18 +1,23 @@ -import { existsSync, writeFileSync } from 'node:fs'; +import { existsSync, mkdirSync, writeFileSync } from 'node:fs'; import { mkdir, rm } from 'node:fs/promises'; -import { join } from 'node:path'; +import { isAbsolute, join, resolve } from 'node:path'; import type { ProjectConfiguration, Tree } from '@nx/devkit'; import { addDependenciesToPackageJson, addProjectConfiguration, + detectPackageManager, formatFiles, generateFiles, + getProjects, installPackagesTask, + isWorkspacesEnabled, joinPathFragments, logger, names, + readJson, updateJson, + workspaceRoot, } from '@nx/devkit'; import packageJson from '../../../package.json'; @@ -98,6 +103,10 @@ export type TestRunner = 'vitest'; const testRunners: Record< TestRunner, { + /** + * Additional dev dependencies to be added to the project + */ + additionalDevDependencies?: string[]; /** * The template path to the test files */ @@ -105,6 +114,7 @@ const testRunners: Record< } > = { vitest: { + additionalDevDependencies: ['vite', 'vitest'], templatePath: './tests/vitest', }, }; @@ -143,7 +153,7 @@ export interface OpenApiClientGeneratorSchema { */ tags?: string[]; /** - * The directory to use for the temp folder, defaults to `./tmp` + * The directory to use for the temp folder, defaults to `./plugin-tmp` * Only used for testing purposes */ tempFolderDir?: string; @@ -160,28 +170,26 @@ export default async function ( logger.info( `Starting OpenAPI client generator with options: ${JSON.stringify(options, null, 2)}`, ); + const normalizedOptions = normalizeOptions(options); + logger.debug( + `Normalized options: ${JSON.stringify(normalizedOptions, null, 2)}`, + ); + const { + clientType, + isPrivate, + plugins, + projectName, + projectRoot, + projectScope, + specFile, + tempFolder, + } = normalizedOptions; + const absoluteTempFolder = join(process.cwd(), tempFolder); + logger.info( + `Generating OpenAPI client for '${projectName}' using client type '${clientType}'`, + ); + logger.debug(`Using plugins: ${plugins.join(', ')}`); try { - const normalizedOptions = normalizeOptions(options); - logger.debug( - `Normalized options: ${JSON.stringify(normalizedOptions, null, 2)}`, - ); - - const { - clientType, - isPrivate, - plugins, - projectName, - projectRoot, - projectScope, - specFile, - tempFolder, - } = normalizedOptions; - - logger.info( - `Generating OpenAPI client for '${projectName}' using client type '${clientType}'`, - ); - logger.debug(`Using plugins: ${plugins.join(', ')}`); - const clientPlugins = getClientPlugins({ ...normalizedOptions, inputPlugins: plugins, @@ -198,7 +206,7 @@ export default async function ( // Generate the Nx project logger.info(`Generating Nx project structure`); - generateNxProject({ + await generateNxProject({ clientPlugins, normalizedOptions, tree, @@ -206,7 +214,7 @@ export default async function ( // Generate the api client code logger.info(`Generating API client code using spec file: ${specFile}`); - await generateApi({ + const { specFileLocalLocations } = await generateApi({ client: clientType, plugins, projectRoot, @@ -241,18 +249,13 @@ export default async function ( clientType, outputPath: `${projectRoot}/src/${CONSTANTS.GENERATED_DIR_NAME}`, plugins, - specFile: `${tempFolder}/${CONSTANTS.SPEC_DIR_NAME}/${CONSTANTS.SPEC_FILE_NAME}`, + specFile: specFileLocalLocations, }); // Format the files logger.debug(`Formatting generated files`); await formatFiles(tree); - // Remove the temp folder - const absoluteTempFolder = join(process.cwd(), tempFolder); - logger.debug(`Removing temp folder: ${absoluteTempFolder}`); - await rm(absoluteTempFolder, { force: true, recursive: true }); - logger.info( `OpenAPI client generator completed successfully for ${projectName}`, ); @@ -260,13 +263,20 @@ export default async function ( return async () => { logger.info(`Installing dependencies for ${projectName}`); await installDeps(); - installPackagesTask(tree); + const packageManager = detectPackageManager(workspaceRoot); + const installDirectory = isWorkspacesEnabled(packageManager) + ? workspaceRoot + : projectRoot; + installPackagesTask(tree, true, installDirectory, packageManager); logger.info(`Dependencies installed successfully`); }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); logger.error(`OpenAPI client generator failed: ${errorMessage}`); throw error; + } finally { + logger.debug(`Removing temp folder: ${absoluteTempFolder}`); + await rm(absoluteTempFolder, { force: true, recursive: true }); } } @@ -332,10 +342,46 @@ export function normalizeOptions( }; } +/** + * Builds the spec path + */ +export function buildSpecPath(specPath: string) { + const isSpecFileUrl = isUrl(specPath); + if (isSpecFileUrl) { + return specPath; + } + const isSpecFileAbsolutePath = isAbsolute(specPath); + if (isSpecFileAbsolutePath) { + return specPath; + } + const newSpecPath = specPath.replace('./', `{workspaceRoot}/`); + return newSpecPath; +} + +export function buildUpdateOptions({ + clientType, + plugins, + projectDirectory, + projectName, + projectScope, + specFile, +}: NormalizedOptions): UpdateApiExecutorSchema { + const newSpecFilePath = buildSpecPath(specFile); + + return { + client: clientType, + directory: projectDirectory, + name: projectName, + plugins, + scope: projectScope, + spec: newSpecFilePath, + }; +} + /** * Generates the nx project */ -export function generateNxProject({ +export async function generateNxProject({ clientPlugins, normalizedOptions, tree, @@ -348,7 +394,6 @@ export function generateNxProject({ const { clientType, plugins, - projectDirectory, projectName, projectRoot, projectScope, @@ -357,17 +402,8 @@ export function generateNxProject({ test, } = normalizedOptions; - const updateOptions: UpdateApiExecutorSchema = { - client: clientType, - directory: projectDirectory, - name: projectName, - plugins, - scope: projectScope, - spec: specFile, - }; - const specIsAFile = isAFile(specFile); - const specIsRemote = isUrl(specFile); + const isSpecRemote = isUrl(specFile); const additionalEntryPoints: string[] = []; @@ -386,12 +422,14 @@ export function generateNxProject({ '{projectRoot}/openapi-ts.config.ts', ]; - const updateInputs: Input[] = [...baseInputs]; + const dependentTasksOutputFiles = '**/*.{ts,json,yml,yaml}'; + + const updateInputs: Input[] = [{ dependentTasksOutputFiles }, ...baseInputs]; if (specIsAFile) { // if the spec file is a file then we need to add it to inputs so that it is watched by NX - updateInputs.push(specFile); - } else if (specIsRemote) { + updateInputs.push(buildSpecPath(specFile)); + } else if (isSpecRemote) { // here we should add a hash of the spec file to the inputs so that NX will watch for changes // fetch the spec file from url and get the hash const apiHash: Input = { @@ -406,21 +444,29 @@ export function generateNxProject({ const generateOutputs: Output[] = ['{options.outputPath}']; const generateOutputPath = `./src/${CONSTANTS.GENERATED_DIR_NAME}`; + // if the spec file is remote then we don't need to depend on a project + // otherwise we need to get the project that the spec file is in (if it is in a project) + const dependsOnProject = isSpecRemote + ? undefined + : await getProjectThatSpecIsIn(tree, specFile); + if (dependsOnProject) { + logger.debug( + `Setting ${dependsOnProject} as an implicit dependency because the spec file is in that project.`, + ); + } + // Create basic project structure addProjectConfiguration(tree, `${projectScope}/${projectName}`, { + implicitDependencies: dependsOnProject ? [dependsOnProject] : [], projectType: 'library', root: projectRoot, sourceRoot: `{projectRoot}/src`, tags: tagArray, targets: { build: { - dependsOn: ['updateApi'], + dependsOn: ['^build', 'updateApi'], executor: '@nx/js:tsc', - inputs: [ - { dependentTasksOutputFiles: '**/*.ts' }, - '^build', - ...baseInputs, - ], + inputs: [{ dependentTasksOutputFiles }, ...baseInputs], options: { additionalEntryPoints, assets: [ @@ -457,9 +503,10 @@ export function generateNxProject({ // this adds the update-api executor to the generated project updateApi: { cache: true, + dependsOn: ['^build'], executor: `${packageJson.name}:update-api`, inputs: updateInputs, - options: updateOptions, + options: buildUpdateOptions(normalizedOptions), outputs: [ `{projectRoot}/src/${CONSTANTS.GENERATED_DIR_NAME}`, `{projectRoot}/${CONSTANTS.SPEC_DIR_NAME}`, @@ -491,7 +538,7 @@ export function generateNxProject({ // Generate the test files if (test !== 'none') { - generateTestFiles({ + await generateTestFiles({ generatedOptions, projectRoot, test, @@ -520,7 +567,7 @@ function handlePlugin({ } } -export function generateTestFiles({ +export async function generateTestFiles({ generatedOptions, projectRoot, test, @@ -549,6 +596,26 @@ export function generateTestFiles({ projectRoot, generatedOptions, ); + + // add the dev dependencies + const { additionalDevDependencies } = testRunners[test]; + if (additionalDevDependencies && additionalDevDependencies.length > 0) { + const depsTask = additionalDevDependencies.map(getPackageDetails); + const results = await Promise.all(depsTask); + const devDeps = results.reduce( + (acc, result) => { + acc[result.packageName] = result.packageVersion; + return acc; + }, + {} as Record, + ); + addDependenciesToPackageJson( + tree, + {}, + devDeps, + join(projectRoot, 'package.json'), + ); + } } /** @@ -605,26 +672,32 @@ export async function generateApi({ const dereferencedSpecString = JSON.stringify(dereferencedSpec, null, 2); const absoluteSpecDestination = join(process.cwd(), tempSpecFolder); - // Read the bundled file back into the tree - if (dereferencedSpec) { - try { - // write to temp spec destination - await mkdir(absoluteSpecDestination, { recursive: true }); - writeFileSync(absoluteTempSpecDestination, dereferencedSpecString); - } catch (error: unknown) { - const errorMessage = - error instanceof Error ? error.message : String(error); - logger.error( - `Failed to write dereferenced spec to temp file: ${errorMessage}.`, - ); - throw error; - } - // write to to destination in the tree - tree.write(specDestination, dereferencedSpecString); - } else { + if (!dereferencedSpec) { logger.error('Failed to bundle spec file.'); throw new Error('Failed to bundle spec file.'); } + + // Read the bundled file back into the tree + try { + // write to temp spec destination + mkdirSync(absoluteSpecDestination, { recursive: true }); + writeFileSync(absoluteTempSpecDestination, dereferencedSpecString); + logger.debug( + `Dereferenced spec written to temp file: ${absoluteTempSpecDestination}`, + ); + } catch (error: unknown) { + const errorMessage = + error instanceof Error ? error.message : String(error); + logger.error( + `Failed to write dereferenced spec to temp file: ${errorMessage}.`, + ); + throw error; + } + // write to to destination in the tree + tree.write(specDestination, dereferencedSpecString); + return { + specFileLocalLocations: absoluteTempSpecDestination, + }; } catch (error: unknown) { const errorMessage = error instanceof Error ? error.message : String(error); logger.error(`Failed to bundle OpenAPI spec: ${errorMessage}.`); @@ -758,3 +831,37 @@ export function updateTsConfig({ throw error; } } + +/** + * Get the project that the spec file is in, if the spec file is in the root then do not return anything, + * if the spec file is in a subdirectory then return the project that the subdirectory is in + * @param tree - The tree to get the project from + * @param specFile - The spec file to get the project from + * @returns The project that the spec file is in + */ +export async function getProjectThatSpecIsIn(tree: Tree, specFile: string) { + const projects = getProjects(tree); + for (const project of projects.values()) { + const normalizedSpecFile = resolve(specFile); + const normalizedProjectRoot = resolve(project.root); + // if the spec file is under the project root then return the project name + if (normalizedSpecFile.startsWith(normalizedProjectRoot)) { + const projectJsonName = project.name; + if (projectJsonName) { + logger.debug('Provided spec file is in project: ', projectJsonName); + return projectJsonName; + } + const packageJsonPath = join(project.root, 'package.json'); + const packageJson = readJson(tree, packageJsonPath); + const projectName = packageJson.name; + if (!projectName) { + throw new Error('No name found in package.json.'); + } else if (typeof projectName === 'string') { + logger.debug('Provided spec file is in project: ', projectName); + return projectName; + } + throw new Error('Project name is not a valid string.'); + } + } + return null; +} diff --git a/packages/nx-plugin/src/generators/openapi-client/tests/vitest/tsconfig.spec.json.template b/packages/nx-plugin/src/generators/openapi-client/tests/vitest/tsconfig.spec.json.template index e41666556..3d2f3e498 100644 --- a/packages/nx-plugin/src/generators/openapi-client/tests/vitest/tsconfig.spec.json.template +++ b/packages/nx-plugin/src/generators/openapi-client/tests/vitest/tsconfig.spec.json.template @@ -13,7 +13,7 @@ "moduleResolution": "nodenext" }, "include": [ - "vite.config.ts, + "vite.config.mts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.test.tsx", diff --git a/packages/nx-plugin/src/generators/openapi-client/tests/vitest/vite.config.ts.template b/packages/nx-plugin/src/generators/openapi-client/tests/vitest/vite.config.mts.template similarity index 90% rename from packages/nx-plugin/src/generators/openapi-client/tests/vitest/vite.config.ts.template rename to packages/nx-plugin/src/generators/openapi-client/tests/vitest/vite.config.mts.template index ef423b002..38c7b61e8 100644 --- a/packages/nx-plugin/src/generators/openapi-client/tests/vitest/vite.config.ts.template +++ b/packages/nx-plugin/src/generators/openapi-client/tests/vitest/vite.config.mts.template @@ -1,5 +1,4 @@ -/// -import { defineConfig } from 'vite'; +import { defineConfig } from 'vitest/config'; import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin'; diff --git a/packages/nx-plugin/src/test-utils.ts b/packages/nx-plugin/src/test-utils.ts index 71797a1e7..0a1cb487d 100644 --- a/packages/nx-plugin/src/test-utils.ts +++ b/packages/nx-plugin/src/test-utils.ts @@ -5,7 +5,7 @@ import { join } from 'node:path'; import { logger, type Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import type { OpenApiClientGeneratorSchema } from './generators/openapi-client'; +import type { OpenApiClientGeneratorSchema } from './generators/openapi-client/openapiClient'; export const TestOptions = { client: '@hey-api/client-fetch', diff --git a/packages/nx-plugin/src/vars.ts b/packages/nx-plugin/src/vars.ts index ba3844c6b..fce5ab624 100644 --- a/packages/nx-plugin/src/vars.ts +++ b/packages/nx-plugin/src/vars.ts @@ -3,7 +3,7 @@ export const CONSTANTS = { GENERATED_DIR_NAME: 'generated', SPEC_DIR_NAME: 'api', SPEC_FILE_NAME: 'spec.yaml', - TMP_DIR_NAME: 'tmp', + TMP_DIR_NAME: 'plugin-tmp', TS_BASE_CONFIG_NAME: 'tsconfig.base.json', TS_LIB_CONFIG_NAME: 'tsconfig.lib.json', TS_SPEC_CONFIG_NAME: 'tsconfig.spec.json', diff --git a/packages/nx-plugin/tsup.config.ts b/packages/nx-plugin/tsup.config.ts index 317d68b1e..0edfcdc8b 100644 --- a/packages/nx-plugin/tsup.config.ts +++ b/packages/nx-plugin/tsup.config.ts @@ -1,33 +1,21 @@ import { defineConfig } from 'tsup'; export default defineConfig((options) => ({ - banner(ctx) { - /** - * fix dynamic require in ESM - * @link https://github.com/hey-api/openapi-ts/issues/1079 - */ - if (ctx.format === 'esm') { - return { - js: "import { createRequire } from 'module'; const require = createRequire(import.meta.url);", - }; - } - }, clean: true, dts: true, entry: { index: 'src/index.ts', - openapiClient: 'src/generators/openapi-client/index.ts', - updateApi: 'src/executors/update-api/index.ts', + openapiClient: 'src/generators/openapi-client/openapiClient.ts', + updateApi: 'src/executors/update-api/updateApi.ts', }, - format: ['cjs', 'esm'], + format: ['cjs'], minify: !options.watch, onSuccess: 'node scripts/copy-json-files.mjs', outDir: 'dist', - outExtension({ format }) { - return { - js: format === 'cjs' ? '.cjs' : '.js', - }; - }, + outExtension: ({ format }) => ({ + js: format === 'cjs' ? '.cjs' : '.js', + }), + shims: false, sourcemap: true, treeshake: true, From 43baacf9d44d545346168753bb6ae242ea4d2112 Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Thu, 24 Apr 2025 21:01:45 -0400 Subject: [PATCH 13/26] refactor(nx-plugin): enhance plugin handling and directory management - Replace direct mkdir calls with makeDir utility for consistent directory creation. - Update plugin handling in client generation to support additional plugins. - Modify tests and schemas to reflect changes in plugin structure and options. - Improve error handling and logging in updateApi executor. - Add formatting functionality for generated files and update README for clarity. --- .../src/executors/update-api/schema.d.ts | 4 +- .../executors/update-api/updateApi.spec.ts | 18 +- .../src/executors/update-api/updateApi.ts | 49 +++- .../src/generators/openapi-client/README.md | 2 +- .../files/openapi-ts.config.ts.template | 2 +- .../files/src/index.ts.template | 1 + .../openapi-client/openapiClient.schema.json | 5 + .../openapi-client/openapiClient.spec.ts | 10 +- .../openapi-client/openapiClient.ts | 108 ++++++--- packages/nx-plugin/src/test-utils.ts | 5 +- packages/nx-plugin/src/utils.spec.ts | 14 +- packages/nx-plugin/src/utils.ts | 53 +++- pnpm-lock.yaml | 228 +----------------- 13 files changed, 198 insertions(+), 301 deletions(-) diff --git a/packages/nx-plugin/src/executors/update-api/schema.d.ts b/packages/nx-plugin/src/executors/update-api/schema.d.ts index ebf72493a..e5d9e8267 100644 --- a/packages/nx-plugin/src/executors/update-api/schema.d.ts +++ b/packages/nx-plugin/src/executors/update-api/schema.d.ts @@ -1,3 +1,5 @@ +import type { Plugin } from '../../utils'; + export interface UpdateApiExecutorSchema { client: string; directory: string; @@ -6,7 +8,7 @@ export interface UpdateApiExecutorSchema { */ force?: boolean; name: string; - plugins: string[]; + plugins: Plugin[]; scope: string; spec: string; /** diff --git a/packages/nx-plugin/src/executors/update-api/updateApi.spec.ts b/packages/nx-plugin/src/executors/update-api/updateApi.spec.ts index cb6a07fe8..610ec59c0 100644 --- a/packages/nx-plugin/src/executors/update-api/updateApi.spec.ts +++ b/packages/nx-plugin/src/executors/update-api/updateApi.spec.ts @@ -1,5 +1,5 @@ import { existsSync } from 'node:fs'; -import { mkdir, readFile, rm, writeFile } from 'node:fs/promises'; +import { readFile, rm, writeFile } from 'node:fs/promises'; import { join } from 'node:path'; import type { initConfigs } from '@hey-api/openapi-ts/internal'; @@ -9,6 +9,7 @@ import { afterAll, describe, expect, it, vi } from 'vitest'; import generator from '../../generators/openapi-client/openapiClient'; import { getGeneratorOptions, TestOptions } from '../../test-utils'; +import { makeDir } from '../../utils'; import { CONSTANTS } from '../../vars'; import type { UpdateApiExecutorSchema } from './schema'; import executor from './updateApi'; @@ -55,7 +56,7 @@ const getExecutorOptions = async (name: string) => { // Create the API directory and spec file const absoluteApiDir = join(process.cwd(), apiDir); if (!existsSync(absoluteApiDir)) { - await mkdir(absoluteApiDir, { recursive: true }); + await makeDir(absoluteApiDir); } const specPath = join(apiDir, testSpecName); const absoluteSpecPath = join(process.cwd(), specPath); @@ -140,9 +141,7 @@ describe('UpdateApi Executor', () => { 'api', 'invalid.yaml', ); - await mkdir(join(process.cwd(), options.directory, options.name, 'api'), { - recursive: true, - }); + await makeDir(join(process.cwd(), options.directory, options.name, 'api')); await writeFile(invalidSpecPath, 'invalid: yaml'); options.spec = invalidSpecPath; @@ -197,16 +196,13 @@ describe('UpdateApi Executor', () => { 'new-spec.yaml', ); const existingSpec = await readFile(existingSpecPath, 'utf-8'); - await mkdir( + await makeDir( join( process.cwd(), options.directory, options.name, CONSTANTS.SPEC_DIR_NAME, ), - { - recursive: true, - }, ); await writeFile(newSpecPath, existingSpec); options.spec = newSpecPath; @@ -257,9 +253,7 @@ paths: `; await generator(tree, generatorOptions); - await mkdir(absoluteApiDir, { - recursive: true, - }); + await makeDir(absoluteApiDir); if (existsSync(v2SpecPath)) { logger.debug(`Spec file already exists: ${v2SpecPath}`); await writeFile(v2SpecPath, v2Spec); diff --git a/packages/nx-plugin/src/executors/update-api/updateApi.ts b/packages/nx-plugin/src/executors/update-api/updateApi.ts index 9e483d5e7..99fa6f1f1 100644 --- a/packages/nx-plugin/src/executors/update-api/updateApi.ts +++ b/packages/nx-plugin/src/executors/update-api/updateApi.ts @@ -1,14 +1,17 @@ import { existsSync, writeFileSync } from 'node:fs'; -import { cp, mkdir, readFile, rm } from 'node:fs/promises'; +import { cp, readFile, rm } from 'node:fs/promises'; import { join } from 'node:path'; import type { PromiseExecutor } from '@nx/devkit'; -import { logger } from '@nx/devkit'; +import { logger, names } from '@nx/devkit'; +import { format } from 'prettier'; import { bundleAndDereferenceSpecFile, compareSpecs, + formatFiles, generateClientCode, + makeDir, } from '../../utils'; import { CONSTANTS } from '../../vars'; import type { UpdateApiExecutorSchema } from './schema'; @@ -40,7 +43,7 @@ async function setup({ if (!existsSync(absoluteTempApiFolder)) { logger.debug(`Creating executor temp api folder: ${absoluteTempApiFolder}`); - await mkdir(absoluteTempApiFolder, { recursive: true }); + await makeDir(absoluteTempApiFolder); logger.debug(`Created temp API folder: ${absoluteTempApiFolder}`); } else { logger.debug(`Temp API folder already exists: ${absoluteTempApiFolder}`); @@ -129,7 +132,11 @@ const runExecutor: PromiseExecutor = async ( // eslint-disable-next-line @typescript-eslint/no-unused-vars _context, ) => { - const tempFolder = options.tempFolder ?? CONSTANTS.TMP_DIR_NAME; + const tempFolder = + // use the provided temp folder or use the default temp folder and append the project name to it + // we append the project name to the temp folder to avoid conflicts between different projects using the same temp folder + options.tempFolder ?? + join(CONSTANTS.TMP_DIR_NAME, names(options.name).fileName); const absoluteTempFolder = join(process.cwd(), tempFolder); const force = options.force ?? false; @@ -160,6 +167,7 @@ const runExecutor: PromiseExecutor = async ( logger.info('No changes detected in the API spec.'); if (!force) { logger.info('Force flag is false. Skipping client code generation.'); + await cleanup(absoluteTempFolder); return { success: true }; } else { logger.info('Force flag is true. Generating new client code...'); @@ -175,7 +183,7 @@ const runExecutor: PromiseExecutor = async ( const absoluteGeneratedTempDir = join(process.cwd(), generatedTempDir); if (!existsSync(absoluteGeneratedTempDir)) { - await mkdir(absoluteGeneratedTempDir); + await makeDir(absoluteGeneratedTempDir); } // Generate new client code @@ -200,7 +208,10 @@ const runExecutor: PromiseExecutor = async ( } else { logger.debug('No existing spec file found. Creating...'); } - writeFileSync(absoluteExistingSpecPath, newSpecString); + const formattedSpec = await format(newSpecString, { + parser: 'yaml', + }); + writeFileSync(absoluteExistingSpecPath, formattedSpec); logger.debug(`Spec file updated successfully`); } else { logger.error( @@ -224,10 +235,16 @@ const runExecutor: PromiseExecutor = async ( // Remove old generated directory if it exists if (existsSync(absoluteProjectGeneratedDir)) { + logger.debug( + `Removing old generated directory: ${absoluteProjectGeneratedDir}`, + ); await rm(absoluteProjectGeneratedDir, { force: true, recursive: true, }); + logger.debug( + `Old generated directory removed successfully: ${absoluteProjectGeneratedDir}`, + ); } // Copy new generated directory @@ -235,23 +252,33 @@ const runExecutor: PromiseExecutor = async ( recursive: true, }); + logger.debug('Formatting generated directory...'); + await formatFiles(absoluteProjectGeneratedDir); + logger.info('Successfully updated API client and spec files.'); + await cleanup(absoluteTempFolder); return { success: true }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); - logger.debug(`Error details: ${errorMessage}.`); - return { success: false }; - } finally { + logger.error(`Error details: ${errorMessage}.`); await cleanup(absoluteTempFolder); + return { error: errorMessage, success: false }; } }; -async function cleanup(tempFolder: string) { - const absoluteTempFolder = join(process.cwd(), tempFolder); +async function cleanup(absoluteTempFolder: string) { + logger.debug('Cleaning up executor environment...'); if (existsSync(absoluteTempFolder)) { + logger.debug(`Removing temp folder: ${absoluteTempFolder}`); await rm(absoluteTempFolder, { force: true, recursive: true }); + logger.debug(`Temp folder removed successfully: ${absoluteTempFolder}`); + } else { + logger.debug( + `Temp folder does not exist: ${absoluteTempFolder}. Skipping cleanup.`, + ); } + logger.debug('Executor cleaned up successfully.'); } export default runExecutor; diff --git a/packages/nx-plugin/src/generators/openapi-client/README.md b/packages/nx-plugin/src/generators/openapi-client/README.md index 7599b6abe..81a276774 100644 --- a/packages/nx-plugin/src/generators/openapi-client/README.md +++ b/packages/nx-plugin/src/generators/openapi-client/README.md @@ -94,4 +94,4 @@ The generator adds the following dependencies to the created project: - [x] Support additional client types - [x] Dogfood the spec bundling and dereferencing - [ ] Support different test frameworks -- [ ] Add linting generation for +- [ ] Add linting generation diff --git a/packages/nx-plugin/src/generators/openapi-client/files/openapi-ts.config.ts.template b/packages/nx-plugin/src/generators/openapi-client/files/openapi-ts.config.ts.template index 2e0659877..fe4096db9 100644 --- a/packages/nx-plugin/src/generators/openapi-client/files/openapi-ts.config.ts.template +++ b/packages/nx-plugin/src/generators/openapi-client/files/openapi-ts.config.ts.template @@ -6,7 +6,7 @@ export default defineConfig({ plugins: [ '<%= clientType %>', <% for(let x = 0; x < plugins.length; x++) { %> - '<%= plugins[x] %>' + '<%= plugins[x] %>', <% } %> ], }); diff --git a/packages/nx-plugin/src/generators/openapi-client/files/src/index.ts.template b/packages/nx-plugin/src/generators/openapi-client/files/src/index.ts.template index 69e4e4eb8..23accb83f 100644 --- a/packages/nx-plugin/src/generators/openapi-client/files/src/index.ts.template +++ b/packages/nx-plugin/src/generators/openapi-client/files/src/index.ts.template @@ -1 +1,2 @@ export * from './generated'; +export * from './generated/client.gen'; diff --git a/packages/nx-plugin/src/generators/openapi-client/openapiClient.schema.json b/packages/nx-plugin/src/generators/openapi-client/openapiClient.schema.json index ee54a6dab..aca6670df 100644 --- a/packages/nx-plugin/src/generators/openapi-client/openapiClient.schema.json +++ b/packages/nx-plugin/src/generators/openapi-client/openapiClient.schema.json @@ -61,6 +61,11 @@ "type": "boolean", "description": "Whether to make the generated package private, put false if you want to publish the package.", "default": true + }, + "asClass": { + "type": "boolean", + "description": "** not working ** Whether to use the class style for the generated code, defaults to `false`", + "default": false } }, "required": ["name", "spec", "scope"] diff --git a/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts b/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts index 4b4caa5f5..303c39415 100644 --- a/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts +++ b/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts @@ -1,5 +1,5 @@ import { randomUUID } from 'node:crypto'; -import { existsSync, mkdirSync, rmSync } from 'node:fs'; +import { existsSync, rmSync } from 'node:fs'; import { join } from 'node:path'; import type { initConfigs } from '@hey-api/openapi-ts/internal'; @@ -7,7 +7,7 @@ import { readJson } from '@nx/devkit'; import { afterAll, beforeEach, describe, expect, it, vi } from 'vitest'; import { getGeneratorOptions } from '../../test-utils'; -import { generateClientCode } from '../../utils'; +import { generateClientCode, makeDir } from '../../utils'; import generator, { updateTsConfig } from './openapiClient'; import { generateApi, @@ -78,7 +78,7 @@ describe('openapi-client generator', () => { expect(normalized).toEqual({ clientType: '@hey-api/client-fetch', isPrivate: true, - plugins: [], + plugins: ['@hey-api/typescript', '@hey-api/sdk'], projectDirectory: `${tempDirectory}/test-api-${uuid}`, projectName: 'test-api', projectRoot: `${tempDirectory}/test-api-${uuid}/test-api`, @@ -107,7 +107,7 @@ describe('openapi-client generator', () => { expect(normalized).toEqual({ clientType: '@hey-api/client-fetch', isPrivate: true, - plugins: [], + plugins: ['@hey-api/typescript', '@hey-api/sdk'], projectDirectory: 'custom-dir', projectName: 'test-api', projectRoot: 'custom-dir/test-api', @@ -330,7 +330,7 @@ describe('openapi-client generator', () => { // Create necessary directories const fullProjectRoot = join(process.cwd(), projectRoot); if (!existsSync(fullProjectRoot)) { - mkdirSync(fullProjectRoot, { recursive: true }); + await makeDir(fullProjectRoot); } await expect( diff --git a/packages/nx-plugin/src/generators/openapi-client/openapiClient.ts b/packages/nx-plugin/src/generators/openapi-client/openapiClient.ts index 2aab962ef..8dc787a64 100644 --- a/packages/nx-plugin/src/generators/openapi-client/openapiClient.ts +++ b/packages/nx-plugin/src/generators/openapi-client/openapiClient.ts @@ -1,7 +1,8 @@ -import { existsSync, mkdirSync, writeFileSync } from 'node:fs'; -import { mkdir, rm } from 'node:fs/promises'; +import { existsSync, writeFileSync } from 'node:fs'; +import { rm } from 'node:fs/promises'; import { isAbsolute, join, resolve } from 'node:path'; +import { defaultPlugins } from '@hey-api/openapi-ts'; import type { ProjectConfiguration, Tree } from '@nx/devkit'; import { addDependenciesToPackageJson, @@ -22,14 +23,17 @@ import { import packageJson from '../../../package.json'; import type { UpdateApiExecutorSchema } from '../../executors/update-api/schema'; +import type { Plugin } from '../../utils'; import { bundleAndDereferenceSpecFile, generateClientCode, generateClientCommand, getPackageName, + getPluginName, getVersionOfPackage, isAFile, isUrl, + makeDir, } from '../../utils'; import { CONSTANTS } from '../../vars'; @@ -59,7 +63,7 @@ const getClientPlugins = ({ projectRoot, projectScope, }: NormalizedOptions & { - inputPlugins: string[]; + inputPlugins: Plugin[]; }): Record => { const plugins: Record = { '@tanstack/react-query': { @@ -73,7 +77,7 @@ const getClientPlugins = ({ // Filter the plugins that are in the inputPlugins array const filteredPlugins = Object.keys(plugins) - .filter((plugin) => inputPlugins.includes(plugin)) + .filter((plugin) => inputPlugins.map(getPluginName).includes(plugin)) .reduce( (acc, plugin) => { const keyedPlugin = plugin as keyof typeof plugins; @@ -120,6 +124,10 @@ const testRunners: Record< }; export interface OpenApiClientGeneratorSchema { + /** + * Whether to use the class style for the generated code, defaults to `false` + */ + asClass?: boolean; /** * The client to use for the OpenAPI client */ @@ -199,7 +207,7 @@ export default async function ( // Create the temp folder if (!existsSync(tempFolder)) { logger.debug(`Creating temp folder: ${tempFolder}`); - await mkdir(tempFolder); + await makeDir(tempFolder); } else { logger.debug(`Temp folder already exists: ${tempFolder}`); } @@ -225,7 +233,7 @@ export default async function ( // Update the package.json file logger.info(`Updating package.json with dependencies`); - const installDeps = await updatePackageJson({ + await updatePackageJson({ clientType, isPrivate, plugins, @@ -262,12 +270,9 @@ export default async function ( // Return a function that installs the packages return async () => { logger.info(`Installing dependencies for ${projectName}`); - await installDeps(); const packageManager = detectPackageManager(workspaceRoot); - const installDirectory = isWorkspacesEnabled(packageManager) - ? workspaceRoot - : projectRoot; - installPackagesTask(tree, true, installDirectory, packageManager); + + installPackagesTask(tree, true, workspaceRoot, packageManager); logger.info(`Dependencies installed successfully`); }; } catch (error) { @@ -283,7 +288,7 @@ export default async function ( export interface NormalizedOptions { clientType: string; isPrivate: boolean; - plugins: string[]; + plugins: Plugin[]; projectDirectory: string; projectName: string; projectRoot: string; @@ -325,12 +330,28 @@ export function normalizeOptions( ).map((s) => s.trim()), ), ); - const tempFolder = options.tempFolderDir ?? defaultTempFolder; + // use the provided temp folder or use the default temp folder and append the project name to it + // we append the project name to the temp folder to avoid conflicts between different projects using the same temp folder + const tempFolder = + options.tempFolderDir ?? join(defaultTempFolder, projectName); + const [default1, default2, ...rest] = defaultPlugins; + logger.debug('As Class', options.asClass); + const plugins = [ + default1, + options.asClass + ? { + asClass: true, + name: default2, + } + : default2, + ...rest, + ...options.plugins, + ]; return { clientType: options.client, isPrivate: options.private ?? true, - plugins: options.plugins, + plugins, projectDirectory, projectName, projectRoot, @@ -408,7 +429,7 @@ export async function generateNxProject({ const additionalEntryPoints: string[] = []; for (const plugin of plugins) { - const clientPlugin = clientPlugins[plugin]; + const clientPlugin = clientPlugins[getPluginName(plugin)]; if (clientPlugin) { additionalEntryPoints.push(...(clientPlugin.additionalEntryPoints ?? [])); } @@ -518,6 +539,7 @@ export async function generateNxProject({ const generatedOptions: GeneratedOptions = { ...normalizedOptions, ...CONSTANTS, + plugins: plugins.map(getPluginName), }; // Create directory structure @@ -525,11 +547,11 @@ export async function generateNxProject({ generateFiles(tree, templatePath, projectRoot, generatedOptions); for (const plugin of plugins) { - const pluginConfig = clientPlugins[plugin]; - if (pluginConfig) { + const pluginConfiguration = clientPlugins[getPluginName(plugin)]; + if (pluginConfiguration) { handlePlugin({ generatedOptions, - plugin: pluginConfig, + pluginConfiguration, projectRoot, tree, }); @@ -552,17 +574,20 @@ export async function generateNxProject({ function handlePlugin({ generatedOptions, - plugin, + pluginConfiguration, projectRoot, tree, }: { generatedOptions: GeneratedOptions; - plugin: ClientPluginOptions; + pluginConfiguration: ClientPluginOptions; projectRoot: string; tree: Tree; }) { - if (plugin.templateFilesPath) { - const pluginTemplatePath = join(__dirname, plugin.templateFilesPath); + if (pluginConfiguration.templateFilesPath) { + const pluginTemplatePath = join( + __dirname, + pluginConfiguration.templateFilesPath, + ); generateFiles(tree, pluginTemplatePath, projectRoot, generatedOptions); } } @@ -619,7 +644,7 @@ export async function generateTestFiles({ } /** - * Generates the api client code using the spec file + * Gathers the OpenAPI spec file from the project and writes it to the temp folder */ export async function generateApi({ client, @@ -630,7 +655,7 @@ export async function generateApi({ tree, }: { client: string; - plugins: string[]; + plugins: Plugin[]; projectRoot: string; specFile: string; tempFolder: string; @@ -680,7 +705,7 @@ export async function generateApi({ // Read the bundled file back into the tree try { // write to temp spec destination - mkdirSync(absoluteSpecDestination, { recursive: true }); + await makeDir(absoluteSpecDestination); writeFileSync(absoluteTempSpecDestination, dereferencedSpecString); logger.debug( `Dereferenced spec written to temp file: ${absoluteTempSpecDestination}`, @@ -717,6 +742,7 @@ async function getPackageDetails(name: string) { packageVersion, }; } + /** * Updates the package.json file to add dependencies and scripts */ @@ -732,7 +758,7 @@ export async function updatePackageJson({ * Whether to make the generated package private */ isPrivate: boolean; - plugins: string[]; + plugins: Plugin[]; projectRoot: string; tree: Tree; }) { @@ -743,7 +769,15 @@ export async function updatePackageJson({ // add the openapi-ts as a dependency const openApiTsDetails = getPackageDetails('@hey-api/openapi-ts'); // add the plugins as dependencies - const pluginDetails = plugins.map(getPackageDetails); + const pluginDetails = plugins + // filter out the default plugins as they are not packages + .filter( + (plugin) => + !(defaultPlugins as unknown as string[]).includes( + getPluginName(plugin), + ), + ) + .map((plugin) => getPackageDetails(getPluginName(plugin))); const results = await Promise.all([ clientDetails, @@ -765,13 +799,29 @@ export async function updatePackageJson({ deps['axios'] = `^${axiosVersion}`; } - const installDeps = addDependenciesToPackageJson( + addDependenciesToPackageJson( tree, deps, {}, join(projectRoot, 'package.json'), ); + if (!isWorkspacesEnabled(detectPackageManager(workspaceRoot))) { + if (tree.exists(join(workspaceRoot, 'package.json'))) { + // if workspaces are not enabled then we need to install the dependencies to the root + addDependenciesToPackageJson( + tree, + deps, + {}, + join(workspaceRoot, 'package.json'), + ); + } else { + logger.warn( + 'Could not add dependencies to root package.json. Packages may needed to be added manually.', + ); + } + } + // update the private and publishConfig field in the package.json file updateJson(tree, join(projectRoot, 'package.json'), (json) => { if (isPrivate) { @@ -783,8 +833,6 @@ export async function updatePackageJson({ } return json; }); - - return installDeps; } export function updateTsConfig({ diff --git a/packages/nx-plugin/src/test-utils.ts b/packages/nx-plugin/src/test-utils.ts index 0a1cb487d..ba5606682 100644 --- a/packages/nx-plugin/src/test-utils.ts +++ b/packages/nx-plugin/src/test-utils.ts @@ -1,11 +1,12 @@ import { existsSync } from 'node:fs'; -import { mkdir, writeFile } from 'node:fs/promises'; +import { writeFile } from 'node:fs/promises'; import { join } from 'node:path'; import { logger, type Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import type { OpenApiClientGeneratorSchema } from './generators/openapi-client/openapiClient'; +import { makeDir } from './utils'; export const TestOptions = { client: '@hey-api/client-fetch', @@ -49,7 +50,7 @@ paths: const tempDir = `${tempDirectory}/${name}`; const apiDir = `${tempDir}/api`; if (!existsSync(apiDir)) { - await mkdir(join(process.cwd(), apiDir), { recursive: true }); + await makeDir(join(process.cwd(), apiDir)); } // Write the spec file diff --git a/packages/nx-plugin/src/utils.spec.ts b/packages/nx-plugin/src/utils.spec.ts index 605fdeb23..d0487e7ab 100644 --- a/packages/nx-plugin/src/utils.spec.ts +++ b/packages/nx-plugin/src/utils.spec.ts @@ -66,12 +66,12 @@ describe('utils', () => { const command = generateClientCommand({ clientType: '@hey-api/client-fetch', outputPath: './src/generated', - plugins: [], + plugins: ['@hey-api/typescript', '@hey-api/sdk'], specFile: './api/spec.yaml', }); expect(command).toBe( - 'npx @hey-api/openapi-ts -i ./api/spec.yaml -o ./src/generated -c @hey-api/client-fetch', + 'npx @hey-api/openapi-ts -i ./api/spec.yaml -o ./src/generated -c @hey-api/client-fetch -p @hey-api/typescript,@hey-api/sdk', ); }); @@ -133,7 +133,7 @@ describe('utils', () => { generateClientCode({ clientType: '@hey-api/client-fetch', outputPath: './src/generated', - plugins: [], + plugins: ['@hey-api/typescript', '@hey-api/sdk'], specFile: './api/spec.yaml', }), ).resolves.not.toThrow(); @@ -141,7 +141,11 @@ describe('utils', () => { expect(createClient).toHaveBeenCalledWith({ input: './api/spec.yaml', output: './src/generated', - plugins: ['@hey-api/client-fetch'], + plugins: [ + '@hey-api/client-fetch', + '@hey-api/typescript', + '@hey-api/sdk', + ], }); }); @@ -154,7 +158,7 @@ describe('utils', () => { generateClientCode({ clientType: '@hey-api/client-fetch', outputPath: './src/generated', - plugins: [], + plugins: ['@hey-api/typescript', '@hey-api/sdk'], specFile: './api/spec.yaml', }), ).rejects.toThrow('Command failed'); diff --git a/packages/nx-plugin/src/utils.ts b/packages/nx-plugin/src/utils.ts index 0fb8b6f5b..141ab6f28 100644 --- a/packages/nx-plugin/src/utils.ts +++ b/packages/nx-plugin/src/utils.ts @@ -1,4 +1,6 @@ import { existsSync, lstatSync } from 'node:fs'; +import { mkdir, readdir, readFile, writeFile } from 'node:fs/promises'; +import { join } from 'node:path'; import type { JSONSchema } from '@hey-api/json-schema-ref-parser'; import { createClient } from '@hey-api/openapi-ts'; @@ -9,6 +11,9 @@ import { } from '@hey-api/openapi-ts/internal'; import { logger } from '@nx/devkit'; import OpenApiDiff from 'openapi-diff'; +import { format } from 'prettier'; + +export type Plugin = string | { asClass: boolean; name: string }; export function generateClientCommand({ clientType, @@ -18,10 +23,10 @@ export function generateClientCommand({ }: { clientType: string; outputPath: string; - plugins: string[]; + plugins: Plugin[]; specFile: string; }) { - return `npx @hey-api/openapi-ts -i ${specFile} -o ${outputPath} -c ${clientType}${plugins.length > 0 ? ` -p ${plugins.join(',')}` : ''}`; + return `npx @hey-api/openapi-ts -i ${specFile} -o ${outputPath} -c ${clientType}${plugins.length > 0 ? ` -p ${plugins.map(getPluginName).join(',')}` : ''}`; } /** @@ -59,15 +64,17 @@ export async function generateClientCode({ }: { clientType: string; outputPath: string; - plugins: string[]; + plugins: Plugin[]; specFile: string; }) { try { + const pluginNames = plugins.map(getPluginName); logger.info(`Generating client code using spec file...`); + await createClient({ input: specFile, output: outputPath, - plugins: [clientType, ...plugins] as ClientConfig['plugins'], + plugins: [clientType, ...pluginNames] as ClientConfig['plugins'], }); logger.info(`Generated client code successfully.`); } catch (error) { @@ -76,6 +83,13 @@ export async function generateClientCode({ } } +export function getPluginName(plugin: Plugin) { + if (typeof plugin === 'string') { + return plugin; + } + return plugin.name; +} + /** * Bundle and dereference the new spec file */ @@ -87,7 +101,7 @@ export async function bundleAndDereferenceSpecFile({ }: { client: string; outputPath: string; - plugins: string[]; + plugins: Plugin[]; specPath: string; }) { try { @@ -210,7 +224,10 @@ function validateSpecVersions( export async function getSpecFiles( existingSpecPath: string, newSpecPath: string, -) { +): Promise<{ + existingSpec: JSONSchema; + newSpec: JSONSchema; +}> { logger.debug('Loading spec files...'); const parsedExistingSpecTask = getSpecFile(existingSpecPath); const parsedNewSpecTask = getSpecFile(newSpecPath); @@ -302,3 +319,27 @@ export function isAFile(isFileSystemFile: string) { } return existsSync(isFileSystemFile) && lstatSync(isFileSystemFile).isFile(); } + +/** + * Creates a directory if it does not exist + */ +export async function makeDir(path: string) { + await mkdir(path, { recursive: true }); +} + +export async function formatFiles(dir: string) { + const files = await readdir(dir, { withFileTypes: true }); + const tasks = files.map(async (file) => { + const filePath = join(dir, file.name); + if (file.isDirectory()) { + await formatFiles(filePath); + } else if (file.name.endsWith('.ts')) { + const content = await readFile(filePath, 'utf-8'); + const formatted = await format(content, { + parser: 'typescript', + }); + await writeFile(filePath, formatted); + } + }); + await Promise.all(tasks); +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 096acbf2d..af7b799a6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -880,7 +880,7 @@ importers: version: 3.3.2 nuxt: specifier: 3.14.1592 - version: 3.14.1592(@parcel/watcher@2.5.1)(@types/node@22.10.5)(db0@0.3.2)(encoding@0.1.13)(eslint@9.17.0(jiti@2.4.2))(ioredis@5.6.1)(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.40.2)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)) + version: 3.14.1592(@parcel/watcher@2.5.1)(@types/node@22.10.5)(db0@0.3.2)(encoding@0.1.13)(eslint@9.17.0(jiti@2.4.2))(ioredis@5.6.1)(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.40.2)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) prettier: specifier: 3.4.2 version: 3.4.2 @@ -15419,16 +15419,6 @@ snapshots: '@nuxt/devalue@2.0.2': {} - '@nuxt/devtools-kit@1.7.0(magicast@0.3.5)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1))': - dependencies: - '@nuxt/kit': 3.15.4(magicast@0.3.5) - '@nuxt/schema': 3.16.2 - execa: 7.2.0 - vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1) - transitivePeerDependencies: - - magicast - - supports-color - '@nuxt/devtools-kit@1.7.0(magicast@0.3.5)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))': dependencies: '@nuxt/kit': 3.15.4(magicast@0.3.5) @@ -15499,53 +15489,6 @@ snapshots: - utf-8-validate - vue - '@nuxt/devtools@1.7.0(rollup@4.40.2)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1))(vue@3.5.13(typescript@5.8.3))': - dependencies: - '@antfu/utils': 0.7.10 - '@nuxt/devtools-kit': 1.7.0(magicast@0.3.5)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)) - '@nuxt/devtools-wizard': 1.7.0 - '@nuxt/kit': 3.15.4(magicast@0.3.5) - '@vue/devtools-core': 7.6.8(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1))(vue@3.5.13(typescript@5.8.3)) - '@vue/devtools-kit': 7.6.8 - birpc: 0.2.19 - consola: 3.4.2 - cronstrue: 2.61.0 - destr: 2.0.5 - error-stack-parser-es: 0.1.5 - execa: 7.2.0 - fast-npm-meta: 0.2.2 - flatted: 3.3.3 - get-port-please: 3.1.2 - hookable: 5.5.3 - image-meta: 0.2.1 - is-installed-globally: 1.0.0 - launch-editor: 2.10.0 - local-pkg: 0.5.1 - magicast: 0.3.5 - nypm: 0.4.1 - ohash: 1.1.6 - pathe: 1.1.2 - perfect-debounce: 1.0.0 - pkg-types: 1.3.1 - rc9: 2.1.2 - scule: 1.3.0 - semver: 7.7.2 - simple-git: 3.27.0 - sirv: 3.0.1 - tinyglobby: 0.2.13 - unimport: 3.14.6(rollup@4.40.2) - vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1) - vite-plugin-inspect: 0.8.9(@nuxt/kit@3.15.4(magicast@0.3.5))(rollup@4.40.2)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)) - vite-plugin-vue-inspector: 5.3.1(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)) - which: 3.0.1 - ws: 8.18.2 - transitivePeerDependencies: - - bufferutil - - rollup - - supports-color - - utf-8-validate - - vue - '@nuxt/devtools@1.7.0(rollup@4.40.2)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3))': dependencies: '@antfu/utils': 0.7.10 @@ -17987,18 +17930,6 @@ snapshots: dependencies: '@vue/devtools-kit': 7.7.6 - '@vue/devtools-core@7.6.8(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1))(vue@3.5.13(typescript@5.8.3))': - dependencies: - '@vue/devtools-kit': 7.7.6 - '@vue/devtools-shared': 7.7.6 - mitt: 3.0.1 - nanoid: 5.1.5 - pathe: 1.1.2 - vite-hot-client: 0.2.4(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)) - vue: 3.5.13(typescript@5.8.3) - transitivePeerDependencies: - - vite - '@vue/devtools-core@7.6.8(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(vue@3.5.13(typescript@5.8.3))': dependencies: '@vue/devtools-kit': 7.7.6 @@ -22854,126 +22785,6 @@ snapshots: - vue-tsc - xml2js - nuxt@3.14.1592(@parcel/watcher@2.5.1)(@types/node@22.10.5)(db0@0.3.2)(encoding@0.1.13)(eslint@9.17.0(jiti@2.4.2))(ioredis@5.6.1)(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.40.2)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)): - dependencies: - '@nuxt/devalue': 2.0.2 - '@nuxt/devtools': 1.7.0(rollup@4.40.2)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1))(vue@3.5.13(typescript@5.8.3)) - '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.40.2) - '@nuxt/schema': 3.14.1592(magicast@0.3.5)(rollup@4.40.2) - '@nuxt/telemetry': 2.6.6(magicast@0.3.5) - '@nuxt/vite-builder': 3.14.1592(@types/node@22.10.5)(eslint@9.17.0(jiti@2.4.2))(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.40.2)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vue@3.5.13(typescript@5.8.3)) - '@unhead/dom': 1.11.20 - '@unhead/shared': 1.11.20 - '@unhead/ssr': 1.11.20 - '@unhead/vue': 1.11.20(vue@3.5.13(typescript@5.8.3)) - '@vue/shared': 3.5.13 - acorn: 8.14.0 - c12: 2.0.1(magicast@0.3.5) - chokidar: 4.0.3 - compatx: 0.1.8 - consola: 3.4.2 - cookie-es: 1.2.2 - defu: 6.1.4 - destr: 2.0.5 - devalue: 5.1.1 - errx: 0.1.0 - esbuild: 0.24.2 - escape-string-regexp: 5.0.0 - estree-walker: 3.0.3 - globby: 14.1.0 - h3: 1.15.3 - hookable: 5.5.3 - ignore: 6.0.2 - impound: 0.2.2(rollup@4.40.2) - jiti: 2.4.2 - klona: 2.0.6 - knitwork: 1.2.0 - magic-string: 0.30.17 - mlly: 1.7.4 - nanotar: 0.1.1 - nitropack: 2.11.12(encoding@0.1.13) - nuxi: 3.25.1 - nypm: 0.3.12 - ofetch: 1.4.1 - ohash: 1.1.6 - pathe: 1.1.2 - perfect-debounce: 1.0.0 - pkg-types: 1.3.1 - radix3: 1.1.2 - scule: 1.3.0 - semver: 7.7.2 - std-env: 3.9.0 - strip-literal: 2.1.1 - tinyglobby: 0.2.10 - ufo: 1.6.1 - ultrahtml: 1.6.0 - uncrypto: 0.1.3 - unctx: 2.4.1 - unenv: 1.10.0 - unhead: 1.11.20 - unimport: 3.14.6(rollup@4.40.2) - unplugin: 1.16.1 - unplugin-vue-router: 0.10.9(rollup@4.40.2)(vue-router@4.5.0(vue@3.5.13(typescript@5.8.3)))(vue@3.5.13(typescript@5.8.3)) - unstorage: 1.16.0(db0@0.3.2)(ioredis@5.6.1) - untyped: 1.5.2 - vue: 3.5.13(typescript@5.8.3) - vue-bundle-renderer: 2.1.1 - vue-devtools-stub: 0.1.0 - vue-router: 4.5.0(vue@3.5.13(typescript@5.8.3)) - optionalDependencies: - '@parcel/watcher': 2.5.1 - '@types/node': 22.10.5 - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@biomejs/biome' - - '@capacitor/preferences' - - '@deno/kv' - - '@electric-sql/pglite' - - '@libsql/client' - - '@netlify/blobs' - - '@planetscale/database' - - '@upstash/redis' - - '@vercel/blob' - - '@vercel/kv' - - aws4fetch - - better-sqlite3 - - bufferutil - - db0 - - drizzle-orm - - encoding - - eslint - - idb-keyval - - ioredis - - less - - lightningcss - - magicast - - meow - - mysql2 - - optionator - - rolldown - - rollup - - sass - - sass-embedded - - sqlite3 - - stylelint - - stylus - - sugarss - - supports-color - - terser - - typescript - - uploadthing - - utf-8-validate - - vite - - vls - - vti - - vue-tsc - - xml2js - nuxt@3.14.1592(@parcel/watcher@2.5.1)(@types/node@22.10.5)(db0@0.3.2)(encoding@0.1.13)(eslint@9.17.0(jiti@2.4.2))(ioredis@5.6.1)(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.40.2)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)): dependencies: '@nuxt/devalue': 2.0.2 @@ -26025,10 +25836,6 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.2 - vite-hot-client@0.2.4(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)): - dependencies: - vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1) - vite-hot-client@0.2.4(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)): dependencies: vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) @@ -26116,24 +25923,6 @@ snapshots: - rollup - supports-color - vite-plugin-inspect@0.8.9(@nuxt/kit@3.15.4(magicast@0.3.5))(rollup@4.40.2)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)): - dependencies: - '@antfu/utils': 0.7.10 - '@rollup/pluginutils': 5.1.4(rollup@4.40.2) - debug: 4.4.1 - error-stack-parser-es: 0.1.5 - fs-extra: 11.3.0 - open: 10.1.2 - perfect-debounce: 1.0.0 - picocolors: 1.1.1 - sirv: 3.0.1 - vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1) - optionalDependencies: - '@nuxt/kit': 3.15.4(magicast@0.3.5) - transitivePeerDependencies: - - rollup - - supports-color - vite-plugin-inspect@0.8.9(@nuxt/kit@3.15.4(magicast@0.3.5))(rollup@4.40.2)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)): dependencies: '@antfu/utils': 0.7.10 @@ -26168,21 +25957,6 @@ snapshots: - supports-color - vue - vite-plugin-vue-inspector@5.3.1(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)): - dependencies: - '@babel/core': 7.27.1 - '@babel/plugin-proposal-decorators': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-syntax-import-attributes': 7.27.1(@babel/core@7.27.1) - '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.27.1) - '@babel/plugin-transform-typescript': 7.27.1(@babel/core@7.27.1) - '@vue/babel-plugin-jsx': 1.4.0(@babel/core@7.27.1) - '@vue/compiler-dom': 3.5.13 - kolorist: 1.8.0 - magic-string: 0.30.17 - vite: 5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1) - transitivePeerDependencies: - - supports-color - vite-plugin-vue-inspector@5.3.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)): dependencies: '@babel/core': 7.27.1 From c8c2236443d83d0a9c36a5f14665ae21499f978c Mon Sep 17 00:00:00 2001 From: Landon Date: Sat, 26 Apr 2025 23:05:22 -0400 Subject: [PATCH 14/26] feat(nx-plugin): enhance OpenAPI spec comparison functionality - Replace the existing openapi-diff dependency with api-smart-diff for improved comparison accuracy. - Add comprehensive test cases to validate spec comparison logic across various scenarios. --- package.json | 1 + packages/nx-plugin/package.json | 6 +- packages/nx-plugin/src/test-specs/base.json | 81 +++++ packages/nx-plugin/src/test-specs/base.yaml | 48 +++ .../src/test-specs/endpoint-changed.json | 106 +++++++ .../src/test-specs/endpoint-changed.yaml | 63 ++++ .../src/test-specs/example-changed.json | 81 +++++ .../src/test-specs/example-changed.yaml | 48 +++ .../src/test-specs/parameter-changed.json | 91 ++++++ .../src/test-specs/parameter-changed.yaml | 55 ++++ .../src/test-specs/path-changed.json | 81 +++++ .../src/test-specs/path-changed.yaml | 48 +++ .../src/test-specs/summary-changed.json | 81 +++++ .../src/test-specs/summary-changed.yaml | 48 +++ .../nx-plugin/src/utils.compare-spec.spec.ts | 106 +++++++ packages/nx-plugin/src/utils.ts | 86 +----- pnpm-lock.yaml | 282 ++++-------------- 17 files changed, 1012 insertions(+), 300 deletions(-) create mode 100644 packages/nx-plugin/src/test-specs/base.json create mode 100644 packages/nx-plugin/src/test-specs/base.yaml create mode 100644 packages/nx-plugin/src/test-specs/endpoint-changed.json create mode 100644 packages/nx-plugin/src/test-specs/endpoint-changed.yaml create mode 100644 packages/nx-plugin/src/test-specs/example-changed.json create mode 100644 packages/nx-plugin/src/test-specs/example-changed.yaml create mode 100644 packages/nx-plugin/src/test-specs/parameter-changed.json create mode 100644 packages/nx-plugin/src/test-specs/parameter-changed.yaml create mode 100644 packages/nx-plugin/src/test-specs/path-changed.json create mode 100644 packages/nx-plugin/src/test-specs/path-changed.yaml create mode 100644 packages/nx-plugin/src/test-specs/summary-changed.json create mode 100644 packages/nx-plugin/src/test-specs/summary-changed.yaml create mode 100644 packages/nx-plugin/src/utils.compare-spec.spec.ts diff --git a/package.json b/package.json index 544adada4..a031f0443 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "turbo": "2.5.5", "typescript": "5.8.3", "typescript-eslint": "8.29.1", + "vite-tsconfig-paths": "5.1.4", "vitest": "3.1.1" }, "packageManager": "pnpm@9.15.1+sha512.1acb565e6193efbebda772702950469150cf12bcc764262e7587e71d19dc98a423dff9536e57ea44c49bdf790ff694e83c27be5faa23d67e0c033b583be4bfcf" diff --git a/packages/nx-plugin/package.json b/packages/nx-plugin/package.json index 256cf31b6..d42b9792a 100644 --- a/packages/nx-plugin/package.json +++ b/packages/nx-plugin/package.json @@ -48,11 +48,11 @@ "executors": "./executors.json", "generators": "./generators.json", "dependencies": { - "@hey-api/json-schema-ref-parser": "1.0.4", + "@hey-api/json-schema-ref-parser": "1.0.5", "@hey-api/openapi-ts": "workspace:*", - "@nx/devkit": "20.7.2", + "@nx/devkit": "20.8.1", "latest-version": "9.0.0", - "openapi-diff": "0.23.7", + "api-smart-diff": "^1.0.6", "tslib": "2.8.1", "xcurl": "2.1.2" }, diff --git a/packages/nx-plugin/src/test-specs/base.json b/packages/nx-plugin/src/test-specs/base.json new file mode 100644 index 000000000..2427d536d --- /dev/null +++ b/packages/nx-plugin/src/test-specs/base.json @@ -0,0 +1,81 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Test API", + "version": "1.0.0", + "description": "A test API for testing spec comparison" + }, + "servers": [ + { + "url": "https://api.example.com/v1", + "description": "Production server" + } + ], + "security": [ + { + "apiKey": [] + } + ], + "paths": { + "/users": { + "get": { + "summary": "Get all users", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "Number of users to return", + "required": false, + "schema": { + "type": "integer", + "default": 10 + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + }, + "example": [ + { + "id": 1, + "name": "John Doe" + } + ] + } + } + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + }, + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "name": "X-API-Key", + "in": "header" + } + } + } +} diff --git a/packages/nx-plugin/src/test-specs/base.yaml b/packages/nx-plugin/src/test-specs/base.yaml new file mode 100644 index 000000000..d81f0a20f --- /dev/null +++ b/packages/nx-plugin/src/test-specs/base.yaml @@ -0,0 +1,48 @@ +openapi: 3.0.0 +info: + title: Test API + version: 1.0.0 + description: A test API for testing spec comparison +servers: + - url: https://api.example.com/v1 + description: Production server +security: + - apiKey: [] +paths: + /users: + get: + summary: Get all users + parameters: + - name: limit + in: query + description: Number of users to return + required: false + schema: + type: integer + default: 10 + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + example: + - id: 1 + name: John Doe +components: + schemas: + User: + type: object + properties: + id: + type: integer + name: + type: string + securitySchemes: + apiKey: + type: apiKey + name: X-API-Key + in: header diff --git a/packages/nx-plugin/src/test-specs/endpoint-changed.json b/packages/nx-plugin/src/test-specs/endpoint-changed.json new file mode 100644 index 000000000..1a5a35cff --- /dev/null +++ b/packages/nx-plugin/src/test-specs/endpoint-changed.json @@ -0,0 +1,106 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Test API", + "version": "1.0.0", + "description": "A test API for testing spec comparison" + }, + "servers": [ + { + "url": "https://api.example.com/v1", + "description": "Production server" + } + ], + "security": [ + { + "apiKey": [] + } + ], + "paths": { + "/users": { + "get": { + "summary": "Get all users", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "Number of users to return", + "required": false, + "schema": { + "type": "integer", + "default": 10 + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + }, + "example": [ + { + "id": 1, + "name": "John Doe" + } + ] + } + } + } + } + }, + "post": { + "summary": "Create a new user", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "responses": { + "201": { + "description": "User created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + }, + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "name": "X-API-Key", + "in": "header" + } + } + } +} diff --git a/packages/nx-plugin/src/test-specs/endpoint-changed.yaml b/packages/nx-plugin/src/test-specs/endpoint-changed.yaml new file mode 100644 index 000000000..1bb45d44e --- /dev/null +++ b/packages/nx-plugin/src/test-specs/endpoint-changed.yaml @@ -0,0 +1,63 @@ +openapi: 3.0.0 +info: + title: Test API + version: 1.0.0 + description: A test API for testing spec comparison +servers: + - url: https://api.example.com/v1 + description: Production server +security: + - apiKey: [] +paths: + /users: + get: + summary: Get all users + parameters: + - name: limit + in: query + description: Number of users to return + required: false + schema: + type: integer + default: 10 + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + example: + - id: 1 + name: John Doe + post: + summary: Create a new user + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/User' + responses: + '201': + description: User created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/User' +components: + schemas: + User: + type: object + properties: + id: + type: integer + name: + type: string + securitySchemes: + apiKey: + type: apiKey + name: X-API-Key + in: header diff --git a/packages/nx-plugin/src/test-specs/example-changed.json b/packages/nx-plugin/src/test-specs/example-changed.json new file mode 100644 index 000000000..d89cff7fa --- /dev/null +++ b/packages/nx-plugin/src/test-specs/example-changed.json @@ -0,0 +1,81 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Test API", + "version": "1.0.0", + "description": "A test API for testing spec comparison" + }, + "servers": [ + { + "url": "https://api.example.com/v1", + "description": "Production server" + } + ], + "security": [ + { + "apiKey": [] + } + ], + "paths": { + "/users": { + "get": { + "summary": "Get all users", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "Number of users to return", + "required": false, + "schema": { + "type": "integer", + "default": 10 + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + }, + "example": [ + { + "id": 2, + "name": "Jane Smith" + } + ] + } + } + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + }, + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "name": "X-API-Key", + "in": "header" + } + } + } +} diff --git a/packages/nx-plugin/src/test-specs/example-changed.yaml b/packages/nx-plugin/src/test-specs/example-changed.yaml new file mode 100644 index 000000000..3fbb17f2a --- /dev/null +++ b/packages/nx-plugin/src/test-specs/example-changed.yaml @@ -0,0 +1,48 @@ +openapi: 3.0.0 +info: + title: Test API + version: 1.0.0 + description: A test API for testing spec comparison +servers: + - url: https://api.example.com/v1 + description: Production server +security: + - apiKey: [] +paths: + /users: + get: + summary: Get all users + parameters: + - name: limit + in: query + description: Number of users to return + required: false + schema: + type: integer + default: 10 + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + example: + - id: 2 + name: Jane Smith +components: + schemas: + User: + type: object + properties: + id: + type: integer + name: + type: string + securitySchemes: + apiKey: + type: apiKey + name: X-API-Key + in: header diff --git a/packages/nx-plugin/src/test-specs/parameter-changed.json b/packages/nx-plugin/src/test-specs/parameter-changed.json new file mode 100644 index 000000000..913a435ff --- /dev/null +++ b/packages/nx-plugin/src/test-specs/parameter-changed.json @@ -0,0 +1,91 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Test API", + "version": "1.0.0", + "description": "A test API for testing spec comparison" + }, + "servers": [ + { + "url": "https://api.example.com/v1", + "description": "Production server" + } + ], + "security": [ + { + "apiKey": [] + } + ], + "paths": { + "/users": { + "get": { + "summary": "Get all users", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "Number of users to return", + "required": true, + "schema": { + "type": "integer", + "default": 20 + } + }, + { + "name": "offset", + "in": "query", + "description": "Number of users to skip", + "required": false, + "schema": { + "type": "integer", + "default": 0 + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + }, + "example": [ + { + "id": 1, + "name": "John Doe" + } + ] + } + } + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + }, + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "name": "X-API-Key", + "in": "header" + } + } + } +} diff --git a/packages/nx-plugin/src/test-specs/parameter-changed.yaml b/packages/nx-plugin/src/test-specs/parameter-changed.yaml new file mode 100644 index 000000000..71c2c0163 --- /dev/null +++ b/packages/nx-plugin/src/test-specs/parameter-changed.yaml @@ -0,0 +1,55 @@ +openapi: 3.0.0 +info: + title: Test API + version: 1.0.0 + description: A test API for testing spec comparison +servers: + - url: https://api.example.com/v1 + description: Production server +security: + - apiKey: [] +paths: + /users: + get: + summary: Get all users + parameters: + - name: limit + in: query + description: Number of users to return + required: true + schema: + type: integer + default: 20 + - name: offset + in: query + description: Number of users to skip + required: false + schema: + type: integer + default: 0 + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + example: + - id: 1 + name: John Doe +components: + schemas: + User: + type: object + properties: + id: + type: integer + name: + type: string + securitySchemes: + apiKey: + type: apiKey + name: X-API-Key + in: header diff --git a/packages/nx-plugin/src/test-specs/path-changed.json b/packages/nx-plugin/src/test-specs/path-changed.json new file mode 100644 index 000000000..46052fcc1 --- /dev/null +++ b/packages/nx-plugin/src/test-specs/path-changed.json @@ -0,0 +1,81 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Test API", + "version": "1.0.0", + "description": "A test API for testing spec comparison" + }, + "servers": [ + { + "url": "https://api.example.com/v1", + "description": "Production server" + } + ], + "security": [ + { + "apiKey": [] + } + ], + "paths": { + "/users/v2": { + "get": { + "summary": "Get all users", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "Number of users to return", + "required": false, + "schema": { + "type": "integer", + "default": 10 + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + }, + "example": [ + { + "id": 1, + "name": "John Doe" + } + ] + } + } + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + }, + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "name": "X-API-Key", + "in": "header" + } + } + } +} diff --git a/packages/nx-plugin/src/test-specs/path-changed.yaml b/packages/nx-plugin/src/test-specs/path-changed.yaml new file mode 100644 index 000000000..dd96b3f89 --- /dev/null +++ b/packages/nx-plugin/src/test-specs/path-changed.yaml @@ -0,0 +1,48 @@ +openapi: 3.0.0 +info: + title: Test API + version: 1.0.0 + description: A test API for testing spec comparison +servers: + - url: https://api.example.com/v1 + description: Production server +security: + - apiKey: [] +paths: + /users/v2: + get: + summary: Get all users + parameters: + - name: limit + in: query + description: Number of users to return + required: false + schema: + type: integer + default: 10 + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + example: + - id: 1 + name: John Doe +components: + schemas: + User: + type: object + properties: + id: + type: integer + name: + type: string + securitySchemes: + apiKey: + type: apiKey + name: X-API-Key + in: header diff --git a/packages/nx-plugin/src/test-specs/summary-changed.json b/packages/nx-plugin/src/test-specs/summary-changed.json new file mode 100644 index 000000000..2fdaa08a7 --- /dev/null +++ b/packages/nx-plugin/src/test-specs/summary-changed.json @@ -0,0 +1,81 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Test API", + "version": "1.0.0", + "description": "A test API for testing spec comparison" + }, + "servers": [ + { + "url": "https://api.example.com/v1", + "description": "Production server" + } + ], + "security": [ + { + "apiKey": [] + } + ], + "paths": { + "/users": { + "get": { + "summary": "Get all users with pagination", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "Number of users to return", + "required": false, + "schema": { + "type": "integer", + "default": 10 + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + }, + "example": [ + { + "id": 1, + "name": "John Doe" + } + ] + } + } + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + }, + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "name": "X-API-Key", + "in": "header" + } + } + } +} diff --git a/packages/nx-plugin/src/test-specs/summary-changed.yaml b/packages/nx-plugin/src/test-specs/summary-changed.yaml new file mode 100644 index 000000000..708b71d5c --- /dev/null +++ b/packages/nx-plugin/src/test-specs/summary-changed.yaml @@ -0,0 +1,48 @@ +openapi: 3.0.0 +info: + title: Test API + version: 1.0.0 + description: A test API for testing spec comparison +servers: + - url: https://api.example.com/v1 + description: Production server +security: + - apiKey: [] +paths: + /users: + get: + summary: Get all users with pagination + parameters: + - name: limit + in: query + description: Number of users to return + required: false + schema: + type: integer + default: 10 + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + example: + - id: 1 + name: John Doe +components: + schemas: + User: + type: object + properties: + id: + type: integer + name: + type: string + securitySchemes: + apiKey: + type: apiKey + name: X-API-Key + in: header diff --git a/packages/nx-plugin/src/utils.compare-spec.spec.ts b/packages/nx-plugin/src/utils.compare-spec.spec.ts new file mode 100644 index 000000000..da8702fb2 --- /dev/null +++ b/packages/nx-plugin/src/utils.compare-spec.spec.ts @@ -0,0 +1,106 @@ +import { resolve } from 'path'; +import { describe, expect, it } from 'vitest'; + +import { compareSpecs } from './utils'; + +describe('compareSpecs', () => { + describe('JSON Specs', () => { + it('should detect no changes between identical specs', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base.json'), + resolve(__dirname, './test-specs/base.json'), + ); + expect(areEqual).toBe(true); + }); + + it('should detect path changes', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base.json'), + resolve(__dirname, './test-specs/path-changed.json'), + ); + expect(areEqual).toBe(false); + }); + + it('should detect parameter changes', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base.json'), + resolve(__dirname, './test-specs/parameter-changed.json'), + ); + expect(areEqual).toBe(false); + }); + + it('should detect endpoint changes', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base.json'), + resolve(__dirname, './test-specs/endpoint-changed.json'), + ); + expect(areEqual).toBe(false); + }); + + it('should detect summary changes', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base.json'), + resolve(__dirname, './test-specs/summary-changed.json'), + ); + expect(areEqual).toBe(false); + }); + + it('should ignore example changes', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base.json'), + resolve(__dirname, './test-specs/example-changed.json'), + ); + expect(areEqual).toBe(true); + }); + }); + + describe('YAML Specs', () => { + it('should detect no changes between identical specs', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base.yaml'), + resolve(__dirname, './test-specs/base.yaml'), + ); + expect(areEqual).toBe(true); + }); + + it('should detect path changes', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base.yaml'), + resolve(__dirname, './test-specs/path-changed.yaml'), + ); + expect(areEqual).toBe(false); + }); + + it('should detect parameter changes', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base.yaml'), + resolve(__dirname, './test-specs/parameter-changed.yaml'), + ); + expect(areEqual).toBe(false); + }); + + it('should detect endpoint changes', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base.yaml'), + resolve(__dirname, './test-specs/endpoint-changed.yaml'), + ); + expect(areEqual).toBe(false); + }); + + it('should detect summary changes', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base.yaml'), + resolve(__dirname, './test-specs/summary-changed.yaml'), + ); + expect(areEqual).toBe(false); + }); + + it('should ignore example changes', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base.yaml'), + resolve(__dirname, './test-specs/example-changed.yaml'), + ); + expect(areEqual).toBe(true); + }); + }); +}); diff --git a/packages/nx-plugin/src/utils.ts b/packages/nx-plugin/src/utils.ts index 141ab6f28..13ac091ef 100644 --- a/packages/nx-plugin/src/utils.ts +++ b/packages/nx-plugin/src/utils.ts @@ -10,7 +10,7 @@ import { parseOpenApiSpec, } from '@hey-api/openapi-ts/internal'; import { logger } from '@nx/devkit'; -import OpenApiDiff from 'openapi-diff'; +import { compareOpenApi } from 'api-smart-diff'; import { format } from 'prettier'; export type Plugin = string | { asClass: boolean; name: string }; @@ -170,64 +170,13 @@ async function getSpecFile(path: string) { return spec.data; } -function getSpecVersion(spec: JSONSchema) { - if ('openapi' in spec && typeof spec.openapi === 'string') { - return spec.openapi; - } - - if ('swagger' in spec && typeof spec.swagger === 'string') { - return spec.swagger; - } - return 'unknown'; -} - -function validateSpecVersions( - newSpecVersion: string, - existingSpecVersion: string, -) { - if (!newSpecVersion.startsWith('3') && !newSpecVersion.startsWith('2')) { - throw new Error('New spec is not a valid OpenAPI spec version of 2 or 3.'); - } - - logger.debug('Checking spec versions...'); - logger.debug(`Existing spec version: ${existingSpecVersion}`); - logger.debug(`New spec version: ${newSpecVersion}`); - const existingVersionIs3 = existingSpecVersion.startsWith('3'); - const newSpecVersionIs3 = newSpecVersion.startsWith('3'); - const existingVersionIs2 = existingSpecVersion.startsWith('2'); - const newSpecVersionIs2 = newSpecVersion.startsWith('2'); - - if (!newSpecVersionIs3 && !newSpecVersionIs2) { - throw new Error('New spec is not a valid OpenAPI spec version of 2 or 3.'); - } - - if (!existingVersionIs3 && !existingVersionIs2) { - logger.error( - 'Existing spec is not a valid OpenAPI spec version of 2 or 3.', - ); - throw new Error( - 'Existing spec is not a valid OpenAPI spec version of 2 or 3.', - ); - } - - return { - existingVersionIs2, - existingVersionIs3, - newSpecVersionIs2, - newSpecVersionIs3, - }; -} - /** * Fetches two spec files and returns them */ export async function getSpecFiles( existingSpecPath: string, newSpecPath: string, -): Promise<{ - existingSpec: JSONSchema; - newSpec: JSONSchema; -}> { +) { logger.debug('Loading spec files...'); const parsedExistingSpecTask = getSpecFile(existingSpecPath); const parsedNewSpecTask = getSpecFile(newSpecPath); @@ -269,33 +218,16 @@ export async function compareSpecs( newSpecPath, ); - const existingSpecVersion = getSpecVersion(existingSpec); - const newSpecVersion = getSpecVersion(newSpec); - - const { existingVersionIs3, newSpecVersionIs3 } = validateSpecVersions( - newSpecVersion, - existingSpecVersion, - ); - logger.debug('Comparing specs...'); // Compare specs - const diff = await OpenApiDiff.diffSpecs({ - destinationSpec: { - content: JSON.stringify(newSpec), - format: newSpecVersionIs3 ? 'openapi3' : 'swagger2', - location: newSpecPath, - }, - sourceSpec: { - content: JSON.stringify(existingSpec), - format: existingVersionIs3 ? 'openapi3' : 'swagger2', - location: existingSpecPath, - }, + const { diffs } = compareOpenApi(existingSpec, newSpec); + const filteredDiffs = diffs.filter((diff) => { + if (diff.path.includes('examples') || diff.path.includes('example')) { + return false; + } + return true; }); - const areSpecsEqual = - diff.breakingDifferencesFound === false && - diff.nonBreakingDifferences.length === 0 && - // TODO: figure out if we should check unclassifiedDifferences - diff.unclassifiedDifferences.length === 0; + const areSpecsEqual = filteredDiffs.length === 0; logger.debug(`Are specs equal: ${areSpecsEqual}`); return areSpecsEqual; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index af7b799a6..8b32acc64 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -83,6 +83,9 @@ importers: typescript-eslint: specifier: 8.29.1 version: 8.29.1(eslint@9.17.0(jiti@2.4.2))(typescript@5.8.3) + vite-tsconfig-paths: + specifier: 5.1.4 + version: 5.1.4(typescript@5.8.3)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) vitest: specifier: 3.1.1 version: 3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) @@ -787,20 +790,20 @@ importers: packages/nx-plugin: dependencies: '@hey-api/json-schema-ref-parser': - specifier: 1.0.4 - version: 1.0.4 + specifier: 1.0.5 + version: 1.0.5 '@hey-api/openapi-ts': specifier: workspace:* version: link:../openapi-ts '@nx/devkit': - specifier: 20.7.2 - version: 20.7.2(nx@21.0.3) + specifier: 20.8.1 + version: 20.8.1(nx@21.0.3) + api-smart-diff: + specifier: ^1.0.6 + version: 1.0.6 latest-version: specifier: 9.0.0 version: 9.0.0 - openapi-diff: - specifier: 0.23.7 - version: 0.23.7(openapi-types@12.1.3) tslib: specifier: 2.8.1 version: 2.8.1 @@ -1348,24 +1351,6 @@ packages: '@antfu/utils@0.7.10': resolution: {integrity: sha512-+562v9k4aI80m1+VuMHehNJWLOFjBnXn3tdOitzD0il5b7smkSBal4+a3oKiQTbrwMmN/TBUMDvbdoWDehgOww==} - '@apidevtools/json-schema-ref-parser@9.0.9': - resolution: {integrity: sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w==} - - '@apidevtools/json-schema-ref-parser@9.1.2': - resolution: {integrity: sha512-r1w81DpR+KyRWd3f+rk6TNqMgedmAxZP5v5KWlXQWlgMUUtyEJch0DKEci1SorPMiSeM8XPl7MZ3miJ60JIpQg==} - - '@apidevtools/openapi-schemas@2.1.0': - resolution: {integrity: sha512-Zc1AlqrJlX3SlpupFGpiLi2EbteyP7fXmUOGup6/DnkRgjP9bgMM/ag+n91rsv0U1Gpz0H3VILA/o3bW7Ua6BQ==} - engines: {node: '>=10'} - - '@apidevtools/swagger-methods@3.0.2': - resolution: {integrity: sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg==} - - '@apidevtools/swagger-parser@10.0.3': - resolution: {integrity: sha512-sNiLY51vZOmSPFZA5TF35KZ2HbgYklQnTSDnkghamzLb3EkNtcQnrBQEj5AOCxHpTtXpqMCRM1CrmV2rG6nw4g==} - peerDependencies: - openapi-types: '>=7' - '@arethetypeswrong/cli@0.17.4': resolution: {integrity: sha512-AeiKxtf67XD/NdOqXgBOE5TZWH3EOCt+0GkbUpekOzngc+Q/cRZ5azjWyMxISxxfp0EItgm5NoSld9p7BAA5xQ==} engines: {node: '>=18'} @@ -2867,8 +2852,8 @@ packages: '@fontsource/fira-mono@5.0.0': resolution: {integrity: sha512-IsinH/oLYJyv/sQv7SbKmjoAXZsSjm6Q1Tz5GBBXCXi3Jg9MzXmKvWm9bSLC8lFI6CDsi8GkH/DAgZ98t8bhTQ==} - '@hey-api/json-schema-ref-parser@1.0.4': - resolution: {integrity: sha512-IaJ4yFgU5r63KZyeySHRKSM1bavFIda8KdwCFi5BxQCIklltzEByBksNOPms+yHXpWWfR+OopIusVZV8roycYg==} + '@hey-api/json-schema-ref-parser@1.0.5': + resolution: {integrity: sha512-bWUV9ICwvU5I3YKVZqWIUXFC2SIXznUi/u+LqurJx6ILiyImfZD5+g/lj3w4EiyXxmjqyaxptzUz/1IgK3vVtw==} engines: {node: '>= 16'} '@hey-api/json-schema-ref-parser@1.0.6': @@ -3639,8 +3624,8 @@ packages: peerDependencies: vue: ^3.3.4 - '@nx/devkit@20.7.2': - resolution: {integrity: sha512-6qsQ49T1hWQ8s4JMvGX9k3tpjY4kwr+/2CE1ZCy1txJVFflDatJxdV3fMqUDqo6n81yB6AmVqoSQjQkO6fCRRQ==} + '@nx/devkit@20.8.1': + resolution: {integrity: sha512-N3nwIg/7RIZeB76iuVo29q+l9WyTtvuBSgDFM2msiIK6Q928ilzoeNPZ/p7w/TE3Gqs5XVhq9ExMvDAOTxdmXA==} peerDependencies: nx: '>= 19 <= 21' @@ -5893,6 +5878,9 @@ packages: alien-signals@0.4.14: resolution: {integrity: sha512-itUAVzhczTmP2U5yX67xVpsbbOiquusbWVyA9N+sy6+r6YVbFkahXvNCeEPWEOMhwDYwbVbGHFkVL03N9I5g+Q==} + allof-merge@0.6.6: + resolution: {integrity: sha512-116eZBf2he0/J4Tl7EYMz96I5Anaeio+VL0j/H2yxW9CoYQAMMv8gYcwkVRoO7XfIOv/qzSTfVzDVGAYxKFi3g==} + ansi-colors@4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} @@ -5937,6 +5925,9 @@ packages: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} + api-smart-diff@1.0.6: + resolution: {integrity: sha512-kDkGblcJG9eqy6duqYC/Cr0jN5AC9RrELRSLb3rOKgeni+7wBkCxBVIcNQVtKbYwUQ3K9JOxfPTZaEZDWtyOhg==} + aproba@2.0.0: resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} @@ -6024,10 +6015,6 @@ packages: resolution: {integrity: sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==} engines: {node: '>= 0.4'} - assert-plus@1.0.0: - resolution: {integrity: sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==} - engines: {node: '>=0.8'} - assertion-error@2.0.1: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} @@ -6304,9 +6291,6 @@ packages: resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} engines: {node: '>= 0.4'} - call-me-maybe@1.0.2: - resolution: {integrity: sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==} - callsite@1.0.0: resolution: {integrity: sha512-0vdNRFXn5q+dtOqjfFtmtlI9N2eVZ7LMyEV2iKC5mEEFvSg/69Ml6b/WU2qF8W1nLRa0wiSrDT3Y5jOHZCwKPQ==} @@ -6530,10 +6514,6 @@ packages: resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} engines: {node: '>= 12'} - commander@9.5.0: - resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==} - engines: {node: ^12.20.0 || >=14} - common-path-prefix@3.0.0: resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} @@ -6603,10 +6583,6 @@ packages: convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} - convict@6.2.4: - resolution: {integrity: sha512-qN60BAwdMVdofckX7AlohVJ2x9UvjTNoKVXCL2LxFk1l7757EJqf1nySdMkPQer0bt8kQ5lQiyZ9/2NvrFBuwQ==} - engines: {node: '>=6'} - cookie-es@1.2.2: resolution: {integrity: sha512-+W7VmiVINB+ywl1HGXJXmrqkOhpKrIiVZV6tQuV54ZyQC7MMuBt81Vc336GMLoHBq5hV/F9eXgt5Mnx0Rha5Fg==} @@ -6648,9 +6624,6 @@ packages: core-js-compat@3.42.0: resolution: {integrity: sha512-bQasjMfyDGyaeWKBIu33lHh9qlSR0MFE/Nmc6nMjf/iU9b3rSMdAYz1Baxrv4lPdGUsTqZudHA4jIGSJy0SWZQ==} - core-util-is@1.0.2: - resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==} - core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} @@ -7609,10 +7582,6 @@ packages: engines: {node: '>= 10.17.0'} hasBin: true - extsprintf@1.4.1: - resolution: {integrity: sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA==} - engines: {'0': node >=0.6.0} - fake-indexeddb@6.0.1: resolution: {integrity: sha512-He2AjQGHe46svIFq5+L2Nx/eHDTI1oKgoevBP+TthnjymXiKkeJQ3+ITeWey99Y5+2OaPFbI1qEsx/5RsGtWnQ==} engines: {node: '>=18'} @@ -8003,6 +7972,9 @@ packages: resolution: {integrity: sha512-0Ia46fDOaT7k4og1PDW4YbodWWr3scS2vAr2lTbsplOt2WkKp0vQbkI9wKis/T5LV/dqPjO3bpS/z6GTJB82LA==} engines: {node: '>=18'} + globrex@0.1.2: + resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} + gonzales-pe@4.3.0: resolution: {integrity: sha512-otgSPpUmdWJ43VXyiNgEYE4luzHCL2pz4wQ0OnDluC6Eg4Ko3Vexy/SrSynglw/eR+OhkzmqFCZa/OFa/RgAOQ==} engines: {node: '>=0.6.0'} @@ -8676,6 +8648,10 @@ packages: json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + json-crawl@0.5.3: + resolution: {integrity: sha512-BEjjCw8c7SxzNK4orhlWD5cXQh8vCk2LqDr4WgQq4CV+5dvopeYwt1Tskg67SuSLKvoFH5g0yuYtg7rcfKV6YA==} + engines: {node: '>=14.0.0'} + json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} @@ -8687,22 +8663,9 @@ packages: resolution: {integrity: sha512-lR4MXjGNgkJc7tkQ97kb2nuEMnNCyU//XYVH0MKTGcXEiSudQ5MKGKen3C5QubYy0vmq+JGitUg92uuywGEwIA==} engines: {node: ^18.17.0 || >=20.5.0} - json-schema-diff@0.18.1: - resolution: {integrity: sha512-lLP/kbwXN85yKWwBGtraxVrJnK/v31D7UZIkSg68BrO+Qeai+aeW1u9b5H1h9uF/Uzzsa8PeaQPTYRaUcdAgWQ==} - engines: {node: '>=v10.24.1'} - hasBin: true - - json-schema-ref-parser@9.0.9: - resolution: {integrity: sha512-qcP2lmGy+JUoQJ4DOQeLaZDqH9qSkeGCK3suKWxJXS82dg728Mn3j97azDMaOUmJAN4uCq91LdPx4K7E8F1a7Q==} - engines: {node: '>=10'} - deprecated: Please switch to @apidevtools/json-schema-ref-parser - json-schema-ref-resolver@2.0.1: resolution: {integrity: sha512-HG0SIB9X4J8bwbxCbnd5FfPEbcXAJYTi1pBJeP/QPON+w8ovSME8iRG+ElHNxZNX2Qh6eYn1GdzJFS4cDFfx0Q==} - json-schema-spec-types@0.1.2: - resolution: {integrity: sha512-MDl8fA8ONckmQOm2+eXKJaFJNvxk7eGin+XFofNjS3q3PRKSoEvgMVb0ehOpCAYkUiLoMiqdU7obV7AmzAmyLw==} - json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} @@ -8740,10 +8703,6 @@ packages: resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} engines: {'0': node >= 0.2.0} - jsonpointer@5.0.1: - resolution: {integrity: sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==} - engines: {node: '>=0.10.0'} - jsx-ast-utils@3.3.5: resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==} engines: {node: '>=4.0'} @@ -8949,9 +8908,6 @@ packages: lodash-es@4.17.21: resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - lodash.clonedeep@4.5.0: - resolution: {integrity: sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==} - lodash.debounce@4.0.8: resolution: {integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==} @@ -8964,17 +8920,9 @@ packages: lodash.flatten@4.4.0: resolution: {integrity: sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==} - lodash.get@4.4.2: - resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==} - deprecated: This package is deprecated. Use the optional chaining (?.) operator instead. - lodash.isarguments@3.1.0: resolution: {integrity: sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==} - lodash.isequal@4.5.0: - resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==} - deprecated: This package is deprecated. Use require('node:util').isDeepStrictEqual instead. - lodash.isplainobject@4.0.6: resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==} @@ -9746,17 +9694,6 @@ packages: resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==} engines: {node: '>=12'} - openapi-diff@0.23.7: - resolution: {integrity: sha512-ABXJ7gTYyawmEC4Z3MiLu7CoD2fLSVfid+ttP9yiuDpytC2PDsc26OTNhYUV9y/z2/ama4CKbszkq3LMd80R6Q==} - engines: {node: '>=6.11.4'} - hasBin: true - - openapi-types@12.1.3: - resolution: {integrity: sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==} - - openapi3-ts@2.0.2: - resolution: {integrity: sha512-TxhYBMoqx9frXyOgnRHufjQfPXomTIHYKhSKJ6jHfj13kS8OEIhvmE8CTuQyKtjjWttAjX5DPxM1vmalEpo8Qw==} - optionator@0.9.4: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} @@ -11385,10 +11322,6 @@ packages: engines: {node: '>=14.0.0'} hasBin: true - swagger-parser@10.0.3: - resolution: {integrity: sha512-nF7oMeL4KypldrQhac8RyHerJeGPD1p2xDh900GPvc+Nk7nWP6jX2FcC7WmkinMoAmoO774+AFXcWsW8gMWEIg==} - engines: {node: '>=10'} - symbol-observable@4.0.0: resolution: {integrity: sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==} engines: {node: '>=0.10'} @@ -12072,18 +12005,10 @@ packages: resolution: {integrity: sha512-d7KLgL1LD3U3fgnvWEY1cQXoO/q6EQ1BSz48Sa149V/5zVTAbgmZIpyI8TRi6U9/JNyeYLlTKsEMPtLC27RFUg==} engines: {node: ^18.17.0 || >=20.5.0} - validator@13.15.15: - resolution: {integrity: sha512-BgWVbCI72aIQy937xbawcs+hrVaN/CZ2UwutgaJ36hGqRrLNM+f5LUT/YPRbo8IV/ASeFzXszezV+y2+rq3l8A==} - engines: {node: '>= 0.10'} - vary@1.1.2: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} - verror@1.10.1: - resolution: {integrity: sha512-veufcmxri4e3XSrT0xwfUR7kguIkaxBeosDg00yDWhk49wdwkSUrvvsm7nc75e1PUyvIeZj6nS8VQRYz2/S4Xg==} - engines: {node: '>=0.6.0'} - vfile-message@4.0.2: resolution: {integrity: sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==} @@ -12165,6 +12090,14 @@ packages: peerDependencies: vite: ^3.0.0-0 || ^4.0.0-0 || ^5.0.0-0 || ^6.0.0-0 + vite-tsconfig-paths@5.1.4: + resolution: {integrity: sha512-cYj0LRuLV2c2sMqhqhGpaO3LretdtMn/BVX4cPLanIZuwwrkVl+lK84E/miEXkCHWXuq65rhNN4rXsBcOB3S4w==} + peerDependencies: + vite: '*' + peerDependenciesMeta: + vite: + optional: true + vite@5.4.19: resolution: {integrity: sha512-qO3aKv3HoQC8QKiNSTuUM1l9o/XX3+c+VTgLHbJWHZGeTPVAg2XwazI9UWzoxjIJCGCV2zU60uqMzjeLZuULqA==} engines: {node: ^18.0.0 || >=20.0.0} @@ -12717,11 +12650,6 @@ packages: resolution: {integrity: sha512-HUn0M24AUTMvjdkoMtH8fJz2FEd+k1xvtR9EoTrDUoVUi6o7xl5X+pST/vjk4T3GEQo2mJ9FlAvhWBm8dIdD4g==} engines: {node: '>=18'} - z-schema@5.0.5: - resolution: {integrity: sha512-D7eujBWkLa3p2sIpJA0d1pr7es+a7m0vFAnZLlCEKq/Ij2k0MLi9Br2UPxoxdYystm5K1yeBGzub0FlYUEWj2Q==} - engines: {node: '>=8.0.0'} - hasBin: true - zhead@2.2.4: resolution: {integrity: sha512-8F0OI5dpWIA5IGG5NHUg9staDwz/ZPxZtvGVf01j7vHqSyZ0raHY+78atOVxRqb73AotX22uV1pXt3gYSstGag==} @@ -13240,34 +13168,6 @@ snapshots: '@antfu/utils@0.7.10': {} - '@apidevtools/json-schema-ref-parser@9.0.9': - dependencies: - '@jsdevtools/ono': 7.1.3 - '@types/json-schema': 7.0.15 - call-me-maybe: 1.0.2 - js-yaml: 4.1.0 - - '@apidevtools/json-schema-ref-parser@9.1.2': - dependencies: - '@jsdevtools/ono': 7.1.3 - '@types/json-schema': 7.0.15 - call-me-maybe: 1.0.2 - js-yaml: 4.1.0 - - '@apidevtools/openapi-schemas@2.1.0': {} - - '@apidevtools/swagger-methods@3.0.2': {} - - '@apidevtools/swagger-parser@10.0.3(openapi-types@12.1.3)': - dependencies: - '@apidevtools/json-schema-ref-parser': 9.1.2 - '@apidevtools/openapi-schemas': 2.1.0 - '@apidevtools/swagger-methods': 3.0.2 - '@jsdevtools/ono': 7.1.3 - call-me-maybe: 1.0.2 - openapi-types: 12.1.3 - z-schema: 5.0.5 - '@arethetypeswrong/cli@0.17.4': dependencies: '@arethetypeswrong/core': 0.17.4 @@ -14745,11 +14645,12 @@ snapshots: '@fontsource/fira-mono@5.0.0': {} - '@hey-api/json-schema-ref-parser@1.0.4': + '@hey-api/json-schema-ref-parser@1.0.5': dependencies: '@jsdevtools/ono': 7.1.3 '@types/json-schema': 7.0.15 js-yaml: 4.1.0 + lodash: 4.17.21 '@hey-api/json-schema-ref-parser@1.0.6': dependencies: @@ -15894,7 +15795,7 @@ snapshots: - vti - vue-tsc - '@nx/devkit@20.7.2(nx@21.0.3)': + '@nx/devkit@20.8.1(nx@21.0.3)': dependencies: ejs: 3.1.10 enquirer: 2.3.6 @@ -18301,6 +18202,10 @@ snapshots: alien-signals@0.4.14: {} + allof-merge@0.6.6: + dependencies: + json-crawl: 0.5.3 + ansi-colors@4.1.3: {} ansi-escapes@4.3.2: @@ -18332,6 +18237,11 @@ snapshots: normalize-path: 3.0.0 picomatch: 2.3.1 + api-smart-diff@1.0.6: + dependencies: + allof-merge: 0.6.6 + json-crawl: 0.5.3 + aproba@2.0.0: {} archiver-utils@2.1.0: @@ -18480,8 +18390,6 @@ snapshots: get-intrinsic: 1.3.0 is-array-buffer: 3.0.5 - assert-plus@1.0.0: {} - assertion-error@2.0.1: {} ast-kit@1.4.3: @@ -18842,8 +18750,6 @@ snapshots: call-bind-apply-helpers: 1.0.2 get-intrinsic: 1.3.0 - call-me-maybe@1.0.2: {} - callsite@1.0.0: {} callsites@3.1.0: {} @@ -19051,9 +18957,6 @@ snapshots: commander@8.3.0: {} - commander@9.5.0: - optional: true - common-path-prefix@3.0.0: {} commondir@1.0.1: {} @@ -19129,11 +19032,6 @@ snapshots: convert-source-map@2.0.0: {} - convict@6.2.4: - dependencies: - lodash.clonedeep: 4.5.0 - yargs-parser: 20.2.9 - cookie-es@1.2.2: {} cookie-es@2.0.0: {} @@ -19170,8 +19068,6 @@ snapshots: dependencies: browserslist: 4.24.5 - core-util-is@1.0.2: {} - core-util-is@1.0.3: {} cors@2.8.5: @@ -20428,8 +20324,6 @@ snapshots: transitivePeerDependencies: - supports-color - extsprintf@1.4.1: {} - fake-indexeddb@6.0.1: {} fast-decode-uri-component@1.0.1: {} @@ -20904,6 +20798,8 @@ snapshots: slash: 5.1.0 unicorn-magic: 0.3.0 + globrex@0.1.2: {} + gonzales-pe@4.3.0: dependencies: minimist: 1.2.8 @@ -21599,32 +21495,18 @@ snapshots: json-buffer@3.0.1: {} + json-crawl@0.5.3: {} + json-parse-even-better-errors@2.3.1: {} json-parse-even-better-errors@3.0.2: {} json-parse-even-better-errors@4.0.0: {} - json-schema-diff@0.18.1: - dependencies: - ajv: 8.17.1 - commander: 10.0.1 - convict: 6.2.4 - json-schema-ref-parser: 9.0.9 - json-schema-spec-types: 0.1.2 - lodash: 4.17.21 - verror: 1.10.1 - - json-schema-ref-parser@9.0.9: - dependencies: - '@apidevtools/json-schema-ref-parser': 9.0.9 - json-schema-ref-resolver@2.0.1: dependencies: dequal: 2.0.3 - json-schema-spec-types@0.1.2: {} - json-schema-traverse@0.4.1: {} json-schema-traverse@1.0.0: {} @@ -21655,8 +21537,6 @@ snapshots: jsonparse@1.3.1: {} - jsonpointer@5.0.1: {} - jsx-ast-utils@3.3.5: dependencies: array-includes: 3.1.8 @@ -21922,8 +21802,6 @@ snapshots: lodash-es@4.17.21: {} - lodash.clonedeep@4.5.0: {} - lodash.debounce@4.0.8: {} lodash.defaults@4.2.0: {} @@ -21932,12 +21810,8 @@ snapshots: lodash.flatten@4.4.0: {} - lodash.get@4.4.2: {} - lodash.isarguments@3.1.0: {} - lodash.isequal@4.5.0: {} - lodash.isplainobject@4.0.6: {} lodash.memoize@4.1.2: {} @@ -23107,27 +22981,6 @@ snapshots: is-docker: 2.2.1 is-wsl: 2.2.0 - openapi-diff@0.23.7(openapi-types@12.1.3): - dependencies: - axios: 1.8.2 - commander: 8.3.0 - js-yaml: 4.1.0 - json-schema-diff: 0.18.1 - jsonpointer: 5.0.1 - lodash: 4.17.21 - openapi3-ts: 2.0.2 - swagger-parser: 10.0.3(openapi-types@12.1.3) - verror: 1.10.1 - transitivePeerDependencies: - - debug - - openapi-types - - openapi-types@12.1.3: {} - - openapi3-ts@2.0.2: - dependencies: - yaml: 1.10.2 - optionator@0.9.4: dependencies: deep-is: 0.1.4 @@ -24996,12 +24849,6 @@ snapshots: csso: 5.0.5 picocolors: 1.1.1 - swagger-parser@10.0.3(openapi-types@12.1.3): - dependencies: - '@apidevtools/swagger-parser': 10.0.3(openapi-types@12.1.3) - transitivePeerDependencies: - - openapi-types - symbol-observable@4.0.0: {} symbol-tree@3.2.4: {} @@ -25816,16 +25663,8 @@ snapshots: validate-npm-package-name@6.0.0: {} - validator@13.15.15: {} - vary@1.1.2: {} - verror@1.10.1: - dependencies: - assert-plus: 1.0.0 - core-util-is: 1.0.2 - extsprintf: 1.4.1 - vfile-message@4.0.2: dependencies: '@types/unist': 3.0.3 @@ -25972,6 +25811,17 @@ snapshots: transitivePeerDependencies: - supports-color + vite-tsconfig-paths@5.1.4(typescript@5.8.3)(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)): + dependencies: + debug: 4.4.1 + globrex: 0.1.2 + tsconfck: 3.1.5(typescript@5.8.3) + optionalDependencies: + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) + transitivePeerDependencies: + - supports-color + - typescript + vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1): dependencies: esbuild: 0.21.5 @@ -26561,14 +26411,6 @@ snapshots: cookie: 1.0.2 youch-core: 0.3.2 - z-schema@5.0.5: - dependencies: - lodash.get: 4.4.2 - lodash.isequal: 4.5.0 - validator: 13.15.15 - optionalDependencies: - commander: 9.5.0 - zhead@2.2.4: {} zimmerframe@1.1.2: {} From 2526549ac9d04ab0fdbfabf2388170f0a8e12468 Mon Sep 17 00:00:00 2001 From: Landon Date: Sun, 27 Apr 2025 09:58:04 -0400 Subject: [PATCH 15/26] chore(dependencies): downgrade find-my-way to version 9.2.0 and add overrides in package.json files to support node 18 --- examples/openapi-ts-fastify/package.json | 3 +++ package.json | 1 + pnpm-lock.yaml | 3 +++ 3 files changed, 7 insertions(+) diff --git a/examples/openapi-ts-fastify/package.json b/examples/openapi-ts-fastify/package.json index 420878eb7..a4333fb54 100644 --- a/examples/openapi-ts-fastify/package.json +++ b/examples/openapi-ts-fastify/package.json @@ -20,5 +20,8 @@ "typescript": "5.8.3", "vite": "6.2.7", "vitest": "3.1.1" + }, + "overrides": { + "find-my-way": "9.2.0" } } diff --git a/package.json b/package.json index a031f0443..ecb451ec9 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ "eslint-plugin-sort-keys-fix": "1.1.2", "eslint-plugin-typescript-sort-keys": "3.3.0", "eslint-plugin-vue": "9.32.0", + "find-my-way": "9.2.0", "globals": "15.14.0", "husky": "9.1.7", "lint-staged": "15.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8b32acc64..bd1ae1826 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -53,6 +53,9 @@ importers: eslint-plugin-vue: specifier: 9.32.0 version: 9.32.0(eslint@9.17.0(jiti@2.4.2)) + find-my-way: + specifier: 9.2.0 + version: 9.2.0 globals: specifier: 15.14.0 version: 15.14.0 From 80ba81deaf5519efb90661712f85053aded0e809 Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Mon, 28 Apr 2025 19:54:48 -0400 Subject: [PATCH 16/26] feat(nx-plugin): add base tsconfig options for improved configuration management - Introduce `baseTsConfigName` and `baseTsConfigPath` options in the OpenAPI client generator and update executor schemas. - Enhance README documentation to reflect new options and their usage. - Implement `getBaseTsConfigPath` utility to resolve tsconfig paths based on provided options. - Update tests to cover new tsconfig path handling logic. --- packages/nx-plugin/README.md | 4 + .../update-api/updateApi.schema.json | 11 +- .../src/executors/update-api/updateApi.ts | 21 ++- .../files/tsconfig.json.template | 2 +- .../openapi-client/openapiClient.schema.json | 8 + .../openapi-client/openapiClient.spec.ts | 4 + .../openapi-client/openapiClient.ts | 37 +++- .../tests/vitest/tsconfig.spec.json.template | 2 +- packages/nx-plugin/src/utils.spec.ts | 160 +++++++++++++++++- packages/nx-plugin/src/utils.ts | 97 ++++++++++- 10 files changed, 329 insertions(+), 17 deletions(-) diff --git a/packages/nx-plugin/README.md b/packages/nx-plugin/README.md index 8636ad92b..c4fae8f76 100644 --- a/packages/nx-plugin/README.md +++ b/packages/nx-plugin/README.md @@ -32,6 +32,8 @@ Run in interactive mode `nx g @hey-api/nx-plugin:openapi-client` The defaults tags will not be added to the project if you specify this option. - `plugins`: Additional plugins to provide to the client api. [ string[] ] (optional) - `test`: The type of tests to setup. [ 'none' | 'vitest' ] (optional) (default: `none`) +- `baseTsConfigName`: The name of the base tsconfig file that contains the compiler paths used to resolve the imports. Use this if the base tsconfig file is in the workspace root. If provided with a baseTsConfigPath then the baseTsConfigName will be added to the path. Do not use this if the baseTsConfigPath is a file. [ string ] (optional) +- `baseTsConfigPath`: The path to the base tsconfig file that contains the compiler paths used to resolve the imports. Use this if the base tsconfig file is not in the workspace root. This can be a file or a directory. If it is a directory and the baseTsConfigName is provided then the baseTsConfigName will be added to the path. If it is a file and the baseTsConfigName is provided then there will be an error. [ string ] (optional) ##### Example @@ -46,6 +48,8 @@ nx g @hey-api/nx-plugin:openapi-client --name=my-api --client=@hey-api/client-fe This executor updates the OpenAPI spec file and generates a new client. The options for the executor will be populated from the generator. +No need to add them yourself, to modify the options manually edit the `project.json` of the generated project. + Run `nx run @my-org/my-generated-package:updateApi` ##### Options diff --git a/packages/nx-plugin/src/executors/update-api/updateApi.schema.json b/packages/nx-plugin/src/executors/update-api/updateApi.schema.json index 4d4d97939..11a2b1b01 100644 --- a/packages/nx-plugin/src/executors/update-api/updateApi.schema.json +++ b/packages/nx-plugin/src/executors/update-api/updateApi.schema.json @@ -39,7 +39,16 @@ "description": "The plugins to be provided to @hey-api/openapi-ts", "default": [], "items": { - "type": "string" + "oneOf": [ + { "type": "string" }, + { + "type": "object", + "properties": { + "asClass": { "type": "boolean" }, + "name": { "type": "string" } + } + } + ] } }, "force": { diff --git a/packages/nx-plugin/src/executors/update-api/updateApi.ts b/packages/nx-plugin/src/executors/update-api/updateApi.ts index 99fa6f1f1..90eb893ba 100644 --- a/packages/nx-plugin/src/executors/update-api/updateApi.ts +++ b/packages/nx-plugin/src/executors/update-api/updateApi.ts @@ -3,8 +3,12 @@ import { cp, readFile, rm } from 'node:fs/promises'; import { join } from 'node:path'; import type { PromiseExecutor } from '@nx/devkit'; -import { logger, names } from '@nx/devkit'; -import { format } from 'prettier'; +import { logger, names, workspaceRoot } from '@nx/devkit'; +import { + format, + type Options as PrettierOptions, + resolveConfig, +} from 'prettier'; import { bundleAndDereferenceSpecFile, @@ -201,6 +205,13 @@ const runExecutor: PromiseExecutor = async ( const apiDirectoryExists = existsSync(absoluteApiDirectory); const existingSpecFileExists = existsSync(absoluteExistingSpecPath); + const prettierConfig = await resolveConfig(workspaceRoot, { + editorconfig: true, + }); + const prettierOptions: PrettierOptions = { + ...prettierConfig, + }; + // Copy new spec to project if (apiDirectoryExists) { if (existingSpecFileExists) { @@ -209,8 +220,10 @@ const runExecutor: PromiseExecutor = async ( logger.debug('No existing spec file found. Creating...'); } const formattedSpec = await format(newSpecString, { - parser: 'yaml', + ...prettierOptions, + filepath: absoluteTempSpecPath, }); + writeFileSync(absoluteExistingSpecPath, formattedSpec); logger.debug(`Spec file updated successfully`); } else { @@ -253,7 +266,7 @@ const runExecutor: PromiseExecutor = async ( }); logger.debug('Formatting generated directory...'); - await formatFiles(absoluteProjectGeneratedDir); + await formatFiles(absoluteProjectGeneratedDir, prettierOptions); logger.info('Successfully updated API client and spec files.'); await cleanup(absoluteTempFolder); diff --git a/packages/nx-plugin/src/generators/openapi-client/files/tsconfig.json.template b/packages/nx-plugin/src/generators/openapi-client/files/tsconfig.json.template index a76ba77c5..5795dfb19 100644 --- a/packages/nx-plugin/src/generators/openapi-client/files/tsconfig.json.template +++ b/packages/nx-plugin/src/generators/openapi-client/files/tsconfig.json.template @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.base.json", + "extends": "<%= pathToTsConfig %>/<%= tsConfigName %>", "compilerOptions": { }, "files": [], diff --git a/packages/nx-plugin/src/generators/openapi-client/openapiClient.schema.json b/packages/nx-plugin/src/generators/openapi-client/openapiClient.schema.json index aca6670df..01378a778 100644 --- a/packages/nx-plugin/src/generators/openapi-client/openapiClient.schema.json +++ b/packages/nx-plugin/src/generators/openapi-client/openapiClient.schema.json @@ -66,6 +66,14 @@ "type": "boolean", "description": "** not working ** Whether to use the class style for the generated code, defaults to `false`", "default": false + }, + "baseTsConfigName": { + "type": "string", + "description": "The name of the base tsconfig file that contains the compiler paths used to resolve the imports, use this if the base tsconfig file is in the workspace root, if provided with a baseTsConfigPath then the baseTsConfigName will be added to the path. DO not use this if the baseTsConfigPath is a file." + }, + "baseTsConfigPath": { + "type": "string", + "description": "The path to the base tsconfig file that contains the compiler paths used to resolve the imports, use this if the base tsconfig file is not in the workspace root. This can be a file or a directory. If it is a directory and the baseTsConfigName is provided then the baseTsConfigName will be added to the path. If it is a file and the baseTsConfigName is provided then there will be an error." } }, "required": ["name", "spec", "scope"] diff --git a/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts b/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts index 303c39415..b339fce91 100644 --- a/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts +++ b/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts @@ -76,6 +76,8 @@ describe('openapi-client generator', () => { const normalized = normalizeOptions(options); expect(normalized).toEqual({ + baseTsConfigName: undefined, + baseTsConfigPath: undefined, clientType: '@hey-api/client-fetch', isPrivate: true, plugins: ['@hey-api/typescript', '@hey-api/sdk'], @@ -105,6 +107,8 @@ describe('openapi-client generator', () => { const normalized = normalizeOptions(customOptions); expect(normalized).toEqual({ + baseTsConfigName: undefined, + baseTsConfigPath: undefined, clientType: '@hey-api/client-fetch', isPrivate: true, plugins: ['@hey-api/typescript', '@hey-api/sdk'], diff --git a/packages/nx-plugin/src/generators/openapi-client/openapiClient.ts b/packages/nx-plugin/src/generators/openapi-client/openapiClient.ts index 8dc787a64..9e90a2ee8 100644 --- a/packages/nx-plugin/src/generators/openapi-client/openapiClient.ts +++ b/packages/nx-plugin/src/generators/openapi-client/openapiClient.ts @@ -28,6 +28,7 @@ import { bundleAndDereferenceSpecFile, generateClientCode, generateClientCommand, + getBaseTsConfigPath, getPackageName, getPluginName, getVersionOfPackage, @@ -128,6 +129,18 @@ export interface OpenApiClientGeneratorSchema { * Whether to use the class style for the generated code, defaults to `false` */ asClass?: boolean; + /** + * The name of the base tsconfig file that contains the compiler paths used to resolve the imports, use this if the base tsconfig file is in the workspace root, + * if provided with a baseTsConfigPath then the baseTsConfigName will be added to the path. + * DO not use this if the baseTsConfigPath is a file. + */ + baseTsConfigName?: string; + /** + * The path to the base tsconfig file that contains the compiler paths used to resolve the imports, use this if the base tsconfig file is not in the workspace root. + * This can be a file or a directory. If it is a directory and the baseTsConfigName is provided then the baseTsConfigName will be added to the path. + * If it is a file and the baseTsConfigName is provided then there will be an error. + */ + baseTsConfigPath?: string; /** * The client to use for the OpenAPI client */ @@ -286,6 +299,8 @@ export default async function ( } export interface NormalizedOptions { + baseTsConfigName: string | undefined; + baseTsConfigPath: string | undefined; clientType: string; isPrivate: boolean; plugins: Plugin[]; @@ -299,7 +314,11 @@ export interface NormalizedOptions { test: TestRunner | 'none'; } -export type GeneratedOptions = NormalizedOptions & typeof CONSTANTS; +export type GeneratedOptions = NormalizedOptions & + typeof CONSTANTS & { + pathToTsConfig: string; + tsConfigName: string; + }; type ProjectConfigurationTargets = NonNullable; type ValueType> = T[keyof T]; @@ -335,7 +354,6 @@ export function normalizeOptions( const tempFolder = options.tempFolderDir ?? join(defaultTempFolder, projectName); const [default1, default2, ...rest] = defaultPlugins; - logger.debug('As Class', options.asClass); const plugins = [ default1, options.asClass @@ -349,6 +367,8 @@ export function normalizeOptions( ]; return { + baseTsConfigName: options.baseTsConfigName, + baseTsConfigPath: options.baseTsConfigPath, clientType: options.client, isPrivate: options.private ?? true, plugins, @@ -413,6 +433,8 @@ export async function generateNxProject({ }) { logger.debug(`Generating Nx project...`); const { + baseTsConfigName, + baseTsConfigPath, clientType, plugins, projectName, @@ -476,6 +498,12 @@ export async function generateNxProject({ ); } + const { tsConfigDirectory, tsConfigName } = await getBaseTsConfigPath({ + baseTsConfigName, + baseTsConfigPath, + projectRoot, + }); + // Create basic project structure addProjectConfiguration(tree, `${projectScope}/${projectName}`, { implicitDependencies: dependsOnProject ? [dependsOnProject] : [], @@ -536,10 +564,15 @@ export async function generateNxProject({ }, }); + /** + * The variables that are passed to the template files + */ const generatedOptions: GeneratedOptions = { ...normalizedOptions, ...CONSTANTS, + pathToTsConfig: tsConfigDirectory, plugins: plugins.map(getPluginName), + tsConfigName, }; // Create directory structure diff --git a/packages/nx-plugin/src/generators/openapi-client/tests/vitest/tsconfig.spec.json.template b/packages/nx-plugin/src/generators/openapi-client/tests/vitest/tsconfig.spec.json.template index 3d2f3e498..a84f0c21e 100644 --- a/packages/nx-plugin/src/generators/openapi-client/tests/vitest/tsconfig.spec.json.template +++ b/packages/nx-plugin/src/generators/openapi-client/tests/vitest/tsconfig.spec.json.template @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.base.json", + "extends": "<%= pathToTsConfig %>/<%= tsConfigName %>", "compilerOptions": { "outDir": "./out-tsc/vitest", "types": [ diff --git a/packages/nx-plugin/src/utils.spec.ts b/packages/nx-plugin/src/utils.spec.ts index d0487e7ab..9c0cf4be9 100644 --- a/packages/nx-plugin/src/utils.spec.ts +++ b/packages/nx-plugin/src/utils.spec.ts @@ -1,4 +1,5 @@ import { randomUUID } from 'node:crypto'; +import { existsSync, lstatSync } from 'node:fs'; import { rm, writeFile } from 'node:fs/promises'; import { join } from 'node:path'; @@ -10,12 +11,18 @@ import { bundleAndDereferenceSpecFile, generateClientCode, generateClientCommand, + getBaseTsConfigPath, getPackageName, getVersionOfPackage, isAFile, isUrl, } from './utils'; +vi.mock('node:fs', () => ({ + existsSync: vi.fn(), + lstatSync: vi.fn(), +})); + vi.mock('@hey-api/openapi-ts', async (importOriginal) => { const actual = await importOriginal(); return { @@ -52,6 +59,14 @@ vi.mock('@hey-api/openapi-ts/internal', async (importOriginal) => { }; }); +vi.mock('@nx/devkit', async (importOriginal) => { + const actual = await importOriginal(); + return { + ...actual, + workspaceRoot: '/', + }; +}); + describe('utils', () => { beforeEach(() => { vi.clearAllMocks(); @@ -255,9 +270,12 @@ paths: describe('isAFile', () => { it('should return true for valid file paths', async () => { - await writeFile('./spec.yaml', 'openapi: 3.0.0'); + vi.mocked(existsSync).mockReturnValue(true); + vi.mocked(lstatSync).mockReturnValue({ + isDirectory: () => false, + isFile: () => true, + } as any); expect(isAFile('./spec.yaml')).toBe(true); - await rm('./spec.yaml'); }); it('should return false for valid URLs', () => { @@ -265,6 +283,7 @@ paths: }); it('should return false for invalid file paths', () => { + vi.mocked(existsSync).mockReturnValue(false); expect(isAFile('not-a-file')).toBe(false); }); @@ -272,4 +291,141 @@ paths: expect(isAFile('http://example.com')).toBe(false); }); }); + + describe('getBaseTsConfigPath', () => { + beforeEach(() => { + vi.clearAllMocks(); + }); + + it('success when no baseTsConfigPath is provided', async () => { + const projectRoot = '/path/to/project'; + vi.mocked(existsSync).mockReturnValue(true); + vi.mocked(lstatSync).mockReturnValue({ isDirectory: () => false } as any); + const { tsConfigDirectory, tsConfigName } = await getBaseTsConfigPath({ + projectRoot, + }); + expect(join(tsConfigDirectory)).toBe(join('../../..')); + expect(tsConfigName).toBe('tsconfig.base.json'); + }); + + it('success when no baseTsConfigPath is provided', async () => { + const projectRoot = '/path/to/project'; + + // fail first time + vi.mocked(existsSync).mockReturnValueOnce(false); + // then succeed + vi.mocked(existsSync).mockReturnValueOnce(true); + vi.mocked(lstatSync).mockReturnValue({ isDirectory: () => false } as any); + const { tsConfigDirectory, tsConfigName } = await getBaseTsConfigPath({ + projectRoot, + }); + expect(join(tsConfigDirectory)).toBe(join('../../..')); + expect(tsConfigName).toBe('tsconfig.json'); + }); + + it('should return path when baseTsConfigPath is a file', async () => { + const mockPath = '/path/to/tsconfig.json'; + const projectRoot = '/path/to/project'; + vi.mocked(existsSync).mockReturnValue(true); + vi.mocked(lstatSync).mockReturnValue({ isDirectory: () => false } as any); + + const { tsConfigDirectory, tsConfigName } = await getBaseTsConfigPath({ + baseTsConfigPath: mockPath, + projectRoot, + }); + expect(join(tsConfigDirectory)).toBe(join('..')); + expect(tsConfigName).toBe('tsconfig.json'); + }); + + it('should throw error when baseTsConfigPath is a file and baseTsConfigName is provided', async () => { + const mockPath = '/path/to/tsconfig.json'; + const projectRoot = '/path/to/project'; + vi.mocked(existsSync).mockReturnValue(true); + vi.mocked(lstatSync).mockReturnValue({ isDirectory: () => false } as any); + + await expect( + getBaseTsConfigPath({ + baseTsConfigName: 'tsconfig.json', + baseTsConfigPath: mockPath, + projectRoot, + }), + ).rejects.toThrow('Base tsconfig name'); + }); + + it('should throw error when baseTsConfigPath file does not exist', async () => { + const mockPath = '/path/to/tsconfig.json'; + const projectRoot = '/path/to/project'; + vi.mocked(existsSync).mockReturnValue(false); + vi.mocked(lstatSync).mockReturnValue({ isDirectory: () => false } as any); + + await expect( + getBaseTsConfigPath({ + baseTsConfigPath: mockPath, + projectRoot, + }), + ).rejects.toThrow('Base tsconfig file'); + }); + + it('should throw error when baseTsConfigPath is neither file nor directory', async () => { + const mockPath = '/path/to/invalid'; + const projectRoot = '/path/to/project'; + vi.mocked(existsSync).mockReturnValue(false); + vi.mocked(lstatSync).mockReturnValue({ isDirectory: () => false } as any); + + await expect( + getBaseTsConfigPath({ + baseTsConfigPath: mockPath, + projectRoot, + }), + ).rejects.toThrow('not a directory or a file'); + }); + + it('should use workspaceRoot when baseTsConfigPath is a directory', async () => { + const mockPath = '/path/to/dir'; + const projectRoot = '/path/to/project'; + const mockConfigName = 'tsconfig.test.json'; + vi.mocked(existsSync).mockImplementation( + (path) => path === join(mockPath, mockConfigName), + ); + vi.mocked(lstatSync).mockReturnValue({ isDirectory: () => true } as any); + + const { tsConfigDirectory, tsConfigName } = await getBaseTsConfigPath({ + baseTsConfigName: mockConfigName, + baseTsConfigPath: mockPath, + projectRoot, + }); + expect(join(tsConfigDirectory)).toBe(join('../dir')); + expect(tsConfigName).toBe(mockConfigName); + }); + + it('should try default config names when no baseTsConfigName is provided', async () => { + const mockPath = '/path/to/dir'; + const projectRoot = '/path/to/project'; + vi.mocked(existsSync).mockImplementation( + (path) => path === join(mockPath, 'tsconfig.json'), + ); + vi.mocked(lstatSync).mockReturnValue({ isDirectory: () => true } as any); + + const { tsConfigDirectory, tsConfigName } = await getBaseTsConfigPath({ + baseTsConfigPath: mockPath, + projectRoot, + }); + expect(join(tsConfigDirectory)).toBe(join('../dir')); + expect(tsConfigName).toBe('tsconfig.json'); + }); + + it('should throw error when no config file is found', async () => { + const mockPath = '/path/to/dir'; + const projectRoot = '/path/to/project'; + vi.mocked(existsSync).mockReturnValue(false); + vi.mocked(lstatSync).mockReturnValue({ isDirectory: () => true } as any); + + await expect( + getBaseTsConfigPath({ + baseTsConfigPath: mockPath, + projectRoot, + }), + ).rejects.toThrow('Failed to find base tsconfig file'); + }); + }); }); diff --git a/packages/nx-plugin/src/utils.ts b/packages/nx-plugin/src/utils.ts index 13ac091ef..2f4cb869f 100644 --- a/packages/nx-plugin/src/utils.ts +++ b/packages/nx-plugin/src/utils.ts @@ -1,6 +1,6 @@ import { existsSync, lstatSync } from 'node:fs'; import { mkdir, readdir, readFile, writeFile } from 'node:fs/promises'; -import { join } from 'node:path'; +import { basename, dirname, join, relative } from 'node:path'; import type { JSONSchema } from '@hey-api/json-schema-ref-parser'; import { createClient } from '@hey-api/openapi-ts'; @@ -9,9 +9,11 @@ import { initConfigs, parseOpenApiSpec, } from '@hey-api/openapi-ts/internal'; -import { logger } from '@nx/devkit'; +import { logger, workspaceRoot } from '@nx/devkit'; import { compareOpenApi } from 'api-smart-diff'; -import { format } from 'prettier'; +import { format, type Options as PrettierOptions } from 'prettier'; + +import { CONSTANTS } from './vars'; export type Plugin = string | { asClass: boolean; name: string }; @@ -259,19 +261,102 @@ export async function makeDir(path: string) { await mkdir(path, { recursive: true }); } -export async function formatFiles(dir: string) { +export async function formatFiles( + dir: string, + prettierOptions?: PrettierOptions, +) { const files = await readdir(dir, { withFileTypes: true }); const tasks = files.map(async (file) => { const filePath = join(dir, file.name); if (file.isDirectory()) { - await formatFiles(filePath); + await formatFiles(filePath, prettierOptions); } else if (file.name.endsWith('.ts')) { const content = await readFile(filePath, 'utf-8'); const formatted = await format(content, { - parser: 'typescript', + ...prettierOptions, + filepath: filePath, }); await writeFile(filePath, formatted); } }); await Promise.all(tasks); } + +export async function getBaseTsConfigPath({ + baseTsConfigName, + baseTsConfigPath, + projectRoot, +}: { + /** + * The name of the base tsconfig file that contains the compiler paths used to resolve the imports, use this if the base tsconfig file is in the workspace root, + * if provided with a baseTsConfigPath then the baseTsConfigName will be added to the path. + * DO not use this if the baseTsConfigPath is a file. + */ + baseTsConfigName?: string; + /** + * The path to the base tsconfig file that contains the compiler paths used to resolve the imports, use this if the base tsconfig file is not in the workspace root. + * This can be a file or a directory. If it is a directory and the baseTsConfigName is provided then the baseTsConfigName will be added to the path. + * If it is a file and the baseTsConfigName is provided then there will be an error. + */ + baseTsConfigPath?: string; + /** + * The root of the project, this is used to resolve the base tsconfig file. + */ + projectRoot: string; +}) { + const isTsConfigPathAFile = + baseTsConfigPath && baseTsConfigPath.endsWith('.json'); + + // return the path if it is a file + if (isTsConfigPathAFile) { + if (baseTsConfigName) { + throw new Error( + `Base tsconfig name ${baseTsConfigName} is not allowed when baseTsConfigPath is a file, either provide a baseTsConfigPath as a directory with a tsconfig.json file or provide a baseTsConfigName.`, + ); + } + + // check if the file exists + if (!existsSync(baseTsConfigPath)) { + throw new Error(`Base tsconfig file ${baseTsConfigPath} does not exist.`); + } + const resolvedTsConfig = relative(projectRoot, baseTsConfigPath); + const tsConfigName = basename(resolvedTsConfig); + const tsConfigDir = dirname(resolvedTsConfig); + return { + tsConfigDirectory: tsConfigDir, + tsConfigName, + }; + } + + const isTsConfigPathADirectory = + baseTsConfigPath && lstatSync(baseTsConfigPath).isDirectory(); + + if (!isTsConfigPathADirectory && baseTsConfigPath) { + throw new Error( + `Base tsconfig path ${baseTsConfigPath} is not a directory or a file.`, + ); + } + + const pathToUse = isTsConfigPathADirectory ? baseTsConfigPath : workspaceRoot; + + const possiblePaths = baseTsConfigName + ? [join(pathToUse, baseTsConfigName)] + : [ + join(pathToUse, CONSTANTS.TS_BASE_CONFIG_NAME), + join(pathToUse, 'tsconfig.json'), + ]; + for (const path of possiblePaths) { + if (existsSync(path)) { + const resolvedTsConfig = relative(projectRoot, path); + const tsConfigName = basename(resolvedTsConfig); + const tsConfigDir = dirname(resolvedTsConfig); + return { + tsConfigDirectory: tsConfigDir, + tsConfigName, + }; + } + } + const message = `Failed to find base tsconfig file. If your project has a non standard tsconfig name then, pass in the path to the tsconfig file using the baseTsConfigPath option or the baseTsConfigName option.`; + logger.error(message); + throw new Error(message); +} From 013257e87323639d072cd86f47f72041986afed3 Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Mon, 28 Apr 2025 22:54:17 -0400 Subject: [PATCH 17/26] feat(nx-plugin): enhance OpenAPI and Swagger spec comparison utilities - Introduce functions to standardize OpenAPI and Swagger specs, including version detection and conversion. - Implement `removeExamples` function to clean up specs before comparison, ensuring accurate diff results. - Add comprehensive tests for new functionality, covering various scenarios for OpenAPI 3.1 and Swagger 2.0 specs. - Update existing comparison logic to utilize standardized specs for improved accuracy. --- packages/nx-plugin/package.json | 4 +- .../nx-plugin/src/test-specs/base-3.1.json | 107 +++++++ .../src/test-specs/base-swagger.json | 78 ++++++ .../definition-changed-swagger.json | 81 ++++++ .../test-specs/endpoint-changed-swagger.json | 100 +++++++ .../test-specs/parameter-changed-swagger.json | 88 ++++++ .../src/test-specs/path-changed-swagger.json | 78 ++++++ .../src/test-specs/schema-changed-3.1.json | 111 ++++++++ .../test-specs/summary-changed-swagger.json | 78 ++++++ .../src/test-specs/webhook-changed-3.1.json | 107 +++++++ .../nx-plugin/src/utils.compare-spec.spec.ts | 100 +++++++ packages/nx-plugin/src/utils.spec.ts | 261 ++++++++++++++++++ packages/nx-plugin/src/utils.ts | 67 ++++- pnpm-lock.yaml | 175 ++++++++++++ 14 files changed, 1433 insertions(+), 2 deletions(-) create mode 100644 packages/nx-plugin/src/test-specs/base-3.1.json create mode 100644 packages/nx-plugin/src/test-specs/base-swagger.json create mode 100644 packages/nx-plugin/src/test-specs/definition-changed-swagger.json create mode 100644 packages/nx-plugin/src/test-specs/endpoint-changed-swagger.json create mode 100644 packages/nx-plugin/src/test-specs/parameter-changed-swagger.json create mode 100644 packages/nx-plugin/src/test-specs/path-changed-swagger.json create mode 100644 packages/nx-plugin/src/test-specs/schema-changed-3.1.json create mode 100644 packages/nx-plugin/src/test-specs/summary-changed-swagger.json create mode 100644 packages/nx-plugin/src/test-specs/webhook-changed-3.1.json diff --git a/packages/nx-plugin/package.json b/packages/nx-plugin/package.json index d42b9792a..23055828b 100644 --- a/packages/nx-plugin/package.json +++ b/packages/nx-plugin/package.json @@ -51,13 +51,15 @@ "@hey-api/json-schema-ref-parser": "1.0.5", "@hey-api/openapi-ts": "workspace:*", "@nx/devkit": "20.8.1", - "latest-version": "9.0.0", "api-smart-diff": "^1.0.6", + "latest-version": "9.0.0", + "swagger2openapi": "^7.0.8", "tslib": "2.8.1", "xcurl": "2.1.2" }, "devDependencies": { "@config/vite-base": "workspace:*", + "@types/swagger2openapi": "^7.0.4", "typescript": "5.8.3", "vitest": "3.1.1" }, diff --git a/packages/nx-plugin/src/test-specs/base-3.1.json b/packages/nx-plugin/src/test-specs/base-3.1.json new file mode 100644 index 000000000..f3c9d1cbb --- /dev/null +++ b/packages/nx-plugin/src/test-specs/base-3.1.json @@ -0,0 +1,107 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Test API 3.1", + "version": "1.0.0", + "description": "A test API for testing OpenAPI 3.1 spec comparison" + }, + "servers": [ + { + "url": "https://api.example.com/v1", + "description": "Production server" + } + ], + "security": [ + { + "apiKey": [] + } + ], + "paths": { + "/users": { + "get": { + "summary": "Get all users", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "Number of users to return", + "required": false, + "schema": { + "type": "integer", + "default": 10 + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + }, + "example": [ + { + "id": 1, + "name": "John Doe" + } + ] + } + } + } + } + } + } + }, + "webhooks": { + "newUser": { + "post": { + "summary": "New user webhook", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "responses": { + "200": { + "description": "Webhook processed successfully" + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "tags": { + "type": "array", + "prefixItems": [{ "type": "string" }, { "type": "number" }], + "items": { "type": "string" } + } + } + } + }, + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "name": "X-API-Key", + "in": "header" + } + } + } +} diff --git a/packages/nx-plugin/src/test-specs/base-swagger.json b/packages/nx-plugin/src/test-specs/base-swagger.json new file mode 100644 index 000000000..1f8fe3256 --- /dev/null +++ b/packages/nx-plugin/src/test-specs/base-swagger.json @@ -0,0 +1,78 @@ +{ + "swagger": "2.0", + "info": { + "title": "Test API Swagger", + "version": "1.0.0", + "description": "A test API for testing Swagger 2.0 spec comparison" + }, + "host": "api.example.com", + "basePath": "/v1", + "schemes": ["https"], + "securityDefinitions": { + "apiKey": { + "type": "apiKey", + "name": "X-API-Key", + "in": "header" + } + }, + "security": [ + { + "apiKey": [] + } + ], + "paths": { + "/users": { + "get": { + "summary": "Get all users", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "Number of users to return", + "required": false, + "type": "integer", + "default": 10 + } + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/User" + } + }, + "examples": { + "application/json": [ + { + "id": 1, + "name": "John Doe" + } + ] + } + } + } + } + } + }, + "definitions": { + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } +} diff --git a/packages/nx-plugin/src/test-specs/definition-changed-swagger.json b/packages/nx-plugin/src/test-specs/definition-changed-swagger.json new file mode 100644 index 000000000..8bfac8cd7 --- /dev/null +++ b/packages/nx-plugin/src/test-specs/definition-changed-swagger.json @@ -0,0 +1,81 @@ +{ + "swagger": "2.0", + "info": { + "title": "Test API Swagger", + "version": "1.0.0", + "description": "A test API for testing Swagger 2.0 spec comparison" + }, + "host": "api.example.com", + "basePath": "/v1", + "schemes": ["https"], + "securityDefinitions": { + "apiKey": { + "type": "apiKey", + "name": "X-API-Key", + "in": "header" + } + }, + "security": [ + { + "apiKey": [] + } + ], + "paths": { + "/users": { + "get": { + "summary": "Get all users", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "Number of users to return", + "required": false, + "type": "integer", + "default": 10 + } + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/User" + } + }, + "examples": { + "application/json": [ + { + "id": 1, + "name": "John Doe" + } + ] + } + } + } + } + } + }, + "definitions": { + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string", + "minLength": 1 + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + } + } + } + } +} diff --git a/packages/nx-plugin/src/test-specs/endpoint-changed-swagger.json b/packages/nx-plugin/src/test-specs/endpoint-changed-swagger.json new file mode 100644 index 000000000..f429fd234 --- /dev/null +++ b/packages/nx-plugin/src/test-specs/endpoint-changed-swagger.json @@ -0,0 +1,100 @@ +{ + "swagger": "2.0", + "info": { + "title": "Test API Swagger", + "version": "1.0.0", + "description": "A test API for testing Swagger 2.0 spec comparison" + }, + "host": "api.example.com", + "basePath": "/v1", + "schemes": ["https"], + "securityDefinitions": { + "apiKey": { + "type": "apiKey", + "name": "X-API-Key", + "in": "header" + } + }, + "security": [ + { + "apiKey": [] + } + ], + "paths": { + "/users": { + "get": { + "summary": "Get all users", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "Number of users to return", + "required": false, + "type": "integer", + "default": 10 + } + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/User" + } + }, + "examples": { + "application/json": [ + { + "id": 1, + "name": "John Doe" + } + ] + } + } + } + }, + "post": { + "summary": "Create a new user", + "parameters": [ + { + "name": "user", + "in": "body", + "description": "User object to create", + "required": true, + "schema": { + "$ref": "#/definitions/User" + } + } + ], + "responses": { + "201": { + "description": "User created successfully", + "schema": { + "$ref": "#/definitions/User" + } + } + } + } + } + }, + "definitions": { + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } +} diff --git a/packages/nx-plugin/src/test-specs/parameter-changed-swagger.json b/packages/nx-plugin/src/test-specs/parameter-changed-swagger.json new file mode 100644 index 000000000..fdada3466 --- /dev/null +++ b/packages/nx-plugin/src/test-specs/parameter-changed-swagger.json @@ -0,0 +1,88 @@ +{ + "swagger": "2.0", + "info": { + "title": "Test API Swagger", + "version": "1.0.0", + "description": "A test API for testing Swagger 2.0 spec comparison" + }, + "host": "api.example.com", + "basePath": "/v1", + "schemes": ["https"], + "securityDefinitions": { + "apiKey": { + "type": "apiKey", + "name": "X-API-Key", + "in": "header" + } + }, + "security": [ + { + "apiKey": [] + } + ], + "paths": { + "/users": { + "get": { + "summary": "Get all users", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "Number of users to return", + "required": true, + "type": "integer", + "default": 20, + "minimum": 1, + "maximum": 100 + }, + { + "name": "offset", + "in": "query", + "description": "Number of users to skip", + "required": false, + "type": "integer", + "default": 0 + } + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/User" + } + }, + "examples": { + "application/json": [ + { + "id": 1, + "name": "John Doe" + } + ] + } + } + } + } + } + }, + "definitions": { + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } +} diff --git a/packages/nx-plugin/src/test-specs/path-changed-swagger.json b/packages/nx-plugin/src/test-specs/path-changed-swagger.json new file mode 100644 index 000000000..441498d6b --- /dev/null +++ b/packages/nx-plugin/src/test-specs/path-changed-swagger.json @@ -0,0 +1,78 @@ +{ + "swagger": "2.0", + "info": { + "title": "Test API Swagger", + "version": "1.0.0", + "description": "A test API for testing Swagger 2.0 spec comparison" + }, + "host": "api.example.com", + "basePath": "/v1", + "schemes": ["https"], + "securityDefinitions": { + "apiKey": { + "type": "apiKey", + "name": "X-API-Key", + "in": "header" + } + }, + "security": [ + { + "apiKey": [] + } + ], + "paths": { + "/users2": { + "get": { + "summary": "Get all users", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "Number of users to return", + "required": false, + "type": "integer", + "default": 10 + } + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/User" + } + }, + "examples": { + "application/json": [ + { + "id": 1, + "name": "John Doe" + } + ] + } + } + } + } + } + }, + "definitions": { + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } +} diff --git a/packages/nx-plugin/src/test-specs/schema-changed-3.1.json b/packages/nx-plugin/src/test-specs/schema-changed-3.1.json new file mode 100644 index 000000000..3457b3cbb --- /dev/null +++ b/packages/nx-plugin/src/test-specs/schema-changed-3.1.json @@ -0,0 +1,111 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Test API 3.1", + "version": "1.0.0", + "description": "A test API for testing OpenAPI 3.1 spec comparison" + }, + "servers": [ + { + "url": "https://api.example.com/v1", + "description": "Production server" + } + ], + "security": [ + { + "apiKey": [] + } + ], + "paths": { + "/users": { + "get": { + "summary": "Get all users", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "Number of users to return", + "required": false, + "schema": { + "type": "integer", + "default": 10 + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + }, + "example": [ + { + "id": 1, + "name": "John Doe" + } + ] + } + } + } + } + } + } + }, + "webhooks": { + "newUser": { + "post": { + "summary": "New user webhook", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "responses": { + "200": { + "description": "Webhook processed successfully" + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "tags": { + "type": "array", + "prefixItems": [ + { "type": "string", "pattern": "^[A-Za-z]+$" }, + { "type": "number", "minimum": 0 } + ], + "items": { "type": "string" }, + "minItems": 2 + } + } + } + }, + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "name": "X-API-Key", + "in": "header" + } + } + } +} diff --git a/packages/nx-plugin/src/test-specs/summary-changed-swagger.json b/packages/nx-plugin/src/test-specs/summary-changed-swagger.json new file mode 100644 index 000000000..033133b0f --- /dev/null +++ b/packages/nx-plugin/src/test-specs/summary-changed-swagger.json @@ -0,0 +1,78 @@ +{ + "swagger": "2.0", + "info": { + "title": "Test API Swagger", + "version": "1.0.0", + "description": "A test API for testing Swagger 2.0 spec comparison" + }, + "host": "api.example.com", + "basePath": "/v1", + "schemes": ["https"], + "securityDefinitions": { + "apiKey": { + "type": "apiKey", + "name": "X-API-Key", + "in": "header" + } + }, + "security": [ + { + "apiKey": [] + } + ], + "paths": { + "/users": { + "get": { + "summary": "Get all users with pagination", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "Number of users to return", + "required": false, + "type": "integer", + "default": 10 + } + ], + "responses": { + "200": { + "description": "Successful response with user list", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/User" + } + }, + "examples": { + "application/json": [ + { + "id": 1, + "name": "John Doe" + } + ] + } + } + } + } + } + }, + "definitions": { + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } +} diff --git a/packages/nx-plugin/src/test-specs/webhook-changed-3.1.json b/packages/nx-plugin/src/test-specs/webhook-changed-3.1.json new file mode 100644 index 000000000..35ef0378f --- /dev/null +++ b/packages/nx-plugin/src/test-specs/webhook-changed-3.1.json @@ -0,0 +1,107 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Test API 3.1", + "version": "1.0.0", + "description": "A test API for testing OpenAPI 3.1 spec comparison" + }, + "servers": [ + { + "url": "https://api.example.com/v1", + "description": "Production server" + } + ], + "security": [ + { + "apiKey": [] + } + ], + "paths": { + "/users": { + "get": { + "summary": "Get all users", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "Number of users to return", + "required": false, + "schema": { + "type": "integer", + "default": 10 + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + }, + "example": [ + { + "id": 1, + "name": "John Doe" + } + ] + } + } + } + } + } + } + }, + "webhooks": { + "newUser": { + "post": { + "summary": "New user webhook with changes", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "responses": { + "200": { + "description": "Webhook processed successfully with changes" + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "tags": { + "type": "array", + "prefixItems": [{ "type": "string" }, { "type": "number" }], + "items": { "type": "string" } + } + } + } + }, + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "name": "X-API-Key", + "in": "header" + } + } + } +} diff --git a/packages/nx-plugin/src/utils.compare-spec.spec.ts b/packages/nx-plugin/src/utils.compare-spec.spec.ts index da8702fb2..ccf06df42 100644 --- a/packages/nx-plugin/src/utils.compare-spec.spec.ts +++ b/packages/nx-plugin/src/utils.compare-spec.spec.ts @@ -103,4 +103,104 @@ describe('compareSpecs', () => { expect(areEqual).toBe(true); }); }); + + describe('OpenAPI 3.1 Specific Changes', () => { + it('should detect no changes between identical 3.1 specs', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base-3.1.json'), + resolve(__dirname, './test-specs/base-3.1.json'), + ); + expect(areEqual).toBe(true); + }); + + it('should detect webhook changes in 3.1 specs', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base-3.1.json'), + resolve(__dirname, './test-specs/webhook-changed-3.1.json'), + ); + expect(areEqual).toBe(false); + }); + + it('should detect schema changes using 3.1 features', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base-3.1.json'), + resolve(__dirname, './test-specs/schema-changed-3.1.json'), + ); + expect(areEqual).toBe(false); + }); + + it('should detect version changes between 3.0 and 3.1', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base.json'), + resolve(__dirname, './test-specs/base-3.1.json'), + ); + expect(areEqual).toBe(false); + }); + }); + + describe('Swagger 2.0 Specific Changes', () => { + it('should detect no changes between identical Swagger 2.0 specs', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base-swagger.json'), + resolve(__dirname, './test-specs/base-swagger.json'), + ); + expect(areEqual).toBe(true); + }); + + it('should detect path changes in Swagger 2.0 specs', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base-swagger.json'), + resolve(__dirname, './test-specs/path-changed-swagger.json'), + ); + expect(areEqual).toBe(false); + }); + + it('should detect parameter changes in Swagger 2.0 specs', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base-swagger.json'), + resolve(__dirname, './test-specs/parameter-changed-swagger.json'), + ); + expect(areEqual).toBe(false); + }); + + it('should detect endpoint changes in Swagger 2.0 specs', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base-swagger.json'), + resolve(__dirname, './test-specs/endpoint-changed-swagger.json'), + ); + expect(areEqual).toBe(false); + }); + + it('should detect summary changes in Swagger 2.0 specs', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base-swagger.json'), + resolve(__dirname, './test-specs/summary-changed-swagger.json'), + ); + expect(areEqual).toBe(false); + }); + + it('should detect definition changes in Swagger 2.0 specs', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base-swagger.json'), + resolve(__dirname, './test-specs/definition-changed-swagger.json'), + ); + expect(areEqual).toBe(false); + }); + + it('should detect version changes between Swagger 2.0 and OpenAPI 3.0', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base-swagger.json'), + resolve(__dirname, './test-specs/base.json'), + ); + expect(areEqual).toBe(false); + }); + + it('should detect version changes between Swagger 2.0 and OpenAPI 3.1', async () => { + const areEqual = await compareSpecs( + resolve(__dirname, './test-specs/base-swagger.json'), + resolve(__dirname, './test-specs/base-3.1.json'), + ); + expect(areEqual).toBe(false); + }); + }); }); diff --git a/packages/nx-plugin/src/utils.spec.ts b/packages/nx-plugin/src/utils.spec.ts index 9c0cf4be9..79915073e 100644 --- a/packages/nx-plugin/src/utils.spec.ts +++ b/packages/nx-plugin/src/utils.spec.ts @@ -13,9 +13,12 @@ import { generateClientCommand, getBaseTsConfigPath, getPackageName, + getSpecFileVersion, getVersionOfPackage, isAFile, isUrl, + removeExamples, + standardizeSpec, } from './utils'; vi.mock('node:fs', () => ({ @@ -428,4 +431,262 @@ paths: ).rejects.toThrow('Failed to find base tsconfig file'); }); }); + + describe('removeExamples', () => { + it('should remove examples from root level', () => { + const schema = { + example: 'single example', + examples: ['example1', 'example2'], + otherProperty: 'value', + }; + + const result = removeExamples(schema); + expect(result).toEqual({ + otherProperty: 'value', + }); + }); + + it('should remove examples from nested objects', () => { + const schema = { + properties: { + age: { + example: 25, + type: 'number' as const, + }, + name: { + examples: ['John', 'Jane'], + type: 'string' as const, + }, + }, + }; + + const result = removeExamples(schema); + expect(result).toEqual({ + properties: { + age: { + type: 'number', + }, + name: { + type: 'string', + }, + }, + }); + }); + + it('should remove examples from arrays of objects', () => { + const schema = { + items: [ + { + examples: ['item1', 'item2'], + type: 'string' as const, + }, + { + example: 42, + type: 'number' as const, + }, + ], + }; + + const result = removeExamples(schema); + expect(result).toEqual({ + items: [ + { + type: 'string', + }, + { + type: 'number', + }, + ], + }); + }); + + it('should handle empty objects', () => { + const schema = {}; + const result = removeExamples(schema); + expect(result).toEqual({}); + }); + + it('should handle null values', () => { + const schema = { + examples: null, + property: null, + }; + + const result = removeExamples(schema); + expect(result).toEqual({ + property: null, + }); + }); + + it('should preserve other properties', () => { + const schema = { + properties: { + name: { + description: 'User name', + type: 'string' as const, + }, + }, + required: ['name'], + type: 'object' as const, + }; + + const result = removeExamples(schema); + expect(result).toEqual(schema); + }); + }); + + describe('standardizeSpec', () => { + it('should return OpenAPI 3.0 spec unchanged', async () => { + const spec = { + info: { + title: 'Test API', + version: '1.0.0', + }, + openapi: '3.0.0', + paths: {}, + }; + + const result = await standardizeSpec(spec); + expect(result).toEqual(spec); + }); + + it('should convert Swagger 2.0 spec to OpenAPI 3.0', async () => { + const swaggerSpec = { + info: { + title: 'Test API', + version: '1.0.0', + }, + paths: { + '/test': { + get: { + summary: 'Test endpoint', + }, + }, + }, + swagger: '2.0', + }; + + const convertedSpec = { + info: { + title: 'Test API', + version: '1.0.0', + }, + openapi: '3.0.0', + paths: { + '/test': { + get: { + responses: { + default: { + description: 'Default response', + }, + }, + summary: 'Test endpoint', + }, + }, + }, + }; + + const result = await standardizeSpec(swaggerSpec); + expect(result).toEqual(convertedSpec); + }); + + it('should handle OpenAPI 3.1 spec', async () => { + const spec = { + info: { + title: 'Test API', + version: '1.0.0', + }, + openapi: '3.1.0', + paths: {}, + }; + + const result = await standardizeSpec(spec); + expect(result).toEqual(spec); + }); + + it('should throw error for invalid spec version', async () => { + const spec = { + // Invalid: not a string + info: { + title: 'Test API', + version: '1.0.0', + }, + openapi: 3.0, + paths: {}, + }; + + await expect(standardizeSpec(spec)).rejects.toThrow( + 'Spec file openapi version is not a string', + ); + }); + }); + + describe('getSpecFileVersion', () => { + it('should return OpenAPI version when present', () => { + const spec = { + info: { + title: 'Test API', + version: '1.0.0', + }, + openapi: '3.0.0', + }; + + const version = getSpecFileVersion(spec); + expect(version).toBe('3.0.0'); + }); + + it('should return Swagger version when present', () => { + const spec = { + info: { + title: 'Test API', + version: '1.0.0', + }, + swagger: '2.0', + }; + + const version = getSpecFileVersion(spec); + expect(version).toBe('2.0'); + }); + + it('should throw error when OpenAPI version is not a string', () => { + const spec = { + info: { + title: 'Test API', + version: '1.0.0', + }, + openapi: 3.0, + }; + + expect(() => getSpecFileVersion(spec)).toThrow( + 'Spec file openapi version is not a string', + ); + }); + + it('should throw error when Swagger version is not a string', () => { + const spec = { + info: { + title: 'Test API', + version: '1.0.0', + }, + swagger: 2.0, + }; + + expect(() => getSpecFileVersion(spec)).toThrow( + 'Spec file swagger version is not a string', + ); + }); + + it('should throw error when neither OpenAPI nor Swagger version is present', () => { + const spec = { + info: { + title: 'Test API', + version: '1.0.0', + }, + }; + + expect(() => getSpecFileVersion(spec)).toThrow( + 'Spec file does not contain an openapi or swagger version', + ); + }); + }); }); diff --git a/packages/nx-plugin/src/utils.ts b/packages/nx-plugin/src/utils.ts index 2f4cb869f..4e2f4b3b2 100644 --- a/packages/nx-plugin/src/utils.ts +++ b/packages/nx-plugin/src/utils.ts @@ -12,6 +12,7 @@ import { import { logger, workspaceRoot } from '@nx/devkit'; import { compareOpenApi } from 'api-smart-diff'; import { format, type Options as PrettierOptions } from 'prettier'; +import { convert } from 'swagger2openapi'; import { CONSTANTS } from './vars'; @@ -208,6 +209,58 @@ export async function getSpecFiles( }; } +export function getSpecFileVersion(spec: JSONSchema) { + if ('openapi' in spec) { + if (typeof spec.openapi === 'string') { + return spec.openapi; + } + throw new Error('Spec file openapi version is not a string'); + } + if ('swagger' in spec) { + if (typeof spec.swagger === 'string') { + return spec.swagger; + } + throw new Error('Spec file swagger version is not a string'); + } + throw new Error('Spec file does not contain an openapi or swagger version'); +} + +export async function convertSwaggerToOpenApi(spec: JSONSchema) { + const openapi = await convert(spec as any, { + resolve: false, + }); + return openapi.openapi as JSONSchema; +} + +/** + * Upgrades the spec file to at least OpenAPI 3.0 + */ +export async function standardizeSpec(spec: JSONSchema) { + const version = getSpecFileVersion(spec); + if (version.startsWith('2.')) { + return await convertSwaggerToOpenApi(spec); + } + return spec; +} + +/** + * Removes examples from the spec file + * + * This is done to avoid false positives when comparing specs + * We do not want to compare examples as they are not part of the spec, and do not affect code generation + */ +export function removeExamples(spec: JSONSchema) { + for (const key in spec) { + const typedKey = key as keyof JSONSchema; + if (typedKey === 'examples' || key === 'example') { + delete spec[typedKey]; + } else if (typeof spec[typedKey] === 'object' && spec[typedKey] !== null) { + removeExamples(spec[typedKey]); + } + } + return spec; +} + /** * Fetches two spec files and compares them for differences */ @@ -220,9 +273,21 @@ export async function compareSpecs( newSpecPath, ); + const existingSpecWithoutExamples = removeExamples(existingSpec); + const newSpecWithoutExamples = removeExamples(newSpec); + + const [standardizedExistingSpec, standardizedNewSpec] = await Promise.all([ + standardizeSpec(existingSpecWithoutExamples), + standardizeSpec(newSpecWithoutExamples), + ]); + logger.debug('Comparing specs...'); + // Compare specs - const { diffs } = compareOpenApi(existingSpec, newSpec); + const { diffs } = compareOpenApi( + standardizedExistingSpec, + standardizedNewSpec, + ); const filteredDiffs = diffs.filter((diff) => { if (diff.path.includes('examples') || diff.path.includes('example')) { return false; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bd1ae1826..c86e0ec19 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -807,6 +807,9 @@ importers: latest-version: specifier: 9.0.0 version: 9.0.0 + swagger2openapi: + specifier: ^7.0.8 + version: 7.0.8(encoding@0.1.13) tslib: specifier: 2.8.1 version: 2.8.1 @@ -817,6 +820,9 @@ importers: '@config/vite-base': specifier: workspace:* version: link:../config-vite-base + '@types/swagger2openapi': + specifier: ^7.0.4 + version: 7.0.4 typescript: specifier: 5.8.3 version: 5.8.3 @@ -2822,6 +2828,9 @@ packages: resolution: {integrity: sha512-ZAoA40rNMPwSm+AeHpCq8STiNAwzWLJuP8Xv4CHIc9wv/PSuExjMrmjfYNj682vW0OOiZ1HKxzvjQr9XZIisQA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@exodus/schemasafe@1.3.0': + resolution: {integrity: sha512-5Aap/GaRupgNx/feGBwLLTVv8OQFfv3pq2lPRzPg9R+IOBnDgghTGW7l7EuVXOvg5cc/xSAlRW8rBrjIC3Nvqw==} + '@fastify/ajv-compiler@4.0.2': resolution: {integrity: sha512-Rkiu/8wIjpsf46Rr+Fitd3HRP+VsxUFDDeag0hs9L0ksfnwx2g7SPQQTFL0E8Qv+rfXzQOxBJnjUB9ITUDjfWQ==} @@ -5229,6 +5238,9 @@ packages: '@types/sockjs@0.3.36': resolution: {integrity: sha512-MK9V6NzAS1+Ud7JV9lJLFqW85VbC9dq3LmwZCuBe4wBDgKC0Kj/jd8Xl+nSviU+Qc3+m7umHHyHg//2KSa0a0Q==} + '@types/swagger2openapi@7.0.4': + resolution: {integrity: sha512-ffMqzciTDihOKH4Q//9Ond1yb5JP1P5FC/aFPsLK4blea1Fwk2aYctiNCkAh5etDYFswFXS+5LV/vuGkf+PU6A==} + '@types/tough-cookie@4.0.5': resolution: {integrity: sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==} @@ -6294,6 +6306,9 @@ packages: resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} engines: {node: '>= 0.4'} + call-me-maybe@1.0.2: + resolution: {integrity: sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==} + callsite@1.0.0: resolution: {integrity: sha512-0vdNRFXn5q+dtOqjfFtmtlI9N2eVZ7LMyEV2iKC5mEEFvSg/69Ml6b/WU2qF8W1nLRa0wiSrDT3Y5jOHZCwKPQ==} @@ -7238,6 +7253,9 @@ packages: resolution: {integrity: sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==} engines: {node: '>= 0.4'} + es6-promise@3.3.1: + resolution: {integrity: sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg==} + esbuild-wasm@0.25.0: resolution: {integrity: sha512-60iuWr6jdTVylmGXjpnqk3pCktUi5Rmjiv6EMza3h4X20BLtfL2BjUGs1+UCt2G9UK7jVGrJdUr5i1k0sL3wBg==} engines: {node: '>=18'} @@ -7628,6 +7646,9 @@ packages: resolution: {integrity: sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==} engines: {node: '>=6'} + fast-safe-stringify@2.1.1: + resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} + fast-uri@3.0.6: resolution: {integrity: sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==} @@ -8126,6 +8147,9 @@ packages: resolution: {integrity: sha512-S9wWkJ/VSY9/k4qcjG318bqJNruzE4HySUhFYknwmu6LBP97KLLfwNf+n4V1BHurvFNkSKLFnK/RsuUnRTf9Vw==} engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} + http2-client@1.3.5: + resolution: {integrity: sha512-EC2utToWl4RKfs5zd36Mxq7nzHHBuomZboI0yYL6Y0RmBgT7Sgkq4rQ0ezFTYoIsSs7Tm9SJe+o2FcAg6GBhGA==} + https-proxy-agent@5.0.1: resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} engines: {node: '>= 6'} @@ -9413,6 +9437,10 @@ packages: resolution: {integrity: sha512-Z3lTE9pLaJF47NyMhd4ww1yFTAP8YhYI8SleJiHzM46Fgpm5cnNzSl9XfzFNqbaz+VlJrIj3fXQ4DeN1Rjm6cw==} engines: {node: '>=18'} + node-fetch-h2@2.3.0: + resolution: {integrity: sha512-ofRW94Ab0T4AOh5Fk8t0h8OBWrmjb0SSB20xh1H8YnPV9EJ+f5AMoYSUQ2zgJ4Iq2HAK0I2l5/Nequ8YzFS3Hg==} + engines: {node: 4.x || >=6.0.0} + node-fetch-native@1.6.6: resolution: {integrity: sha512-8Mc2HhqPdlIfedsuZoc3yioPuzp6b+L5jRCRY1QzuWZh2EGJVQrGppC6V6cF0bLdbW0+O2YpqCA25aF/1lvipQ==} @@ -9452,6 +9480,9 @@ packages: node-mock-http@1.0.0: resolution: {integrity: sha512-0uGYQ1WQL1M5kKvGRXWQ3uZCHtLTO8hln3oBjIusM75WoesZ909uQJs/Hb946i2SS+Gsrhkaa6iAO17jRIv6DQ==} + node-readfiles@0.2.0: + resolution: {integrity: sha512-SU00ZarexNlE4Rjdm83vglt5Y9yiQ+XI1XpflWlb7q7UTN1JUItm69xMeiQCTxtTfnzt+83T8Cx+vI2ED++VDA==} + node-releases@2.0.19: resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} @@ -9600,6 +9631,22 @@ packages: engines: {node: ^14.16.0 || >=16.10.0} hasBin: true + oas-kit-common@1.0.8: + resolution: {integrity: sha512-pJTS2+T0oGIwgjGpw7sIRU8RQMcUoKCDWFLdBqKB2BNmGpbBMH2sdqAaOXUg8OzonZHU0L7vfJu1mJFEiYDWOQ==} + + oas-linter@3.2.2: + resolution: {integrity: sha512-KEGjPDVoU5K6swgo9hJVA/qYGlwfbFx+Kg2QB/kd7rzV5N8N5Mg6PlsoCMohVnQmo+pzJap/F610qTodKzecGQ==} + + oas-resolver@2.5.6: + resolution: {integrity: sha512-Yx5PWQNZomfEhPPOphFbZKi9W93CocQj18NlD2Pa4GWZzdZpSJvYwoiuurRI7m3SpcChrnO08hkuQDL3FGsVFQ==} + hasBin: true + + oas-schema-walker@1.1.5: + resolution: {integrity: sha512-2yucenq1a9YPmeNExoUa9Qwrt9RFkjqaMAA1X+U7sbb0AqBeTIdMHky9SQQ6iN94bO5NW0W4TRYXerG+BdAvAQ==} + + oas-validator@5.0.8: + resolution: {integrity: sha512-cu20/HE5N5HKqVygs3dt94eYJfBi0TsZvPVXDhbXQHiEityDN+RROTleefoKRKKJ9dFAF2JBkDHgvWj0sjKGmw==} + object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -9697,6 +9744,9 @@ packages: resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==} engines: {node: '>=12'} + openapi-types@12.1.3: + resolution: {integrity: sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==} + optionator@0.9.4: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} @@ -10574,6 +10624,9 @@ packages: resolution: {integrity: sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==} engines: {node: '>= 0.4'} + reftools@1.1.9: + resolution: {integrity: sha512-OVede/NQE13xBQ+ob5CKd5KyeJYU2YInb1bmV4nRoOfquZPkAkxuOXicSe1PvqIuZZ4kD13sPKBbR7UFDmli6w==} + regenerate-unicode-properties@10.2.0: resolution: {integrity: sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA==} engines: {node: '>=4'} @@ -10962,6 +11015,24 @@ packages: shiki@1.29.2: resolution: {integrity: sha512-njXuliz/cP+67jU2hukkxCNuH1yUi4QfdZZY+sMr5PPrIyXSu5iTb/qYC4BiWWB0vZ+7TbdvYUCeL23zpwCfbg==} + should-equal@2.0.0: + resolution: {integrity: sha512-ZP36TMrK9euEuWQYBig9W55WPC7uo37qzAEmbjHz4gfyuXrEUgF8cUvQVO+w+d3OMfPvSRQJ22lSm8MQJ43LTA==} + + should-format@3.0.3: + resolution: {integrity: sha512-hZ58adtulAk0gKtua7QxevgUaXTTXxIi8t41L3zo9AHvjXO1/7sdLECuHeIN2SRtYXpNkmhoUP2pdeWgricQ+Q==} + + should-type-adaptors@1.1.0: + resolution: {integrity: sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA==} + + should-type@1.4.0: + resolution: {integrity: sha512-MdAsTu3n25yDbIe1NeN69G4n6mUnJGtSJHygX3+oN0ZbO3DTiATnf7XnYJdGT42JCXurTb1JI0qOBR65shvhPQ==} + + should-util@1.0.1: + resolution: {integrity: sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g==} + + should@13.2.3: + resolution: {integrity: sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ==} + side-channel-list@1.0.0: resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==} engines: {node: '>= 0.4'} @@ -11325,6 +11396,10 @@ packages: engines: {node: '>=14.0.0'} hasBin: true + swagger2openapi@7.0.8: + resolution: {integrity: sha512-upi/0ZGkYgEcLeGieoz8gT74oWHA0E7JivX7aN9mAf+Tc7BQoRBvnIGHoPDw+f9TXTW4s6kGYCZJtauP6OYp7g==} + hasBin: true + symbol-observable@4.0.0: resolution: {integrity: sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==} engines: {node: '>=0.10'} @@ -14611,6 +14686,8 @@ snapshots: '@eslint/core': 0.13.0 levn: 0.4.1 + '@exodus/schemasafe@1.3.0': {} + '@fastify/ajv-compiler@4.0.2': dependencies: ajv: 8.17.1 @@ -17366,6 +17443,11 @@ snapshots: dependencies: '@types/node': 22.10.5 + '@types/swagger2openapi@7.0.4': + dependencies: + '@types/node': 22.10.5 + openapi-types: 12.1.3 + '@types/tough-cookie@4.0.5': {} '@types/triple-beam@1.3.5': {} @@ -18753,6 +18835,8 @@ snapshots: call-bind-apply-helpers: 1.0.2 get-intrinsic: 1.3.0 + call-me-maybe@1.0.2: {} + callsite@1.0.0: {} callsites@3.1.0: {} @@ -19696,6 +19780,8 @@ snapshots: is-date-object: 1.1.0 is-symbol: 1.1.1 + es6-promise@3.3.1: {} + esbuild-wasm@0.25.0: {} esbuild@0.19.12: @@ -20374,6 +20460,8 @@ snapshots: fast-redact@3.5.0: {} + fast-safe-stringify@2.1.1: {} + fast-uri@3.0.6: {} fastify-openapi-glue@4.8.0: @@ -20983,6 +21071,8 @@ snapshots: http-shutdown@1.2.2: {} + http2-client@1.3.5: {} + https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 @@ -22389,6 +22479,10 @@ snapshots: emojilib: 2.4.0 skin-tone: 2.0.0 + node-fetch-h2@2.3.0: + dependencies: + http2-client: 1.3.5 + node-fetch-native@1.6.6: {} node-fetch@2.7.0(encoding@0.1.13): @@ -22431,6 +22525,10 @@ snapshots: node-mock-http@1.0.0: {} + node-readfiles@0.2.0: + dependencies: + es6-promise: 3.3.1 + node-releases@2.0.19: {} node-source-walk@6.0.2: @@ -22870,6 +22968,37 @@ snapshots: pkg-types: 2.1.0 tinyexec: 0.3.2 + oas-kit-common@1.0.8: + dependencies: + fast-safe-stringify: 2.1.1 + + oas-linter@3.2.2: + dependencies: + '@exodus/schemasafe': 1.3.0 + should: 13.2.3 + yaml: 1.10.2 + + oas-resolver@2.5.6: + dependencies: + node-fetch-h2: 2.3.0 + oas-kit-common: 1.0.8 + reftools: 1.1.9 + yaml: 1.10.2 + yargs: 17.7.2 + + oas-schema-walker@1.1.5: {} + + oas-validator@5.0.8: + dependencies: + call-me-maybe: 1.0.2 + oas-kit-common: 1.0.8 + oas-linter: 3.2.2 + oas-resolver: 2.5.6 + oas-schema-walker: 1.1.5 + reftools: 1.1.9 + should: 13.2.3 + yaml: 1.10.2 + object-assign@4.1.1: {} object-hash@3.0.0: {} @@ -22984,6 +23113,8 @@ snapshots: is-docker: 2.2.1 is-wsl: 2.2.0 + openapi-types@12.1.3: {} + optionator@0.9.4: dependencies: deep-is: 0.1.4 @@ -23891,6 +24022,8 @@ snapshots: get-proto: 1.0.1 which-builtin-type: 1.2.1 + reftools@1.1.9: {} + regenerate-unicode-properties@10.2.0: dependencies: regenerate: 1.4.2 @@ -24393,6 +24526,32 @@ snapshots: '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.4 + should-equal@2.0.0: + dependencies: + should-type: 1.4.0 + + should-format@3.0.3: + dependencies: + should-type: 1.4.0 + should-type-adaptors: 1.1.0 + + should-type-adaptors@1.1.0: + dependencies: + should-type: 1.4.0 + should-util: 1.0.1 + + should-type@1.4.0: {} + + should-util@1.0.1: {} + + should@13.2.3: + dependencies: + should-equal: 2.0.0 + should-format: 3.0.3 + should-type: 1.4.0 + should-type-adaptors: 1.1.0 + should-util: 1.0.1 + side-channel-list@1.0.0: dependencies: es-errors: 1.3.0 @@ -24852,6 +25011,22 @@ snapshots: csso: 5.0.5 picocolors: 1.1.1 + swagger2openapi@7.0.8(encoding@0.1.13): + dependencies: + call-me-maybe: 1.0.2 + node-fetch: 2.7.0(encoding@0.1.13) + node-fetch-h2: 2.3.0 + node-readfiles: 0.2.0 + oas-kit-common: 1.0.8 + oas-resolver: 2.5.6 + oas-schema-walker: 1.1.5 + oas-validator: 5.0.8 + reftools: 1.1.9 + yaml: 1.10.2 + yargs: 17.7.2 + transitivePeerDependencies: + - encoding + symbol-observable@4.0.0: {} symbol-tree@3.2.4: {} From 733ff69caa5d83b81cf2cdd48ebf06407e35b99a Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Wed, 14 May 2025 16:55:58 -0400 Subject: [PATCH 18/26] feat(nx-plugin): update to support NX 21 continuous pipelines --- packages/nx-plugin/package.json | 4 +- .../src/executors/update-api/schema.d.ts | 1 + .../update-api/updateApi.schema.json | 5 + .../src/executors/update-api/updateApi.ts | 46 +++- .../src/generators/openapi-client/README.md | 15 +- .../files/openapi-ts.config.ts.template | 6 +- .../files/package.json.template | 4 +- .../files/tsconfig.json.template | 2 +- .../openapi-client/openapiClient.schema.json | 4 + .../openapi-client/openapiClient.spec.ts | 4 + .../openapi-client/openapiClient.ts | 210 ++++++++++++++---- .../plugins/schemas/src/schemas.ts.template | 1 + .../plugins/zod/src/zod.ts.template | 1 + packages/nx-plugin/src/test-utils.ts | 1 + packages/nx-plugin/src/utils.ts | 13 +- pnpm-lock.yaml | 27 +-- 16 files changed, 264 insertions(+), 80 deletions(-) create mode 100644 packages/nx-plugin/src/generators/openapi-client/plugins/schemas/src/schemas.ts.template create mode 100644 packages/nx-plugin/src/generators/openapi-client/plugins/zod/src/zod.ts.template diff --git a/packages/nx-plugin/package.json b/packages/nx-plugin/package.json index 23055828b..a947646b9 100644 --- a/packages/nx-plugin/package.json +++ b/packages/nx-plugin/package.json @@ -48,9 +48,9 @@ "executors": "./executors.json", "generators": "./generators.json", "dependencies": { - "@hey-api/json-schema-ref-parser": "1.0.5", + "@hey-api/json-schema-ref-parser": "1.0.6", "@hey-api/openapi-ts": "workspace:*", - "@nx/devkit": "20.8.1", + "@nx/devkit": "21.0.3", "api-smart-diff": "^1.0.6", "latest-version": "9.0.0", "swagger2openapi": "^7.0.8", diff --git a/packages/nx-plugin/src/executors/update-api/schema.d.ts b/packages/nx-plugin/src/executors/update-api/schema.d.ts index e5d9e8267..8211bc142 100644 --- a/packages/nx-plugin/src/executors/update-api/schema.d.ts +++ b/packages/nx-plugin/src/executors/update-api/schema.d.ts @@ -15,4 +15,5 @@ export interface UpdateApiExecutorSchema { * Temporary folder used to store files, only change for testing */ tempFolder?: string; + watch?: boolean; } diff --git a/packages/nx-plugin/src/executors/update-api/updateApi.schema.json b/packages/nx-plugin/src/executors/update-api/updateApi.schema.json index 11a2b1b01..8e27f6550 100644 --- a/packages/nx-plugin/src/executors/update-api/updateApi.schema.json +++ b/packages/nx-plugin/src/executors/update-api/updateApi.schema.json @@ -55,6 +55,11 @@ "type": "boolean", "description": "If true, the Client code will be regenerated even if the spec has not changed, also pass --skip-nx-cache to avoid caching issues", "default": false + }, + "watch": { + "type": "boolean", + "description": "If true, the client will be watched for changes and regenerated when they occur", + "default": false } }, "required": ["spec", "scope", "name"] diff --git a/packages/nx-plugin/src/executors/update-api/updateApi.ts b/packages/nx-plugin/src/executors/update-api/updateApi.ts index 90eb893ba..324732672 100644 --- a/packages/nx-plugin/src/executors/update-api/updateApi.ts +++ b/packages/nx-plugin/src/executors/update-api/updateApi.ts @@ -1,5 +1,11 @@ import { existsSync, writeFileSync } from 'node:fs'; -import { cp, readFile, rm } from 'node:fs/promises'; +import { + cp, + readFile, + rm, + watch as fileWatch, + writeFile, +} from 'node:fs/promises'; import { join } from 'node:path'; import type { PromiseExecutor } from '@nx/devkit'; @@ -15,6 +21,7 @@ import { compareSpecs, formatFiles, generateClientCode, + isUrl, makeDir, } from '../../utils'; import { CONSTANTS } from '../../vars'; @@ -130,12 +137,41 @@ async function setup({ }; } -const runExecutor: PromiseExecutor = async ( +const handleWatch: PromiseExecutor = async ( options, - // this is added to stop the CI from complaining about not using the context and to stop the linter from complaining + context, +) => { + // Do not watch spec files if they are URLs + const isSpecFileUrl = isUrl(options.spec); + if (isSpecFileUrl) { + logger.error('Spec file is a url.'); + throw new Error('Spec file is a url, not watching.'); + } + + const { watch, ...rest } = options; + if (!watch) { + return { success: false }; + } + logger.info(`Watching spec file ${options.spec} for changes...`); + const watcher = fileWatch(rest.spec); // eslint-disable-next-line @typescript-eslint/no-unused-vars - _context, + for await (const _ of watcher) { + logger.info(`Spec file ${options.spec} has changed, updating...`); + // do not pass the watch flag to the runExecutor as it will cause an infinite loop + await runExecutor(rest, context); + logger.info(`Spec file ${options.spec} updated successfully.`); + } + return { success: true }; +}; + +const runExecutor: PromiseExecutor = async ( + options, + context, ) => { + if (options.watch) { + return handleWatch(options, context); + } + const tempFolder = // use the provided temp folder or use the default temp folder and append the project name to it // we append the project name to the temp folder to avoid conflicts between different projects using the same temp folder @@ -224,7 +260,7 @@ const runExecutor: PromiseExecutor = async ( filepath: absoluteTempSpecPath, }); - writeFileSync(absoluteExistingSpecPath, formattedSpec); + await writeFile(absoluteExistingSpecPath, formattedSpec); logger.debug(`Spec file updated successfully`); } else { logger.error( diff --git a/packages/nx-plugin/src/generators/openapi-client/README.md b/packages/nx-plugin/src/generators/openapi-client/README.md index 81a276774..18ac03dcf 100644 --- a/packages/nx-plugin/src/generators/openapi-client/README.md +++ b/packages/nx-plugin/src/generators/openapi-client/README.md @@ -50,11 +50,6 @@ The generator creates a new library project with the following structure: libs// ├── api/ │ └── spec.yaml # Bundled and dereferenced OpenAPI spec file -├── src/ -│ ├── generated/ # Generated API client code (not committed to git) -| ├── client.spec.ts # Unit test for the client code -│ ├── index.ts # Exports everything from generated/ -| └── rq.ts # Exports tanstack query client code (if @tanstack/react-query is in the plugins array) ├── package.json ├── vitest.config.ts # Vitest configuration (if test is set to 'vitest') ├── README.md @@ -62,7 +57,15 @@ libs// ├── tsconfig.json # root config ├── tsconfig.lib.json # library config ├── tsconfig.spec.json # test config (if test is set to a value other than none) -└── openapi-ts.config.ts # Configuration for @hey-api/openapi-ts +├── openapi-ts.config.ts # Configuration for @hey-api/openapi-ts +└── src/ + ├── generated/ # Generated API client code (not committed to git) + ├── client.spec.ts # Unit test for the client code + ├── index.ts # Exports everything from generated/ + │ # conditional + ├── rq.ts # Exports tanstack query client code (if @tanstack/react-query is in the plugins array) + ├── schemas.ts # Exports json schemas (if @hey-api/schemas is in the plugins array) + └── zod.ts # Exports zod schemas (if zod is in the plugins array) ``` ## Generating the API Client diff --git a/packages/nx-plugin/src/generators/openapi-client/files/openapi-ts.config.ts.template b/packages/nx-plugin/src/generators/openapi-client/files/openapi-ts.config.ts.template index fe4096db9..7ae598d27 100644 --- a/packages/nx-plugin/src/generators/openapi-client/files/openapi-ts.config.ts.template +++ b/packages/nx-plugin/src/generators/openapi-client/files/openapi-ts.config.ts.template @@ -1,12 +1,12 @@ import { defineConfig } from '@hey-api/openapi-ts'; export default defineConfig({ - input: '<%= SPEC_DIR_NAME %>/<%= SPEC_FILE_NAME %>', + input: '<%- SPEC_DIR_NAME %>/<%= SPEC_FILE_NAME %>', output: 'src/<%= GENERATED_DIR_NAME %>', plugins: [ - '<%= clientType %>', + '<%- clientType %>', <% for(let x = 0; x < plugins.length; x++) { %> - '<%= plugins[x] %>', + <%- plugins[x] %>, <% } %> ], }); diff --git a/packages/nx-plugin/src/generators/openapi-client/files/package.json.template b/packages/nx-plugin/src/generators/openapi-client/files/package.json.template index 6c6e0972f..dba6a7795 100644 --- a/packages/nx-plugin/src/generators/openapi-client/files/package.json.template +++ b/packages/nx-plugin/src/generators/openapi-client/files/package.json.template @@ -1,8 +1,8 @@ { - "name": "<%= projectScope %>/<%= projectName %>", + "name": "<%= projectScope %>/<%- projectName %>", "version": "0.1.0", "type": "commonjs", "scripts": { - "update": "nx run <%= projectScope %>/<%= projectName %>:updateApi" + "update": "nx run <%- projectScope %>/<%- projectName %>:updateApi" } } diff --git a/packages/nx-plugin/src/generators/openapi-client/files/tsconfig.json.template b/packages/nx-plugin/src/generators/openapi-client/files/tsconfig.json.template index 5795dfb19..f4b7154d1 100644 --- a/packages/nx-plugin/src/generators/openapi-client/files/tsconfig.json.template +++ b/packages/nx-plugin/src/generators/openapi-client/files/tsconfig.json.template @@ -1,5 +1,5 @@ { - "extends": "<%= pathToTsConfig %>/<%= tsConfigName %>", + "extends": "<%- pathToTsConfig %>/<%- tsConfigName %>", "compilerOptions": { }, "files": [], diff --git a/packages/nx-plugin/src/generators/openapi-client/openapiClient.schema.json b/packages/nx-plugin/src/generators/openapi-client/openapiClient.schema.json index 01378a778..f0f1aea14 100644 --- a/packages/nx-plugin/src/generators/openapi-client/openapiClient.schema.json +++ b/packages/nx-plugin/src/generators/openapi-client/openapiClient.schema.json @@ -74,6 +74,10 @@ "baseTsConfigPath": { "type": "string", "description": "The path to the base tsconfig file that contains the compiler paths used to resolve the imports, use this if the base tsconfig file is not in the workspace root. This can be a file or a directory. If it is a directory and the baseTsConfigName is provided then the baseTsConfigName will be added to the path. If it is a file and the baseTsConfigName is provided then there will be an error." + }, + "serveCmdName": { + "type": "string", + "description": "The command name to use to serve the implicit dependencies, defaults to `serve`. This is used to watch the implicit dependencies for changes." } }, "required": ["name", "spec", "scope"] diff --git a/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts b/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts index b339fce91..a491b17b2 100644 --- a/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts +++ b/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts @@ -81,10 +81,12 @@ describe('openapi-client generator', () => { clientType: '@hey-api/client-fetch', isPrivate: true, plugins: ['@hey-api/typescript', '@hey-api/sdk'], + preformInstall: false, projectDirectory: `${tempDirectory}/test-api-${uuid}`, projectName: 'test-api', projectRoot: `${tempDirectory}/test-api-${uuid}/test-api`, projectScope: '@test-api', + serveCmdName: 'serve', specFile: specPath, tagArray: ['api', 'openapi'], tempFolder: options.tempFolderDir, @@ -112,10 +114,12 @@ describe('openapi-client generator', () => { clientType: '@hey-api/client-fetch', isPrivate: true, plugins: ['@hey-api/typescript', '@hey-api/sdk'], + preformInstall: false, projectDirectory: 'custom-dir', projectName: 'test-api', projectRoot: 'custom-dir/test-api', projectScope: '@test-api', + serveCmdName: 'serve', specFile: specPath, tagArray: ['custom', 'tags'], tempFolder: options.tempFolderDir, diff --git a/packages/nx-plugin/src/generators/openapi-client/openapiClient.ts b/packages/nx-plugin/src/generators/openapi-client/openapiClient.ts index 9e90a2ee8..5cb5ce39b 100644 --- a/packages/nx-plugin/src/generators/openapi-client/openapiClient.ts +++ b/packages/nx-plugin/src/generators/openapi-client/openapiClient.ts @@ -3,7 +3,11 @@ import { rm } from 'node:fs/promises'; import { isAbsolute, join, resolve } from 'node:path'; import { defaultPlugins } from '@hey-api/openapi-ts'; -import type { ProjectConfiguration, Tree } from '@nx/devkit'; +import type { + ProjectConfiguration, + TargetConfiguration, + Tree, +} from '@nx/devkit'; import { addDependenciesToPackageJson, addProjectConfiguration, @@ -65,8 +69,15 @@ const getClientPlugins = ({ projectScope, }: NormalizedOptions & { inputPlugins: Plugin[]; -}): Record => { +}) => { const plugins: Record = { + '@hey-api/schemas': { + additionalEntryPoints: [`{projectRoot}/src/schemas.ts`], + templateFilesPath: './plugins/schemas', + tsConfigCompilerPaths: { + [`${projectScope}/${projectName}/schemas`]: `./${projectRoot}/src/schemas.ts`, + }, + }, '@tanstack/react-query': { additionalEntryPoints: [`{projectRoot}/src/rq.ts`], templateFilesPath: './plugins/rq', @@ -74,6 +85,13 @@ const getClientPlugins = ({ [`${projectScope}/${projectName}/rq`]: `./${projectRoot}/src/rq.ts`, }, }, + zod: { + additionalEntryPoints: [`{projectRoot}/src/zod.ts`], + templateFilesPath: './plugins/zod', + tsConfigCompilerPaths: { + [`${projectScope}/${projectName}/zod`]: `./${projectRoot}/src/zod.ts`, + }, + }, }; // Filter the plugins that are in the inputPlugins array @@ -84,6 +102,7 @@ const getClientPlugins = ({ const keyedPlugin = plugin as keyof typeof plugins; const foundPlugin = plugins[keyedPlugin]; if (!foundPlugin) { + acc[plugin] = {}; return acc; } acc[plugin] = foundPlugin; @@ -157,6 +176,10 @@ export interface OpenApiClientGeneratorSchema { * The plugins to use for the OpenAPI client */ plugins: string[]; + /** + * Whether to perform the install of the dependencies, defaults to `true` + */ + preformInstall?: boolean; /** * Whether to make the generated package private, defaults to `true` */ @@ -165,6 +188,10 @@ export interface OpenApiClientGeneratorSchema { * The scope of the project */ scope: string; + /** + * The command name to use to serve the implicit dependencies, defaults to `serve`. This is used to watch the implicit dependencies for changes. + */ + serveCmdName?: string; /** * The spec file to use for the OpenAPI client */ @@ -199,6 +226,7 @@ export default async function ( clientType, isPrivate, plugins, + preformInstall, projectName, projectRoot, projectScope, @@ -233,6 +261,21 @@ export default async function ( tree, }); + // Update the package.json file + logger.info(`Updating package.json with dependencies`); + const installDeps = await updatePackageJson({ + clientType, + isPrivate, + plugins, + projectRoot, + tree, + }); + + // Install the dependencies for the project as we need to do this before generating the api client code in case any plugins are missing + if (preformInstall) { + await installDeps(); + } + // Generate the api client code logger.info(`Generating API client code using spec file: ${specFile}`); const { specFileLocalLocations } = await generateApi({ @@ -244,16 +287,6 @@ export default async function ( tree, }); - // Update the package.json file - logger.info(`Updating package.json with dependencies`); - await updatePackageJson({ - clientType, - isPrivate, - plugins, - projectRoot, - tree, - }); - // Update the tsconfig.base.json file logger.info(`Updating tsconfig.base.json with project paths`); updateTsConfig({ @@ -282,11 +315,13 @@ export default async function ( ); // Return a function that installs the packages return async () => { - logger.info(`Installing dependencies for ${projectName}`); - const packageManager = detectPackageManager(workspaceRoot); + if (preformInstall) { + logger.info(`Installing dependencies for ${projectName}`); + const packageManager = detectPackageManager(workspaceRoot); - installPackagesTask(tree, true, workspaceRoot, packageManager); - logger.info(`Dependencies installed successfully`); + installPackagesTask(tree, true, workspaceRoot, packageManager); + logger.info(`Dependencies installed successfully`); + } }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); @@ -304,10 +339,12 @@ export interface NormalizedOptions { clientType: string; isPrivate: boolean; plugins: Plugin[]; + preformInstall?: boolean; projectDirectory: string; projectName: string; projectRoot: string; projectScope: string; + serveCmdName: string; specFile: string; tagArray: string[]; tempFolder: string; @@ -317,6 +354,7 @@ export interface NormalizedOptions { export type GeneratedOptions = NormalizedOptions & typeof CONSTANTS & { pathToTsConfig: string; + stringifyPlugin: (plugin: Plugin) => string; tsConfigName: string; }; @@ -354,8 +392,18 @@ export function normalizeOptions( const tempFolder = options.tempFolderDir ?? join(defaultTempFolder, projectName); const [default1, default2, ...rest] = defaultPlugins; + const mappedProvidedPlugins = options.plugins.map((plugin) => { + if (plugin === '@hey-api/schemas') { + return { + name: plugin, + type: 'json', + } as const; + } + return plugin; + }); const plugins = [ default1, + // TODO: asClass is not working options.asClass ? { asClass: true, @@ -363,7 +411,7 @@ export function normalizeOptions( } : default2, ...rest, - ...options.plugins, + ...mappedProvidedPlugins, ]; return { @@ -372,10 +420,12 @@ export function normalizeOptions( clientType: options.client, isPrivate: options.private ?? true, plugins, + preformInstall: options.preformInstall ?? true, projectDirectory, projectName, projectRoot, projectScope: options.scope, + serveCmdName: options.serveCmdName ?? 'serve', specFile: options.spec, tagArray, tempFolder, @@ -387,14 +437,17 @@ export function normalizeOptions( * Builds the spec path */ export function buildSpecPath(specPath: string) { + // if the spec path is a url then we can just return it const isSpecFileUrl = isUrl(specPath); if (isSpecFileUrl) { return specPath; } + // if the spec path is an absolute path then we can just return it const isSpecFileAbsolutePath = isAbsolute(specPath); if (isSpecFileAbsolutePath) { return specPath; } + // if the spec path is a relative path then we convert it one in the workspace const newSpecPath = specPath.replace('./', `{workspaceRoot}/`); return newSpecPath; } @@ -440,6 +493,7 @@ export async function generateNxProject({ projectName, projectRoot, projectScope, + serveCmdName, specFile, tagArray, test, @@ -452,7 +506,7 @@ export async function generateNxProject({ for (const plugin of plugins) { const clientPlugin = clientPlugins[getPluginName(plugin)]; - if (clientPlugin) { + if (clientPlugin && typeof clientPlugin !== 'boolean') { additionalEntryPoints.push(...(clientPlugin.additionalEntryPoints ?? [])); } } @@ -504,6 +558,25 @@ export async function generateNxProject({ projectRoot, }); + // TODO: we should check if the serveCmdName is a valid command in the `dependsOnProject`; user feedback could be better + const serve = dependsOnProject + ? ({ + cache: false, + continuous: true, + dependsOn: [{ projects: [dependsOnProject], target: serveCmdName }], + executor: `${packageJson.name}:update-api`, + inputs: updateInputs, + options: { + ...buildUpdateOptions(normalizedOptions), + watch: true, + }, + outputs: [ + `{projectRoot}/src/${CONSTANTS.GENERATED_DIR_NAME}`, + `{projectRoot}/${CONSTANTS.SPEC_DIR_NAME}`, + ], + } satisfies TargetConfiguration) + : undefined; + // Create basic project structure addProjectConfiguration(tree, `${projectScope}/${projectName}`, { implicitDependencies: dependsOnProject ? [dependsOnProject] : [], @@ -561,9 +634,30 @@ export async function generateNxProject({ `{projectRoot}/${CONSTANTS.SPEC_DIR_NAME}`, ], }, + ...(serve ? { serve } : {}), }, }); + const stringifyPlugin = (plugin: unknown): string => { + if (typeof plugin === 'string') { + return `'${plugin}'`; + } + if (typeof plugin === 'object' && plugin !== null) { + const entries = Object.entries(plugin); + return `{ + ${entries + .map(([key, value]) => { + if (typeof value === 'object') { + return `${key}: ${stringifyPlugin(value)}`; + } + return `${key}: ${typeof value === 'string' ? `'${value}'` : value}`; + }) + .join(',\n ')} + }`; + } + return String(plugin); + }; + /** * The variables that are passed to the template files */ @@ -571,7 +665,8 @@ export async function generateNxProject({ ...normalizedOptions, ...CONSTANTS, pathToTsConfig: tsConfigDirectory, - plugins: plugins.map(getPluginName), + plugins: plugins.map((plugin) => JSON.stringify(plugin)), + stringifyPlugin, tsConfigName, }; @@ -580,10 +675,12 @@ export async function generateNxProject({ generateFiles(tree, templatePath, projectRoot, generatedOptions); for (const plugin of plugins) { - const pluginConfiguration = clientPlugins[getPluginName(plugin)]; + const name = getPluginName(plugin); + const pluginConfiguration = clientPlugins[name]; if (pluginConfiguration) { handlePlugin({ generatedOptions, + name, pluginConfiguration, projectRoot, tree, @@ -607,15 +704,18 @@ export async function generateNxProject({ function handlePlugin({ generatedOptions, + name, pluginConfiguration, projectRoot, tree, }: { generatedOptions: GeneratedOptions; + name: string; pluginConfiguration: ClientPluginOptions; projectRoot: string; tree: Tree; }) { + logger.debug(`Handling plugin: ${name}`); if (pluginConfiguration.templateFilesPath) { const pluginTemplatePath = join( __dirname, @@ -801,6 +901,8 @@ export async function updatePackageJson({ const clientDetails = getPackageDetails(clientType); // add the openapi-ts as a dependency const openApiTsDetails = getPackageDetails('@hey-api/openapi-ts'); + + const nonPackagePlugins = ['@hey-api/schemas']; // add the plugins as dependencies const pluginDetails = plugins // filter out the default plugins as they are not packages @@ -810,6 +912,8 @@ export async function updatePackageJson({ getPluginName(plugin), ), ) + // also filter out non-package plugins + .filter((plugin) => !nonPackagePlugins.includes(getPluginName(plugin))) .map((plugin) => getPackageDetails(getPluginName(plugin))); const results = await Promise.all([ @@ -832,21 +936,29 @@ export async function updatePackageJson({ deps['axios'] = `^${axiosVersion}`; } - addDependenciesToPackageJson( - tree, - deps, - {}, - join(projectRoot, 'package.json'), + const tasks: (() => Promise | void)[] = []; + + tasks.push( + addDependenciesToPackageJson( + tree, + deps, + {}, + join(projectRoot, 'package.json'), + ), ); if (!isWorkspacesEnabled(detectPackageManager(workspaceRoot))) { if (tree.exists(join(workspaceRoot, 'package.json'))) { // if workspaces are not enabled then we need to install the dependencies to the root - addDependenciesToPackageJson( - tree, - deps, - {}, - join(workspaceRoot, 'package.json'), + // we need to remove the previous task as we are adding the dependencies to the root package.json + tasks.pop(); + tasks.push( + addDependenciesToPackageJson( + tree, + deps, + {}, + join(workspaceRoot, 'package.json'), + ), ); } else { logger.warn( @@ -866,6 +978,8 @@ export async function updatePackageJson({ } return json; }); + + return async () => await Promise.all(tasks.map(async (task) => await task())); } export function updateTsConfig({ @@ -895,6 +1009,9 @@ export function updateTsConfig({ if (!item) { continue; } + if (typeof item === 'boolean') { + continue; + } const pluginTsConfigPath = item.tsConfigCompilerPaths; if (pluginTsConfigPath) { // for each key in the pluginTsConfigPath object, add it to the paths object @@ -932,17 +1049,30 @@ export async function getProjectThatSpecIsIn(tree: Tree, specFile: string) { logger.debug('Provided spec file is in project: ', projectJsonName); return projectJsonName; } - const packageJsonPath = join(project.root, 'package.json'); - const packageJson = readJson(tree, packageJsonPath); - const projectName = packageJson.name; - if (!projectName) { - throw new Error('No name found in package.json.'); - } else if (typeof projectName === 'string') { - logger.debug('Provided spec file is in project: ', projectName); - return projectName; - } - throw new Error('Project name is not a valid string.'); + + const projectName = getProjectName(tree, project); + return projectName; } } return null; } + +export const getProjectName = (tree: Tree, project: ProjectConfiguration) => { + const packageJsonPath = join(project.root, 'package.json'); + const projectJsonPath = join(project.root, 'project.json'); + if (tree.exists(packageJsonPath)) { + const packageJson = readJson(tree, packageJsonPath); + const projectName = packageJson.name; + if (typeof projectName === 'string') { + return projectName; + } + } + if (tree.exists(projectJsonPath)) { + const projectJson = readJson(tree, projectJsonPath); + const projectName = projectJson.name; + if (typeof projectName === 'string') { + return projectName; + } + } + throw new Error('No name found in package.json.'); +}; diff --git a/packages/nx-plugin/src/generators/openapi-client/plugins/schemas/src/schemas.ts.template b/packages/nx-plugin/src/generators/openapi-client/plugins/schemas/src/schemas.ts.template new file mode 100644 index 000000000..ed39e5a19 --- /dev/null +++ b/packages/nx-plugin/src/generators/openapi-client/plugins/schemas/src/schemas.ts.template @@ -0,0 +1 @@ +export * from './generated/schemas.gen'; diff --git a/packages/nx-plugin/src/generators/openapi-client/plugins/zod/src/zod.ts.template b/packages/nx-plugin/src/generators/openapi-client/plugins/zod/src/zod.ts.template new file mode 100644 index 000000000..efdee8238 --- /dev/null +++ b/packages/nx-plugin/src/generators/openapi-client/plugins/zod/src/zod.ts.template @@ -0,0 +1 @@ +export * from './generated/zod.gen'; diff --git a/packages/nx-plugin/src/test-utils.ts b/packages/nx-plugin/src/test-utils.ts index ba5606682..0fa510430 100644 --- a/packages/nx-plugin/src/test-utils.ts +++ b/packages/nx-plugin/src/test-utils.ts @@ -64,6 +64,7 @@ paths: directory: tempDir, name: TestOptions.name, plugins: [], + preformInstall: false, scope: TestOptions.scope, spec: tempSpecPath, tags: TestOptions.tags, diff --git a/packages/nx-plugin/src/utils.ts b/packages/nx-plugin/src/utils.ts index 4e2f4b3b2..3fb2ea2ab 100644 --- a/packages/nx-plugin/src/utils.ts +++ b/packages/nx-plugin/src/utils.ts @@ -16,7 +16,10 @@ import { convert } from 'swagger2openapi'; import { CONSTANTS } from './vars'; -export type Plugin = string | { asClass: boolean; name: string }; +export type Plugin = + | string + | { asClass: boolean; name: '@hey-api/sdk' } + | { name: '@hey-api/schemas'; type: 'json' | 'form' }; export function generateClientCommand({ clientType, @@ -64,11 +67,13 @@ export async function generateClientCode({ outputPath, plugins, specFile, + watch, }: { clientType: string; outputPath: string; plugins: Plugin[]; specFile: string; + watch?: boolean; }) { try { const pluginNames = plugins.map(getPluginName); @@ -78,6 +83,7 @@ export async function generateClientCode({ input: specFile, output: outputPath, plugins: [clientType, ...pluginNames] as ClientConfig['plugins'], + watch, }); logger.info(`Generated client code successfully.`); } catch (error) { @@ -179,7 +185,10 @@ async function getSpecFile(path: string) { export async function getSpecFiles( existingSpecPath: string, newSpecPath: string, -) { +): Promise<{ + existingSpec: JSONSchema; + newSpec: JSONSchema; +}> { logger.debug('Loading spec files...'); const parsedExistingSpecTask = getSpecFile(existingSpecPath); const parsedNewSpecTask = getSpecFile(newSpecPath); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c86e0ec19..7dce60432 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -793,14 +793,14 @@ importers: packages/nx-plugin: dependencies: '@hey-api/json-schema-ref-parser': - specifier: 1.0.5 - version: 1.0.5 + specifier: 1.0.6 + version: 1.0.6 '@hey-api/openapi-ts': specifier: workspace:* version: link:../openapi-ts '@nx/devkit': - specifier: 20.8.1 - version: 20.8.1(nx@21.0.3) + specifier: 21.0.3 + version: 21.0.3(nx@21.0.3) api-smart-diff: specifier: ^1.0.6 version: 1.0.6 @@ -2864,10 +2864,6 @@ packages: '@fontsource/fira-mono@5.0.0': resolution: {integrity: sha512-IsinH/oLYJyv/sQv7SbKmjoAXZsSjm6Q1Tz5GBBXCXi3Jg9MzXmKvWm9bSLC8lFI6CDsi8GkH/DAgZ98t8bhTQ==} - '@hey-api/json-schema-ref-parser@1.0.5': - resolution: {integrity: sha512-bWUV9ICwvU5I3YKVZqWIUXFC2SIXznUi/u+LqurJx6ILiyImfZD5+g/lj3w4EiyXxmjqyaxptzUz/1IgK3vVtw==} - engines: {node: '>= 16'} - '@hey-api/json-schema-ref-parser@1.0.6': resolution: {integrity: sha512-yktiFZoWPtEW8QKS65eqKwA5MTKp88CyiL8q72WynrBs/73SAaxlSWlA2zW/DZlywZ5hX1OYzrCC0wFdvO9c2w==} engines: {node: '>= 16'} @@ -3636,10 +3632,10 @@ packages: peerDependencies: vue: ^3.3.4 - '@nx/devkit@20.8.1': - resolution: {integrity: sha512-N3nwIg/7RIZeB76iuVo29q+l9WyTtvuBSgDFM2msiIK6Q928ilzoeNPZ/p7w/TE3Gqs5XVhq9ExMvDAOTxdmXA==} + '@nx/devkit@21.0.3': + resolution: {integrity: sha512-PnEZWenJ3fOoAU+Es9v0xxANyrROtFj+rjDHCjfyqGs3jMihMyTsCDQLpsjdnrUF5jjp9VUawfms76ocSLmwpw==} peerDependencies: - nx: '>= 19 <= 21' + nx: 21.0.3 '@nx/nx-darwin-arm64@21.0.3': resolution: {integrity: sha512-UQxDwhLcA1ERv4u1GiNgb2yhTHflWE8iOfayApPfYD0eSjBUMj30/s2E1RVq5Tx9TxYtmFVwz+C8DxOVWKu3OQ==} @@ -14725,13 +14721,6 @@ snapshots: '@fontsource/fira-mono@5.0.0': {} - '@hey-api/json-schema-ref-parser@1.0.5': - dependencies: - '@jsdevtools/ono': 7.1.3 - '@types/json-schema': 7.0.15 - js-yaml: 4.1.0 - lodash: 4.17.21 - '@hey-api/json-schema-ref-parser@1.0.6': dependencies: '@jsdevtools/ono': 7.1.3 @@ -15875,7 +15864,7 @@ snapshots: - vti - vue-tsc - '@nx/devkit@20.8.1(nx@21.0.3)': + '@nx/devkit@21.0.3(nx@21.0.3)': dependencies: ejs: 3.1.10 enquirer: 2.3.6 From 94a79a06669066239fecccdcc0f35e23785a1773 Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Wed, 14 May 2025 17:22:01 -0400 Subject: [PATCH 19/26] major: add node 24 in CI, remove node 18 as a supported target --- .github/workflows/ci.yml | 6 +++--- .nvmrc | 2 +- package.json | 2 +- packages/nx-plugin/package.json | 1 + packages/openapi-ts-tests/main/package.json | 2 +- packages/openapi-ts/package.json | 2 +- pnpm-lock.yaml | 3 +++ 7 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6cdb48b7d..93e3d00cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: os: [macos-latest, ubuntu-latest, windows-latest] - node-version: ['18.20.5', '20.11.1', '22.11.0'] + node-version: ['20.19.0', '22.12.0'] steps: - uses: actions/checkout@v4.2.2 with: @@ -38,7 +38,7 @@ jobs: run: pnpm build --filter="@hey-api/**" - name: Build examples - if: matrix.node-version == '22.11.0' && matrix.os == 'ubuntu-latest' + if: matrix.node-version == '24.0.1' && matrix.os == 'ubuntu-latest' run: pnpm build --filter="@examples/**" - name: Run linter @@ -54,7 +54,7 @@ jobs: run: pnpm test:e2e - name: Publish preview packages - if: github.event_name == 'pull_request' && matrix.node-version == '22.11.0' && matrix.os == 'ubuntu-latest' + if: github.event_name == 'pull_request' && matrix.node-version == '24.0.1' && matrix.os == 'ubuntu-latest' run: ./scripts/publish-preview-packages.sh env: TURBO_SCM_BASE: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }} diff --git a/.nvmrc b/.nvmrc index 7af24b7dd..1d9b7831b 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -22.11.0 +22.12.0 diff --git a/package.json b/package.json index ecb451ec9..5b92606ed 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "vitepress": "turbo run $1 --filter=\"@docs/openapi-ts\"" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=22.10.0" + "node": "^20.19.0 || >=22.12.0" }, "devDependencies": { "@arethetypeswrong/cli": "0.17.4", diff --git a/packages/nx-plugin/package.json b/packages/nx-plugin/package.json index a947646b9..49fae5cd7 100644 --- a/packages/nx-plugin/package.json +++ b/packages/nx-plugin/package.json @@ -53,6 +53,7 @@ "@nx/devkit": "21.0.3", "api-smart-diff": "^1.0.6", "latest-version": "9.0.0", + "nx": "21.0.3", "swagger2openapi": "^7.0.8", "tslib": "2.8.1", "xcurl": "2.1.2" diff --git a/packages/openapi-ts-tests/main/package.json b/packages/openapi-ts-tests/main/package.json index 738d48de5..23154a3bf 100644 --- a/packages/openapi-ts-tests/main/package.json +++ b/packages/openapi-ts-tests/main/package.json @@ -14,7 +14,7 @@ "typecheck": "tsc --noEmit" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=22.10.0" + "node": "^20.9.0 || >=22.12.0" }, "peerDependencies": { "typescript": "^5.5.3" diff --git a/packages/openapi-ts/package.json b/packages/openapi-ts/package.json index f2dec4ccd..3e6b6bbec 100644 --- a/packages/openapi-ts/package.json +++ b/packages/openapi-ts/package.json @@ -85,7 +85,7 @@ "typecheck": "tsc --noEmit" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=22.10.0" + "node": "^20.9.0 || >=22.12.0" }, "dependencies": { "@hey-api/json-schema-ref-parser": "1.0.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7dce60432..e9ffc9160 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -807,6 +807,9 @@ importers: latest-version: specifier: 9.0.0 version: 9.0.0 + nx: + specifier: 21.0.3 + version: 21.0.3 swagger2openapi: specifier: ^7.0.8 version: 7.0.8(encoding@0.1.13) From e3e4b7df802822a2558d1c15ace8b88ddd5edc26 Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Thu, 15 May 2025 13:54:40 -0400 Subject: [PATCH 20/26] refactor(nx-plugin): improve file formatting utilities --- .../src/executors/update-api/updateApi.ts | 25 ++++-------- packages/nx-plugin/src/utils.ts | 39 ++++++++++++------- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/packages/nx-plugin/src/executors/update-api/updateApi.ts b/packages/nx-plugin/src/executors/update-api/updateApi.ts index 324732672..0e545390f 100644 --- a/packages/nx-plugin/src/executors/update-api/updateApi.ts +++ b/packages/nx-plugin/src/executors/update-api/updateApi.ts @@ -9,17 +9,13 @@ import { import { join } from 'node:path'; import type { PromiseExecutor } from '@nx/devkit'; -import { logger, names, workspaceRoot } from '@nx/devkit'; -import { - format, - type Options as PrettierOptions, - resolveConfig, -} from 'prettier'; +import { logger, names } from '@nx/devkit'; import { bundleAndDereferenceSpecFile, compareSpecs, formatFiles, + formatStringFromFilePath, generateClientCode, isUrl, makeDir, @@ -241,13 +237,6 @@ const runExecutor: PromiseExecutor = async ( const apiDirectoryExists = existsSync(absoluteApiDirectory); const existingSpecFileExists = existsSync(absoluteExistingSpecPath); - const prettierConfig = await resolveConfig(workspaceRoot, { - editorconfig: true, - }); - const prettierOptions: PrettierOptions = { - ...prettierConfig, - }; - // Copy new spec to project if (apiDirectoryExists) { if (existingSpecFileExists) { @@ -255,10 +244,10 @@ const runExecutor: PromiseExecutor = async ( } else { logger.debug('No existing spec file found. Creating...'); } - const formattedSpec = await format(newSpecString, { - ...prettierOptions, - filepath: absoluteTempSpecPath, - }); + const formattedSpec = await formatStringFromFilePath( + newSpecString, + absoluteTempSpecPath, + ); await writeFile(absoluteExistingSpecPath, formattedSpec); logger.debug(`Spec file updated successfully`); @@ -302,7 +291,7 @@ const runExecutor: PromiseExecutor = async ( }); logger.debug('Formatting generated directory...'); - await formatFiles(absoluteProjectGeneratedDir, prettierOptions); + await formatFiles(absoluteProjectGeneratedDir); logger.info('Successfully updated API client and spec files.'); await cleanup(absoluteTempFolder); diff --git a/packages/nx-plugin/src/utils.ts b/packages/nx-plugin/src/utils.ts index 3fb2ea2ab..1e1cd2456 100644 --- a/packages/nx-plugin/src/utils.ts +++ b/packages/nx-plugin/src/utils.ts @@ -11,7 +11,7 @@ import { } from '@hey-api/openapi-ts/internal'; import { logger, workspaceRoot } from '@nx/devkit'; import { compareOpenApi } from 'api-smart-diff'; -import { format, type Options as PrettierOptions } from 'prettier'; +import { format, resolveConfig } from 'prettier'; import { convert } from 'swagger2openapi'; import { CONSTANTS } from './vars'; @@ -335,22 +335,17 @@ export async function makeDir(path: string) { await mkdir(path, { recursive: true }); } -export async function formatFiles( - dir: string, - prettierOptions?: PrettierOptions, -) { +/** + * Formats all files in a directory + */ +export async function formatFiles(dir: string) { const files = await readdir(dir, { withFileTypes: true }); const tasks = files.map(async (file) => { const filePath = join(dir, file.name); if (file.isDirectory()) { - await formatFiles(filePath, prettierOptions); - } else if (file.name.endsWith('.ts')) { - const content = await readFile(filePath, 'utf-8'); - const formatted = await format(content, { - ...prettierOptions, - filepath: filePath, - }); - await writeFile(filePath, formatted); + await formatFiles(filePath); + } else if (file.isFile()) { + await formatFile(filePath); } }); await Promise.all(tasks); @@ -434,3 +429,21 @@ export async function getBaseTsConfigPath({ logger.error(message); throw new Error(message); } + +export async function formatFile(filePath: string) { + const content = await readFile(filePath, 'utf-8'); + const formatted = await formatStringFromFilePath(content, filePath); + await writeFile(filePath, formatted); +} + +export async function formatStringFromFilePath( + content: string, + filePath: string, +) { + const prettierOptions = await resolveConfig(filePath); + const formatted = await format(content, { + ...prettierOptions, + filepath: filePath, + }); + return formatted; +} From 52a1e75ae364c433a7d5fba2359c60b8242abdee Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Thu, 24 Jul 2025 08:12:06 -0400 Subject: [PATCH 21/26] refactor(nx-plugin): handle configs from builtin client packages --- packages/nx-plugin/package.json | 17 +- .../executors/update-api/updateApi.spec.ts | 20 +- .../openapi-client/openapiClient.spec.ts | 66 ++- .../openapi-client/openapiClient.ts | 30 +- packages/nx-plugin/src/utils.spec.ts | 20 +- packages/nx-plugin/src/utils.ts | 17 +- pnpm-lock.yaml | 412 +++++++++++++----- 7 files changed, 443 insertions(+), 139 deletions(-) diff --git a/packages/nx-plugin/package.json b/packages/nx-plugin/package.json index 49fae5cd7..fc7219f50 100644 --- a/packages/nx-plugin/package.json +++ b/packages/nx-plugin/package.json @@ -48,21 +48,22 @@ "executors": "./executors.json", "generators": "./generators.json", "dependencies": { - "@hey-api/json-schema-ref-parser": "1.0.6", + "@hey-api/json-schema-ref-parser": "^1.0.6", "@hey-api/openapi-ts": "workspace:*", - "@nx/devkit": "21.0.3", + "@nx/devkit": "^21.3.5", "api-smart-diff": "^1.0.6", - "latest-version": "9.0.0", - "nx": "21.0.3", + "latest-version": "^9.0.0", + "nx": "^21.3.5", + "prettier": "^3.6.2", "swagger2openapi": "^7.0.8", - "tslib": "2.8.1", - "xcurl": "2.1.2" + "tslib": "^2.8.1", + "xcurl": "^2.1.2" }, "devDependencies": { "@config/vite-base": "workspace:*", "@types/swagger2openapi": "^7.0.4", - "typescript": "5.8.3", - "vitest": "3.1.1" + "typescript": "^5.8.3", + "vitest": "^3.2.4" }, "files": [ "executors.json", diff --git a/packages/nx-plugin/src/executors/update-api/updateApi.spec.ts b/packages/nx-plugin/src/executors/update-api/updateApi.spec.ts index 610ec59c0..fad018e1f 100644 --- a/packages/nx-plugin/src/executors/update-api/updateApi.spec.ts +++ b/packages/nx-plugin/src/executors/update-api/updateApi.spec.ts @@ -20,13 +20,19 @@ vi.mock('@hey-api/openapi-ts/internal', async (importOriginal) => { return { ...actual, initConfigs: vi.fn((config: Parameters[0]) => - Promise.resolve([ - { - input: config?.input ?? 'default-input', - output: config?.output ?? 'default-output', - plugins: config?.plugins ?? [], - }, - ]), + Promise.resolve({ + dependencies: [], + results: [ + { + config: { + input: config?.input ?? 'default-input', + output: config?.output ?? 'default-output', + plugins: config?.plugins ?? [], + }, + errors: [], + }, + ], + }), ), }; }); diff --git a/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts b/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts index a491b17b2..e3306e936 100644 --- a/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts +++ b/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts @@ -30,13 +30,19 @@ vi.mock('@hey-api/openapi-ts/internal', async (importOriginal) => { return { ...actual, initConfigs: vi.fn((config: Parameters[0]) => - Promise.resolve([ - { - input: config?.input ?? 'default-input', - output: config?.output ?? 'default-output', - plugins: config?.plugins ?? [], - }, - ]), + Promise.resolve({ + dependencies: [], + results: [ + { + config: { + input: config?.input ?? 'default-input', + output: config?.output ?? 'default-output', + plugins: config?.plugins ?? [], + }, + errors: [], + }, + ], + }), ), }; }); @@ -215,7 +221,7 @@ describe('openapi-client generator', () => { }); describe('updatePackageJson', () => { - it('should update package.json with correct dependencies', async () => { + it('should not add the fetch client to the package.json', async () => { const { options, tree } = await getGeneratorOptions({ name: `test-api-${randomUUID()}`, tempDirectory, @@ -252,7 +258,49 @@ describe('openapi-client generator', () => { }); const packageJson = readJson(tree, `${projectRoot}/package.json`); - expect(packageJson.dependencies['@hey-api/client-fetch']).toBeDefined(); + expect( + packageJson.dependencies['@hey-api/client-fetch'], + ).not.toBeDefined(); + }); + + it('should add the random client to the package.json', async () => { + const { options, tree } = await getGeneratorOptions({ + name: `test-api-${randomUUID()}`, + tempDirectory, + }); + const normalizedOptions = normalizeOptions(options); + const { projectName, projectRoot, projectScope } = normalizedOptions; + + // Create initial package.json + tree.write( + `${projectRoot}/package.json`, + JSON.stringify({ + dependencies: {}, + devDependencies: {}, + name: `${projectScope}/${projectName}`, + }), + ); + + // Create tsconfig.base.json + tree.write( + 'tsconfig.base.json', + JSON.stringify({ + compilerOptions: { + paths: {}, + }, + }), + ); + + await updatePackageJson({ + clientType: 'MyRandomClient', + isPrivate: true, + plugins: [], + projectRoot, + tree, + }); + + const packageJson = readJson(tree, `${projectRoot}/package.json`); + expect(packageJson.dependencies['MyRandomClient']).toBeDefined(); }); it('should update tsconfig with correct dependencies', async () => { diff --git a/packages/nx-plugin/src/generators/openapi-client/openapiClient.ts b/packages/nx-plugin/src/generators/openapi-client/openapiClient.ts index 5cb5ce39b..bdb540441 100644 --- a/packages/nx-plugin/src/generators/openapi-client/openapiClient.ts +++ b/packages/nx-plugin/src/generators/openapi-client/openapiClient.ts @@ -897,8 +897,19 @@ export async function updatePackageJson({ }) { const { default: latestVersion } = await import('latest-version'); + const nonPackageClients = [ + '@hey-api/client-fetch', + '@hey-api/client-axios', + '@hey-api/client-nuxt', + '@hey-api/client-next', + ]; // add the client as a dependency - const clientDetails = getPackageDetails(clientType); + const clientDetails = nonPackageClients.includes(clientType) + ? { + packageName: clientType, + packageVersion: undefined, + } + : getPackageDetails(clientType); // add the openapi-ts as a dependency const openApiTsDetails = getPackageDetails('@hey-api/openapi-ts'); @@ -923,13 +934,16 @@ export async function updatePackageJson({ ]); // Update package.json to add dependencies and scripts - const deps = results.reduce( - (acc, result) => { - acc[result.packageName] = result.packageVersion; - return acc; - }, - {} as Record, - ); + const deps = results + // filter out the packages that have no version + .filter((v) => v.packageVersion !== undefined) + .reduce( + (acc, result) => { + acc[result.packageName] = result.packageVersion; + return acc; + }, + {} as Record, + ); if ((await clientDetails).packageName === '@hey-api/client-axios') { const axiosVersion = await latestVersion('axios'); diff --git a/packages/nx-plugin/src/utils.spec.ts b/packages/nx-plugin/src/utils.spec.ts index 79915073e..4a77f4c06 100644 --- a/packages/nx-plugin/src/utils.spec.ts +++ b/packages/nx-plugin/src/utils.spec.ts @@ -46,13 +46,19 @@ vi.mock('@hey-api/openapi-ts/internal', async (importOriginal) => { }), ), initConfigs: vi.fn((config: Parameters[0]) => - Promise.resolve([ - { - input: config?.input ?? 'default-input', - output: config?.output ?? 'default-output', - plugins: config?.plugins ?? [], - }, - ]), + Promise.resolve({ + dependencies: [], + results: [ + { + config: { + input: config?.input ?? 'default-input', + output: config?.output ?? 'default-output', + plugins: config?.plugins ?? [], + }, + errors: [], + }, + ], + }), ), parseOpenApiSpec: vi.fn(() => ({ spec: { diff --git a/packages/nx-plugin/src/utils.ts b/packages/nx-plugin/src/utils.ts index 1e1cd2456..adbef0d11 100644 --- a/packages/nx-plugin/src/utils.ts +++ b/packages/nx-plugin/src/utils.ts @@ -136,7 +136,21 @@ export async function bundleAndDereferenceSpecFile({ plugins: [client, ...plugins] as ClientConfig['plugins'], }); // getting the first config - const config = configs[0]; + const dependencies = configs.dependencies; + const firstResult = configs.results[0]; + if (!firstResult) { + logger.error('Failed to load config.'); + throw new Error('Failed to load config.'); + } + // check if the config is valid + const { config, errors } = firstResult; + const firstError = errors[0]; + if (firstError && !config) { + logger.error(`Failed to load config: ${firstError.message}`); + throw new Error(`Failed to load config: ${firstError.message}`, { + cause: firstError, + }); + } if (!config) { logger.error('Failed to load config.'); throw new Error('Failed to load config.'); @@ -144,6 +158,7 @@ export async function bundleAndDereferenceSpecFile({ logger.debug(`Parsing spec...`); const context = parseOpenApiSpec({ config, + dependencies, spec, }); if (!context) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e9ffc9160..c01c2018d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -785,7 +785,7 @@ importers: version: 3.16.2 '@nuxt/test-utils': specifier: 3.17.2 - version: 3.17.2(@types/node@22.10.5)(@vue/test-utils@2.4.6)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(magicast@0.3.5)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vitest@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(yaml@2.8.0) + version: 3.17.2(@types/node@22.10.5)(@vue/test-utils@2.4.6)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(magicast@0.3.5)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vitest@3.2.4(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(yaml@2.8.0) vite: specifier: 6.2.7 version: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) @@ -793,31 +793,34 @@ importers: packages/nx-plugin: dependencies: '@hey-api/json-schema-ref-parser': - specifier: 1.0.6 + specifier: ^1.0.6 version: 1.0.6 '@hey-api/openapi-ts': specifier: workspace:* version: link:../openapi-ts '@nx/devkit': - specifier: 21.0.3 - version: 21.0.3(nx@21.0.3) + specifier: ^21.3.5 + version: 21.3.5(nx@21.3.5) api-smart-diff: specifier: ^1.0.6 version: 1.0.6 latest-version: - specifier: 9.0.0 + specifier: ^9.0.0 version: 9.0.0 nx: - specifier: 21.0.3 - version: 21.0.3 + specifier: ^21.3.5 + version: 21.3.5 + prettier: + specifier: ^3.6.2 + version: 3.6.2 swagger2openapi: specifier: ^7.0.8 version: 7.0.8(encoding@0.1.13) tslib: - specifier: 2.8.1 + specifier: ^2.8.1 version: 2.8.1 xcurl: - specifier: 2.1.2 + specifier: ^2.1.2 version: 2.1.2 devDependencies: '@config/vite-base': @@ -827,11 +830,11 @@ importers: specifier: ^7.0.4 version: 7.0.4 typescript: - specifier: 5.8.3 + specifier: ^5.8.3 version: 5.8.3 vitest: - specifier: 3.1.1 - version: 3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) + specifier: ^3.2.4 + version: 3.2.4(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) packages/openapi-ts: dependencies: @@ -3145,9 +3148,17 @@ packages: resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} engines: {node: '>=8'} - '@jest/schemas@29.6.3': - resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/diff-sequences@30.0.1': + resolution: {integrity: sha512-n5H8QLDJ47QqbCNn5SuFjCRDrOLEZ0h8vAHCK5RL9Ls7Xa8AQLa/YxAc9UjFqoEDM48muwtBGjtMY5cr0PLDCw==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + + '@jest/get-type@30.0.1': + resolution: {integrity: sha512-AyYdemXCptSRFirI5EPazNxyPwAL0jXt3zceFjaj8NFiKP9pOi0bfXonf6qkf82z2t3QWPeLCWWw4stPBzctLw==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + + '@jest/schemas@30.0.5': + resolution: {integrity: sha512-DmdYgtezMkh3cpU8/1uyXakv3tJRcmcXxBOcO0tbaozPwpmh4YMsnWrQm9ZmZMfa5ocbxzbFk6O4bDPEc/iAnA==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} '@jridgewell/gen-mapping@0.3.8': resolution: {integrity: sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==} @@ -3635,58 +3646,58 @@ packages: peerDependencies: vue: ^3.3.4 - '@nx/devkit@21.0.3': - resolution: {integrity: sha512-PnEZWenJ3fOoAU+Es9v0xxANyrROtFj+rjDHCjfyqGs3jMihMyTsCDQLpsjdnrUF5jjp9VUawfms76ocSLmwpw==} + '@nx/devkit@21.3.5': + resolution: {integrity: sha512-YTmjD+kqDUapfcV37IgVddLZL4oOoFVXO0dFKsYSkx/FNmhccTbeXxgsdcyRTJY6gCwsFJ+4X0aIv8NxebWYaw==} peerDependencies: - nx: 21.0.3 + nx: 21.3.5 - '@nx/nx-darwin-arm64@21.0.3': - resolution: {integrity: sha512-UQxDwhLcA1ERv4u1GiNgb2yhTHflWE8iOfayApPfYD0eSjBUMj30/s2E1RVq5Tx9TxYtmFVwz+C8DxOVWKu3OQ==} + '@nx/nx-darwin-arm64@21.3.5': + resolution: {integrity: sha512-QKWtKjIdYS2foDo/4ojvVr5NjrtY8IcHPyFFATAk7v5BWe2tEGh6pPDj8GRqvSqZPWSBZNDcJ6efovJyka6yzw==} cpu: [arm64] os: [darwin] - '@nx/nx-darwin-x64@21.0.3': - resolution: {integrity: sha512-ZR9a2ysE4nrQ2VTQxZa2w76rr9rA9kw61Oy7sp2rlKeqr8yyKynZgZmuCTnOOn3LCOUl072wtGCIS85SFSeGug==} + '@nx/nx-darwin-x64@21.3.5': + resolution: {integrity: sha512-X06eb6lzuln9ZHh7L8430s4Cc7pi5mihU3IlJsN0rbgdCp2PMlOsJ/8P/zw/DBwq6qmTuVwZ8Xk01VOVtWZT0w==} cpu: [x64] os: [darwin] - '@nx/nx-freebsd-x64@21.0.3': - resolution: {integrity: sha512-bJRFvhTOzewDM2HxeVDqbrR5357tAUpovcj9czzRGrEhhoelqCLP0/9Ric1V4j8yyPXmRpXa9REWq3weFaAcwg==} + '@nx/nx-freebsd-x64@21.3.5': + resolution: {integrity: sha512-+ZWvAn/1UD4Wwduv5nhcXWIUcev1JDEEsNBesGvFWS4c19dBk8vaUpUv3YQspwRUgAGdfYw1CWqDDOYvGFrZ3w==} cpu: [x64] os: [freebsd] - '@nx/nx-linux-arm-gnueabihf@21.0.3': - resolution: {integrity: sha512-7Mt/G0e3x9j83VuM1wflbAGTITO+VZBRKZpvhWS6Z6mNzNhc6T2PX2OvNMDC7PsUlTJeq7O4kb3M1fmkmk1DVA==} + '@nx/nx-linux-arm-gnueabihf@21.3.5': + resolution: {integrity: sha512-JeSw0/WdVo4AxCKWRrH686rxu9jHzKnl/IY1m+/jiIPq2yUPUUxqSj9+Xesvp9K3plAmZFlSulbfd8BX15/cEw==} cpu: [arm] os: [linux] - '@nx/nx-linux-arm64-gnu@21.0.3': - resolution: {integrity: sha512-3sUnzts/dquniJ+IXrJJcxnwl4jqbteJJhSXtrYlp+Kd2nNqgQIqdKvHy2hwUBDD0NvzpDdz6bTwcY2s1ghsAg==} + '@nx/nx-linux-arm64-gnu@21.3.5': + resolution: {integrity: sha512-TlMhwwj75cP67m/qYuSAmvdMMW6oASELo3uxRJ9PbpyTRiCmQZoqjZqALL/48rAEk1Ig69o83RI4pIMRkGMQUw==} cpu: [arm64] os: [linux] - '@nx/nx-linux-arm64-musl@21.0.3': - resolution: {integrity: sha512-gBr2QXy5zmyut/UHbQLKV+wq6IKJ+5AACsczH4JdUvr58e0GunIVWTArgHMZwDJxbY4hAxtwgB8rFD4Bi6noxQ==} + '@nx/nx-linux-arm64-musl@21.3.5': + resolution: {integrity: sha512-GZBMLTJFP9H9/o26jSfqxwlBoZ4c0FNBl8rJ3tOC9jCNHn7wcMJKaVbp0dUKDgUtyzATa5poJsdClG84zMnHdA==} cpu: [arm64] os: [linux] - '@nx/nx-linux-x64-gnu@21.0.3': - resolution: {integrity: sha512-hwm/ER8LC1Dkh1CNIx9D3GqYFdX99StyDMV1A+W9fnIehJmFq8Om0HrbLrJAFIFMvQpVxwMjDO39q6Kf/UWyhg==} + '@nx/nx-linux-x64-gnu@21.3.5': + resolution: {integrity: sha512-rNZ2X+h3AbF+vM3zKcpv122Eu5fyYS0079iNiYAHNknwLPJUlvDEQU3nu6ts8Hw1zSjxzibHbWZghSfZRAIHZA==} cpu: [x64] os: [linux] - '@nx/nx-linux-x64-musl@21.0.3': - resolution: {integrity: sha512-Rg0xjGoikWbhnEANSP3KwRtYHJmq1P1pv31zvPjeZI9nFNLyCRsJYSpnlE5BfP8a8XlzdqlLO0Df0XmL5Fdyew==} + '@nx/nx-linux-x64-musl@21.3.5': + resolution: {integrity: sha512-LtsDUhrH0sVl7gBSsJ+cy/cKH71PorysOhJqTrE7Z5UVpnWu+1djiOsbEDRAheyUf80QfFA8xC239Pi+QG3T/w==} cpu: [x64] os: [linux] - '@nx/nx-win32-arm64-msvc@21.0.3': - resolution: {integrity: sha512-LyxCffeta+4ad70043ZQ1/lFdOzpFpx8zmwVLhASTmZ6jdrePKPyxn+uSv0AWOiEVpGiZHr3Yh47YfrlWBO+wA==} + '@nx/nx-win32-arm64-msvc@21.3.5': + resolution: {integrity: sha512-lmhzLTVXzQNa0em6v0gBCfswpD5vdgtcjUxr5flR6ylWYo0hVYD4w/EqoymqXq0rU94lx28lksmKX0vhNH5aiw==} cpu: [arm64] os: [win32] - '@nx/nx-win32-x64-msvc@21.0.3': - resolution: {integrity: sha512-1lyRNwjDax8Nvemt8wpbYiyRjIvrnBrzZTEkm7z5rDV2RX2Ik06EOZHWWtqHmdfx1EPV2omvVWRmmqLHI98YLA==} + '@nx/nx-win32-x64-msvc@21.3.5': + resolution: {integrity: sha512-8ljAlmV96WUK7NbXCL96HDxP7Qm6MDKgz/8mD4XtMJIWvZ098VDv4+1Ce2lK366grQRmNQfYVUuhwPppnJfqug==} cpu: [x64] os: [win32] @@ -4947,8 +4958,8 @@ packages: resolution: {integrity: sha512-hVJD77oT67aowHxwT4+M6PGOp+E2LtLdTK3+FC0lBO9T7sYwItDMXZ7Z07IDCvR1M717a4axbIWckrW67KMP/w==} engines: {node: ^18.17.0 || >=20.5.0} - '@sinclair/typebox@0.27.8': - resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} + '@sinclair/typebox@0.34.38': + resolution: {integrity: sha512-HpkxMmc2XmZKhvaKIZZThlHmx1L0I/V1hWK1NubtlFnr6ZqdiOpV72TKudZUNQjZNsyDBay72qFEhEvb+bcwcA==} '@sindresorhus/is@4.6.0': resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} @@ -5116,6 +5127,9 @@ packages: '@types/bun@1.2.19': resolution: {integrity: sha512-d9ZCmrH3CJ2uYKXQIUuZ/pUnTqIvLDS0SK7pFmbx8ma+ziH/FRMoAq5bYpRG7y+w1gl+HgyNZbtqgMq4W4e2Lg==} + '@types/chai@5.2.2': + resolution: {integrity: sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg==} + '@types/connect-history-api-fallback@1.5.4': resolution: {integrity: sha512-n6Cr2xS1h4uAulPRdlw6Jl6s1oG8KrVilPN2yUITEs+K48EzMJJ3W1xy8K5eWuFvjp3R74AOIGSmp2UfBJ8HFw==} @@ -5131,6 +5145,9 @@ packages: '@types/cross-spawn@6.0.6': resolution: {integrity: sha512-fXRhhUkG4H3TQk5dBhQ7m/JDdSNHKwR2BBia62lhwEIq9xGiQKLxd6LymNhn47SjXhsUEPmxi+PKw2OkW4LLjA==} + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + '@types/eslint-scope@3.7.7': resolution: {integrity: sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==} @@ -5491,6 +5508,9 @@ packages: '@vitest/expect@3.1.1': resolution: {integrity: sha512-q/zjrW9lgynctNbwvFtQkGK9+vvHA5UzVi2V8APrp1C6fG6/MuYYkmlx4FubuqLycCeSdHD5aadWfua/Vr0EUA==} + '@vitest/expect@3.2.4': + resolution: {integrity: sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==} + '@vitest/mocker@3.1.1': resolution: {integrity: sha512-bmpJJm7Y7i9BBELlLuuM1J1Q6EQ6K5Ye4wcyOpOMXMcePYKSIYlpcrCm4l/O6ja4VJA5G2aMJiuZkZdnxlC3SA==} peerDependencies: @@ -5502,24 +5522,50 @@ packages: vite: optional: true + '@vitest/mocker@3.2.4': + resolution: {integrity: sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==} + peerDependencies: + msw: ^2.4.9 + vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + '@vitest/pretty-format@3.1.1': resolution: {integrity: sha512-dg0CIzNx+hMMYfNmSqJlLSXEmnNhMswcn3sXO7Tpldr0LiGmg3eXdLLhwkv2ZqgHb/d5xg5F7ezNFRA1fA13yA==} '@vitest/pretty-format@3.1.3': resolution: {integrity: sha512-i6FDiBeJUGLDKADw2Gb01UtUNb12yyXAqC/mmRWuYl+m/U9GS7s8us5ONmGkGpUUo7/iAYzI2ePVfOZTYvUifA==} + '@vitest/pretty-format@3.2.4': + resolution: {integrity: sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==} + '@vitest/runner@3.1.1': resolution: {integrity: sha512-X/d46qzJuEDO8ueyjtKfxffiXraPRfmYasoC4i5+mlLEJ10UvPb0XH5M9C3gWuxd7BAQhpK42cJgJtq53YnWVA==} + '@vitest/runner@3.2.4': + resolution: {integrity: sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==} + '@vitest/snapshot@3.1.1': resolution: {integrity: sha512-bByMwaVWe/+1WDf9exFxWWgAixelSdiwo2p33tpqIlM14vW7PRV5ppayVXtfycqze4Qhtwag5sVhX400MLBOOw==} + '@vitest/snapshot@3.2.4': + resolution: {integrity: sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==} + '@vitest/spy@3.1.1': resolution: {integrity: sha512-+EmrUOOXbKzLkTDwlsc/xrwOlPDXyVk3Z6P6K4oiCndxz7YLpp/0R0UsWVOKT0IXWjjBJuSMk6D27qipaupcvQ==} + '@vitest/spy@3.2.4': + resolution: {integrity: sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==} + '@vitest/utils@3.1.1': resolution: {integrity: sha512-1XIjflyaU2k3HMArJ50bwSh3wKWPD6Q47wz/NUSmRV0zNywPc4w79ARjg/i/aNINHwA+mIALhUVqD9/aUvZNgg==} + '@vitest/utils@3.2.4': + resolution: {integrity: sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==} + '@volar/language-core@2.4.13': resolution: {integrity: sha512-MnQJ7eKchJx5Oz+YdbqyFUk8BN6jasdJv31n/7r6/WwlOOv7qzvot6B66887l2ST3bUW4Mewml54euzpJWA6bg==} @@ -7029,10 +7075,6 @@ packages: didyoumean@1.2.2: resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} - diff-sequences@29.6.3: - resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - diff@4.0.2: resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} engines: {node: '>=0.3.1'} @@ -8602,13 +8644,9 @@ packages: jasmine-core@5.2.0: resolution: {integrity: sha512-tSAtdrvWybZkQmmaIoDgnvHG8ORUNw5kEVlO5CvrXj02Jjr9TZrmjFq7FUiOUzJiOP2wLGYT6PgrQgQF4R1xiw==} - jest-diff@29.7.0: - resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-get-type@29.6.3: - resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-diff@30.0.5: + resolution: {integrity: sha512-1UIqE9PoEKaHcIKvq2vbibrCog4Y8G0zmOxgQUVEiTqwR5hJVMCoDsN1vFvI5JvwD37hjueZ1C4l2FyGnfpE0A==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} jest-worker@27.5.1: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} @@ -8996,6 +9034,9 @@ packages: loupe@3.1.3: resolution: {integrity: sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==} + loupe@3.2.0: + resolution: {integrity: sha512-2NCfZcT5VGVNX9mSZIxLRkEAegDGBpuQZBy13desuHeVORmBDyAET4TkJr4SjqQy3A8JDofMN6LpkK8Xcm/dlw==} + lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} @@ -9597,9 +9638,8 @@ packages: nwsapi@2.2.20: resolution: {integrity: sha512-/ieB+mDe4MrrKMT8z+mQL8klXydZWGR5Dowt4RAGKbJ3kIGEx3X4ljUo+6V73IXtUPWgfOlU5B9MlGxFO5T+cA==} - nx@21.0.3: - resolution: {integrity: sha512-MWKucgA00TRjMBsuGbAS6HrCnOVwktU7Zxxw06Rfl0ue9tfTqbZX5iiNnb6M7b2wPQm9zcQXEq3DVBkPP8wUNw==} - engines: {node: ^20.19.0 || ^22.12.0} + nx@21.3.5: + resolution: {integrity: sha512-iRAO7D7SkjhIM6y5xH8GO+ojTJB2QSIzG2xNBgbRwuTV6AxLBkq6sU5hFA0wNzD/LncUeEoJmRtHfbGXfQQORQ==} hasBin: true peerDependencies: '@swc-node/register': ^1.8.0 @@ -10377,13 +10417,18 @@ packages: engines: {node: '>=14'} hasBin: true + prettier@3.6.2: + resolution: {integrity: sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==} + engines: {node: '>=14'} + hasBin: true + pretty-bytes@6.1.1: resolution: {integrity: sha512-mQUvGU6aUFQ+rNvTIAcZuWGRT9a6f6Yrg9bHs4ImKF+HZCEK+plBvnAZYSIQztknZF2qnzNtr6F8s0+IuptdlQ==} engines: {node: ^14.13.1 || >=16.0.0} - pretty-format@29.7.0: - resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + pretty-format@30.0.5: + resolution: {integrity: sha512-D1tKtYvByrBkFLe2wHJl2bwMJIiT8rW+XA+TiataH79/FszLQMrpGEvzUVkzPau7OCO0Qnrhpe87PqtOAIB8Yw==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} pretty-ms@9.2.0: resolution: {integrity: sha512-4yf0QO/sllf/1zbZWYnvWw3NxCQwLXKzIj0G849LSufP15BXKM0rbD2Z3wVnkMfjdn/CB0Dpp444gYAACdsplg==} @@ -11523,10 +11568,18 @@ packages: resolution: {integrity: sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==} engines: {node: '>=12.0.0'} + tinyglobby@0.2.14: + resolution: {integrity: sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==} + engines: {node: '>=12.0.0'} + tinypool@1.0.2: resolution: {integrity: sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==} engines: {node: ^18.0.0 || >=20.0.0} + tinypool@1.1.1: + resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==} + engines: {node: ^18.0.0 || >=20.0.0} + tinyrainbow@2.0.0: resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} engines: {node: '>=14.0.0'} @@ -11535,6 +11588,10 @@ packages: resolution: {integrity: sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==} engines: {node: '>=14.0.0'} + tinyspy@4.0.3: + resolution: {integrity: sha512-t2T/WLB2WRgZ9EpE4jgPJ9w+i66UZfDc8wHh0xrwiRNN+UwH98GIJkTeZqX9rg0i0ptwzqW+uYeIF0T4F8LR7A==} + engines: {node: '>=14.0.0'} + tmp-promise@3.0.3: resolution: {integrity: sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==} @@ -12112,6 +12169,11 @@ packages: engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true + vite-node@3.2.4: + resolution: {integrity: sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + vite-plugin-checker@0.8.0: resolution: {integrity: sha512-UA5uzOGm97UvZRTdZHiQVYFnd86AVn8EVaD4L3PoVzxH+IZSfaAw14WGFwX9QS23UW3lV/5bVKZn6l0w+q9P0g==} engines: {node: '>=14.16'} @@ -12337,6 +12399,34 @@ packages: jsdom: optional: true + vitest@3.2.4: + resolution: {integrity: sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@types/debug': ^4.1.12 + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + '@vitest/browser': 3.2.4 + '@vitest/ui': 3.2.4 + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@types/debug': + optional: true + '@types/node': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + void-elements@2.0.1: resolution: {integrity: sha512-qZKX4RnBzH2ugr8Lxa7x+0V6XD9Sb/ouARtiasEQCHB1EVU4NXtmHsDDrx1dO4ne5fc3J6EW05BP1Dl0z0iung==} engines: {node: '>=0.10.0'} @@ -14963,9 +15053,13 @@ snapshots: '@istanbuljs/schema@0.1.3': {} - '@jest/schemas@29.6.3': + '@jest/diff-sequences@30.0.1': {} + + '@jest/get-type@30.0.1': {} + + '@jest/schemas@30.0.5': dependencies: - '@sinclair/typebox': 0.27.8 + '@sinclair/typebox': 0.34.38 '@jridgewell/gen-mapping@0.3.8': dependencies: @@ -15700,7 +15794,7 @@ snapshots: - magicast - supports-color - '@nuxt/test-utils@3.17.2(@types/node@22.10.5)(@vue/test-utils@2.4.6)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(magicast@0.3.5)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vitest@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(yaml@2.8.0)': + '@nuxt/test-utils@3.17.2(@types/node@22.10.5)(@vue/test-utils@2.4.6)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(magicast@0.3.5)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vitest@3.2.4(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(yaml@2.8.0)': dependencies: '@nuxt/kit': 3.17.3(magicast@0.3.5) '@nuxt/schema': 3.16.2 @@ -15726,12 +15820,12 @@ snapshots: ufo: 1.6.1 unplugin: 2.3.4 vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) - vitest-environment-nuxt: 1.0.1(@types/node@22.10.5)(@vue/test-utils@2.4.6)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(magicast@0.3.5)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vitest@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(yaml@2.8.0) + vitest-environment-nuxt: 1.0.1(@types/node@22.10.5)(@vue/test-utils@2.4.6)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(magicast@0.3.5)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vitest@3.2.4(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(yaml@2.8.0) vue: 3.5.13(typescript@5.8.3) optionalDependencies: '@vue/test-utils': 2.4.6 jsdom: 23.0.0 - vitest: 3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) + vitest: 3.2.4(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) transitivePeerDependencies: - '@types/node' - jiti @@ -15867,46 +15961,46 @@ snapshots: - vti - vue-tsc - '@nx/devkit@21.0.3(nx@21.0.3)': + '@nx/devkit@21.3.5(nx@21.3.5)': dependencies: ejs: 3.1.10 enquirer: 2.3.6 ignore: 5.3.2 minimatch: 9.0.3 - nx: 21.0.3 + nx: 21.3.5 semver: 7.7.2 tmp: 0.2.3 tslib: 2.8.1 yargs-parser: 21.1.1 - '@nx/nx-darwin-arm64@21.0.3': + '@nx/nx-darwin-arm64@21.3.5': optional: true - '@nx/nx-darwin-x64@21.0.3': + '@nx/nx-darwin-x64@21.3.5': optional: true - '@nx/nx-freebsd-x64@21.0.3': + '@nx/nx-freebsd-x64@21.3.5': optional: true - '@nx/nx-linux-arm-gnueabihf@21.0.3': + '@nx/nx-linux-arm-gnueabihf@21.3.5': optional: true - '@nx/nx-linux-arm64-gnu@21.0.3': + '@nx/nx-linux-arm64-gnu@21.3.5': optional: true - '@nx/nx-linux-arm64-musl@21.0.3': + '@nx/nx-linux-arm64-musl@21.3.5': optional: true - '@nx/nx-linux-x64-gnu@21.0.3': + '@nx/nx-linux-x64-gnu@21.3.5': optional: true - '@nx/nx-linux-x64-musl@21.0.3': + '@nx/nx-linux-x64-musl@21.3.5': optional: true - '@nx/nx-win32-arm64-msvc@21.0.3': + '@nx/nx-win32-arm64-msvc@21.3.5': optional: true - '@nx/nx-win32-x64-msvc@21.0.3': + '@nx/nx-win32-x64-msvc@21.3.5': optional: true '@one-ini/wasm@0.1.1': {} @@ -17114,7 +17208,7 @@ snapshots: '@sigstore/core': 2.0.0 '@sigstore/protobuf-specs': 0.4.1 - '@sinclair/typebox@0.27.8': {} + '@sinclair/typebox@0.34.38': {} '@sindresorhus/is@4.6.0': {} @@ -17291,6 +17385,10 @@ snapshots: transitivePeerDependencies: - '@types/react' + '@types/chai@5.2.2': + dependencies: + '@types/deep-eql': 4.0.2 + '@types/connect-history-api-fallback@1.5.4': dependencies: '@types/express-serve-static-core': 5.0.6 @@ -17310,6 +17408,8 @@ snapshots: dependencies: '@types/node': 22.10.5 + '@types/deep-eql@4.0.2': {} + '@types/eslint-scope@3.7.7': dependencies: '@types/eslint': 9.6.0 @@ -17778,6 +17878,14 @@ snapshots: chai: 5.2.0 tinyrainbow: 2.0.0 + '@vitest/expect@3.2.4': + dependencies: + '@types/chai': 5.2.2 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 + chai: 5.2.0 + tinyrainbow: 2.0.0 + '@vitest/mocker@3.1.1(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))': dependencies: '@vitest/spy': 3.1.1 @@ -17786,6 +17894,14 @@ snapshots: optionalDependencies: vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) + '@vitest/mocker@3.2.4(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))': + dependencies: + '@vitest/spy': 3.2.4 + estree-walker: 3.0.3 + magic-string: 0.30.17 + optionalDependencies: + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) + '@vitest/pretty-format@3.1.1': dependencies: tinyrainbow: 2.0.0 @@ -17794,27 +17910,53 @@ snapshots: dependencies: tinyrainbow: 2.0.0 + '@vitest/pretty-format@3.2.4': + dependencies: + tinyrainbow: 2.0.0 + '@vitest/runner@3.1.1': dependencies: '@vitest/utils': 3.1.1 pathe: 2.0.3 + '@vitest/runner@3.2.4': + dependencies: + '@vitest/utils': 3.2.4 + pathe: 2.0.3 + strip-literal: 3.0.0 + '@vitest/snapshot@3.1.1': dependencies: '@vitest/pretty-format': 3.1.1 magic-string: 0.30.17 pathe: 2.0.3 + '@vitest/snapshot@3.2.4': + dependencies: + '@vitest/pretty-format': 3.2.4 + magic-string: 0.30.17 + pathe: 2.0.3 + '@vitest/spy@3.1.1': dependencies: tinyspy: 3.0.2 + '@vitest/spy@3.2.4': + dependencies: + tinyspy: 4.0.3 + '@vitest/utils@3.1.1': dependencies: '@vitest/pretty-format': 3.1.1 loupe: 3.1.3 tinyrainbow: 2.0.0 + '@vitest/utils@3.2.4': + dependencies: + '@vitest/pretty-format': 3.2.4 + loupe: 3.2.0 + tinyrainbow: 2.0.0 + '@volar/language-core@2.4.13': dependencies: '@volar/source-map': 2.4.13 @@ -19495,8 +19637,6 @@ snapshots: didyoumean@1.2.2: {} - diff-sequences@29.6.3: {} - diff@4.0.2: {} diff@7.0.0: {} @@ -21500,14 +21640,12 @@ snapshots: jasmine-core@5.2.0: {} - jest-diff@29.7.0: + jest-diff@30.0.5: dependencies: + '@jest/diff-sequences': 30.0.1 + '@jest/get-type': 30.0.1 chalk: 4.1.2 - diff-sequences: 29.6.3 - jest-get-type: 29.6.3 - pretty-format: 29.7.0 - - jest-get-type@29.6.3: {} + pretty-format: 30.0.5 jest-worker@27.5.1: dependencies: @@ -21951,6 +22089,8 @@ snapshots: loupe@3.1.3: {} + loupe@3.2.0: {} + lru-cache@10.4.3: {} lru-cache@4.1.5: @@ -22874,7 +23014,7 @@ snapshots: nwsapi@2.2.20: {} - nx@21.0.3: + nx@21.3.5: dependencies: '@napi-rs/wasm-runtime': 0.2.4 '@yarnpkg/lockfile': 1.1.0 @@ -22892,7 +23032,7 @@ snapshots: flat: 5.0.2 front-matter: 4.0.2 ignore: 5.3.2 - jest-diff: 29.7.0 + jest-diff: 30.0.5 jsonc-parser: 3.2.0 lines-and-columns: 2.0.3 minimatch: 9.0.3 @@ -22912,16 +23052,16 @@ snapshots: yargs: 17.7.2 yargs-parser: 21.1.1 optionalDependencies: - '@nx/nx-darwin-arm64': 21.0.3 - '@nx/nx-darwin-x64': 21.0.3 - '@nx/nx-freebsd-x64': 21.0.3 - '@nx/nx-linux-arm-gnueabihf': 21.0.3 - '@nx/nx-linux-arm64-gnu': 21.0.3 - '@nx/nx-linux-arm64-musl': 21.0.3 - '@nx/nx-linux-x64-gnu': 21.0.3 - '@nx/nx-linux-x64-musl': 21.0.3 - '@nx/nx-win32-arm64-msvc': 21.0.3 - '@nx/nx-win32-x64-msvc': 21.0.3 + '@nx/nx-darwin-arm64': 21.3.5 + '@nx/nx-darwin-x64': 21.3.5 + '@nx/nx-freebsd-x64': 21.3.5 + '@nx/nx-linux-arm-gnueabihf': 21.3.5 + '@nx/nx-linux-arm64-gnu': 21.3.5 + '@nx/nx-linux-arm64-musl': 21.3.5 + '@nx/nx-linux-x64-gnu': 21.3.5 + '@nx/nx-linux-x64-musl': 21.3.5 + '@nx/nx-win32-arm64-msvc': 21.3.5 + '@nx/nx-win32-x64-msvc': 21.3.5 transitivePeerDependencies: - debug @@ -23734,11 +23874,13 @@ snapshots: prettier@3.4.2: {} + prettier@3.6.2: {} + pretty-bytes@6.1.1: {} - pretty-format@29.7.0: + pretty-format@30.0.5: dependencies: - '@jest/schemas': 29.6.3 + '@jest/schemas': 30.0.5 ansi-styles: 5.2.0 react-is: 18.3.1 @@ -25178,12 +25320,21 @@ snapshots: fdir: 6.4.4(picomatch@4.0.2) picomatch: 4.0.2 + tinyglobby@0.2.14: + dependencies: + fdir: 6.4.4(picomatch@4.0.2) + picomatch: 4.0.2 + tinypool@1.0.2: {} + tinypool@1.1.1: {} + tinyrainbow@2.0.0: {} tinyspy@3.0.2: {} + tinyspy@4.0.3: {} + tmp-promise@3.0.3: dependencies: tmp: 0.2.3 @@ -25892,6 +26043,27 @@ snapshots: - tsx - yaml + vite-node@3.2.4(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0): + dependencies: + cac: 6.7.14 + debug: 4.4.1 + es-module-lexer: 1.7.0 + pathe: 2.0.3 + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) + transitivePeerDependencies: + - '@types/node' + - jiti + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + vite-plugin-checker@0.8.0(eslint@9.17.0(jiti@2.4.2))(optionator@0.9.4)(typescript@5.8.3)(vite@5.4.19(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)): dependencies: '@babel/code-frame': 7.27.1 @@ -26084,9 +26256,9 @@ snapshots: - typescript - universal-cookie - vitest-environment-nuxt@1.0.1(@types/node@22.10.5)(@vue/test-utils@2.4.6)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(magicast@0.3.5)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vitest@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(yaml@2.8.0): + vitest-environment-nuxt@1.0.1(@types/node@22.10.5)(@vue/test-utils@2.4.6)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(magicast@0.3.5)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vitest@3.2.4(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(yaml@2.8.0): dependencies: - '@nuxt/test-utils': 3.17.2(@types/node@22.10.5)(@vue/test-utils@2.4.6)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(magicast@0.3.5)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vitest@3.1.1(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(yaml@2.8.0) + '@nuxt/test-utils': 3.17.2(@types/node@22.10.5)(@vue/test-utils@2.4.6)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(magicast@0.3.5)(sass@1.85.0)(terser@5.39.1)(typescript@5.8.3)(vitest@3.2.4(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0))(yaml@2.8.0) transitivePeerDependencies: - '@cucumber/cucumber' - '@jest/globals' @@ -26151,6 +26323,48 @@ snapshots: - tsx - yaml + vitest@3.2.4(@types/node@22.10.5)(jiti@2.4.2)(jsdom@23.0.0)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0): + dependencies: + '@types/chai': 5.2.2 + '@vitest/expect': 3.2.4 + '@vitest/mocker': 3.2.4(vite@6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0)) + '@vitest/pretty-format': 3.2.4 + '@vitest/runner': 3.2.4 + '@vitest/snapshot': 3.2.4 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 + chai: 5.2.0 + debug: 4.4.1 + expect-type: 1.2.1 + magic-string: 0.30.17 + pathe: 2.0.3 + picomatch: 4.0.2 + std-env: 3.9.0 + tinybench: 2.9.0 + tinyexec: 0.3.2 + tinyglobby: 0.2.14 + tinypool: 1.1.1 + tinyrainbow: 2.0.0 + vite: 6.2.7(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) + vite-node: 3.2.4(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.1)(yaml@2.8.0) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 22.10.5 + jsdom: 23.0.0 + transitivePeerDependencies: + - jiti + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + void-elements@2.0.1: {} vscode-jsonrpc@6.0.0: {} From 92f67770e003f6024b4345460aa81d858bba411c Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Thu, 24 Jul 2025 08:22:24 -0400 Subject: [PATCH 22/26] patch(nx-plugin): removed generated tests --- .../body-response-text-plain/client.gen.ts | 16 - .../2.0.x/body-response-text-plain/index.ts | 3 - .../2.0.x/body-response-text-plain/sdk.gen.ts | 31 - .../body-response-text-plain/types.gen.ts | 21 - .../index.ts | 2 - .../types.gen.ts | 47 - .../index.ts | 2 - .../types.gen.ts | 47 - .../index.ts | 2 - .../types.gen.ts | 47 - .../index.ts | 2 - .../types.gen.ts | 47 - .../index.ts | 2 - .../types.gen.ts | 47 - .../index.ts | 2 - .../types.gen.ts | 31 - .../index.ts | 2 - .../types.gen.ts | 31 - .../index.ts | 2 - .../types.gen.ts | 31 - .../index.ts | 2 - .../types.gen.ts | 31 - .../index.ts | 2 - .../types.gen.ts | 31 - .../2.0.x/enum-names-values/index.ts | 2 - .../2.0.x/enum-names-values/types.gen.ts | 15 - .../2.0.x/exclude-deprecated/index.ts | 2 - .../2.0.x/exclude-deprecated/types.gen.ts | 21 - .../generated/2.0.x/form-data/client.gen.ts | 16 - .../test/generated/2.0.x/form-data/index.ts | 3 - .../test/generated/2.0.x/form-data/sdk.gen.ts | 31 - .../generated/2.0.x/form-data/types.gen.ts | 28 - .../@hey-api/schemas/default/schemas.gen.ts | 671 ------ .../@hey-api/sdk/default/client.gen.ts | 18 - .../plugins/@hey-api/sdk/default/index.ts | 3 - .../plugins/@hey-api/sdk/default/sdk.gen.ts | 277 --- .../plugins/@hey-api/sdk/default/types.gen.ts | 1164 ---------- .../@hey-api/sdk/throwOnError/client.gen.ts | 19 - .../@hey-api/sdk/throwOnError/index.ts | 3 - .../@hey-api/sdk/throwOnError/sdk.gen.ts | 277 --- .../@hey-api/sdk/throwOnError/types.gen.ts | 1164 ---------- .../transformers/type-format/client.gen.ts | 16 - .../transformers/type-format/index.ts | 3 - .../transformers/type-format/sdk.gen.ts | 32 - .../type-format/transformers.gen.ts | 13 - .../transformers/type-format/types.gen.ts | 32 - .../transformers/type-format/zod.gen.ts | 15 - .../read-write-only-custom-name/client.gen.ts | 16 - .../read-write-only-custom-name/index.ts | 2 - .../read-write-only-custom-name/types.gen.ts | 37 - .../read-write-only-ignore/client.gen.ts | 16 - .../read-write-only-ignore/index.ts | 2 - .../read-write-only-ignore/types.gen.ts | 33 - .../angular-query-experimental.gen.ts | 708 ------ .../asClass/client.gen.ts | 18 - .../asClass/index.ts | 3 - .../asClass/sdk.gen.ts | 356 --- .../asClass/types.gen.ts | 1164 ---------- .../angular-query-experimental.gen.ts | 709 ------ .../axios/client.gen.ts | 18 - .../angular-query-experimental/axios/index.ts | 3 - .../axios/sdk.gen.ts | 277 --- .../axios/types.gen.ts | 1164 ---------- .../angular-query-experimental.gen.ts | 708 ------ .../fetch/client.gen.ts | 18 - .../angular-query-experimental/fetch/index.ts | 3 - .../fetch/sdk.gen.ts | 277 --- .../fetch/types.gen.ts | 1164 ---------- .../asClass/@tanstack/react-query.gen.ts | 708 ------ .../react-query/asClass/client.gen.ts | 18 - .../@tanstack/react-query/asClass/index.ts | 3 - .../@tanstack/react-query/asClass/sdk.gen.ts | 356 --- .../react-query/asClass/types.gen.ts | 1164 ---------- .../axios/@tanstack/react-query.gen.ts | 709 ------ .../@tanstack/react-query/axios/client.gen.ts | 18 - .../@tanstack/react-query/axios/index.ts | 3 - .../@tanstack/react-query/axios/sdk.gen.ts | 277 --- .../@tanstack/react-query/axios/types.gen.ts | 1164 ---------- .../fetch/@tanstack/react-query.gen.ts | 708 ------ .../@tanstack/react-query/fetch/client.gen.ts | 18 - .../@tanstack/react-query/fetch/index.ts | 3 - .../@tanstack/react-query/fetch/sdk.gen.ts | 277 --- .../@tanstack/react-query/fetch/types.gen.ts | 1164 ---------- .../asClass/@tanstack/solid-query.gen.ts | 708 ------ .../solid-query/asClass/client.gen.ts | 18 - .../@tanstack/solid-query/asClass/index.ts | 3 - .../@tanstack/solid-query/asClass/sdk.gen.ts | 356 --- .../solid-query/asClass/types.gen.ts | 1164 ---------- .../axios/@tanstack/solid-query.gen.ts | 709 ------ .../@tanstack/solid-query/axios/client.gen.ts | 18 - .../@tanstack/solid-query/axios/index.ts | 3 - .../@tanstack/solid-query/axios/sdk.gen.ts | 277 --- .../@tanstack/solid-query/axios/types.gen.ts | 1164 ---------- .../fetch/@tanstack/solid-query.gen.ts | 708 ------ .../@tanstack/solid-query/fetch/client.gen.ts | 18 - .../@tanstack/solid-query/fetch/index.ts | 3 - .../@tanstack/solid-query/fetch/sdk.gen.ts | 277 --- .../@tanstack/solid-query/fetch/types.gen.ts | 1164 ---------- .../asClass/@tanstack/svelte-query.gen.ts | 708 ------ .../svelte-query/asClass/client.gen.ts | 18 - .../@tanstack/svelte-query/asClass/index.ts | 3 - .../@tanstack/svelte-query/asClass/sdk.gen.ts | 356 --- .../svelte-query/asClass/types.gen.ts | 1164 ---------- .../axios/@tanstack/svelte-query.gen.ts | 709 ------ .../svelte-query/axios/client.gen.ts | 18 - .../@tanstack/svelte-query/axios/index.ts | 3 - .../@tanstack/svelte-query/axios/sdk.gen.ts | 277 --- .../@tanstack/svelte-query/axios/types.gen.ts | 1164 ---------- .../fetch/@tanstack/svelte-query.gen.ts | 708 ------ .../svelte-query/fetch/client.gen.ts | 18 - .../@tanstack/svelte-query/fetch/index.ts | 3 - .../@tanstack/svelte-query/fetch/sdk.gen.ts | 277 --- .../@tanstack/svelte-query/fetch/types.gen.ts | 1164 ---------- .../asClass/@tanstack/vue-query.gen.ts | 708 ------ .../@tanstack/vue-query/asClass/client.gen.ts | 18 - .../@tanstack/vue-query/asClass/index.ts | 3 - .../@tanstack/vue-query/asClass/sdk.gen.ts | 356 --- .../@tanstack/vue-query/asClass/types.gen.ts | 1164 ---------- .../axios/@tanstack/vue-query.gen.ts | 709 ------ .../@tanstack/vue-query/axios/client.gen.ts | 18 - .../@tanstack/vue-query/axios/index.ts | 3 - .../@tanstack/vue-query/axios/sdk.gen.ts | 277 --- .../@tanstack/vue-query/axios/types.gen.ts | 1164 ---------- .../fetch/@tanstack/vue-query.gen.ts | 708 ------ .../@tanstack/vue-query/fetch/client.gen.ts | 18 - .../@tanstack/vue-query/fetch/index.ts | 3 - .../@tanstack/vue-query/fetch/sdk.gen.ts | 277 --- .../@tanstack/vue-query/fetch/types.gen.ts | 1164 ---------- .../plugins/fastify/default/fastify.gen.ts | 74 - .../2.0.x/plugins/fastify/default/index.ts | 2 - .../plugins/fastify/default/types.gen.ts | 1164 ---------- .../plugins/my-plugin/default/client.gen.ts | 18 - .../2.0.x/plugins/my-plugin/default/index.ts | 2 - .../plugins/my-plugin/default/types.gen.ts | 2033 ----------------- .../2.0.x/plugins/zod/default/zod.gen.ts | 271 --- .../2.0.x/read-write-only/client.gen.ts | 16 - .../generated/2.0.x/read-write-only/index.ts | 2 - .../2.0.x/read-write-only/types.gen.ts | 37 - .../2.0.x/schema-unknown/client.gen.ts | 16 - .../generated/2.0.x/schema-unknown/index.ts | 3 - .../generated/2.0.x/schema-unknown/sdk.gen.ts | 33 - .../2.0.x/schema-unknown/types.gen.ts | 136 -- .../2.0.x/security-api-key/client.gen.ts | 16 - .../generated/2.0.x/security-api-key/index.ts | 3 - .../2.0.x/security-api-key/sdk.gen.ts | 33 - .../2.0.x/security-api-key/types.gen.ts | 19 - .../2.0.x/security-basic/client.gen.ts | 16 - .../generated/2.0.x/security-basic/index.ts | 3 - .../generated/2.0.x/security-basic/sdk.gen.ts | 32 - .../2.0.x/security-basic/types.gen.ts | 19 - .../2.0.x/security-false/client.gen.ts | 16 - .../generated/2.0.x/security-false/index.ts | 3 - .../generated/2.0.x/security-false/sdk.gen.ts | 26 - .../2.0.x/security-false/types.gen.ts | 19 - .../2.0.x/security-oauth2/client.gen.ts | 16 - .../generated/2.0.x/security-oauth2/index.ts | 3 - .../2.0.x/security-oauth2/sdk.gen.ts | 32 - .../2.0.x/security-oauth2/types.gen.ts | 19 - .../2.0.x/servers-base-path/client.gen.ts | 16 - .../2.0.x/servers-base-path/index.ts | 2 - .../2.0.x/servers-base-path/types.gen.ts | 21 - .../2.0.x/servers-host/client.gen.ts | 16 - .../generated/2.0.x/servers-host/index.ts | 2 - .../generated/2.0.x/servers-host/types.gen.ts | 21 - .../generated/2.0.x/servers/client.gen.ts | 18 - .../test/generated/2.0.x/servers/index.ts | 2 - .../test/generated/2.0.x/servers/types.gen.ts | 21 - .../additional-properties-false/index.ts | 2 - .../additional-properties-false/types.gen.ts | 17 - .../3.0.x/additional-properties-true/index.ts | 2 - .../additional-properties-true/types.gen.ts | 21 - .../additional-properties-undefined/index.ts | 2 - .../types.gen.ts | 11 - .../array-items-one-of-length-1/index.ts | 2 - .../array-items-one-of-length-1/types.gen.ts | 11 - .../body-response-text-plain/client.gen.ts | 16 - .../3.0.x/body-response-text-plain/index.ts | 3 - .../3.0.x/body-response-text-plain/sdk.gen.ts | 31 - .../body-response-text-plain/types.gen.ts | 21 - .../generated/3.0.x/case-PascalCase/index.ts | 2 - .../3.0.x/case-PascalCase/types.gen.ts | 89 - .../generated/3.0.x/case-camelCase/index.ts | 2 - .../3.0.x/case-camelCase/types.gen.ts | 89 - .../generated/3.0.x/case-snake_case/index.ts | 2 - .../3.0.x/case-snake_case/types.gen.ts | 89 - .../test/generated/3.0.x/case/index.ts | 2 - .../test/generated/3.0.x/case/types.gen.ts | 89 - .../3.0.x/components-request-bodies/index.ts | 2 - .../components-request-bodies/types.gen.ts | 29 - .../generated/3.0.x/content-binary/index.ts | 2 - .../3.0.x/content-binary/types.gen.ts | 31 - .../3.0.x/discriminator-all-of/index.ts | 2 - .../3.0.x/discriminator-all-of/types.gen.ts | 49 - .../3.0.x/discriminator-any-of/index.ts | 2 - .../3.0.x/discriminator-any-of/types.gen.ts | 28 - .../3.0.x/discriminator-mapped-many/index.ts | 2 - .../discriminator-mapped-many/types.gen.ts | 19 - .../3.0.x/discriminator-one-of/index.ts | 2 - .../3.0.x/discriminator-one-of/types.gen.ts | 28 - .../test/generated/3.0.x/enum-escape/index.ts | 2 - .../generated/3.0.x/enum-escape/types.gen.ts | 11 - .../3.0.x/enum-inline-javascript/index.ts | 2 - .../3.0.x/enum-inline-javascript/types.gen.ts | 16 - .../enum-inline-typescript-namespace/index.ts | 2 - .../types.gen.ts | 16 - .../3.0.x/enum-inline-typescript/index.ts | 2 - .../3.0.x/enum-inline-typescript/types.gen.ts | 14 - .../test/generated/3.0.x/enum-inline/index.ts | 2 - .../generated/3.0.x/enum-inline/types.gen.ts | 11 - .../index.ts | 2 - .../types.gen.ts | 48 - .../index.ts | 2 - .../types.gen.ts | 48 - .../index.ts | 2 - .../types.gen.ts | 48 - .../index.ts | 2 - .../types.gen.ts | 48 - .../index.ts | 2 - .../types.gen.ts | 48 - .../index.ts | 2 - .../types.gen.ts | 31 - .../index.ts | 2 - .../types.gen.ts | 31 - .../index.ts | 2 - .../types.gen.ts | 31 - .../index.ts | 2 - .../types.gen.ts | 31 - .../index.ts | 2 - .../types.gen.ts | 31 - .../3.0.x/enum-names-values/index.ts | 2 - .../3.0.x/enum-names-values/types.gen.ts | 15 - .../test/generated/3.0.x/enum-null/index.ts | 2 - .../generated/3.0.x/enum-null/types.gen.ts | 11 - .../test/generated/3.0.x/enum-null/zod.gen.ts | 18 - .../3.0.x/exclude-deprecated/index.ts | 2 - .../3.0.x/exclude-deprecated/types.gen.ts | 21 - .../@tanstack/react-query.gen.ts | 99 - .../internal-name-conflict/client.gen.ts | 16 - .../3.0.x/internal-name-conflict/index.ts | 3 - .../3.0.x/internal-name-conflict/sdk.gen.ts | 40 - .../3.0.x/internal-name-conflict/types.gen.ts | 47 - .../generated/3.0.x/operation-204/index.ts | 2 - .../3.0.x/operation-204/types.gen.ts | 25 - .../client.gen.ts | 16 - .../parameter-explode-false-axios/index.ts | 3 - .../parameter-explode-false-axios/sdk.gen.ts | 32 - .../types.gen.ts | 21 - .../parameter-explode-false/client.gen.ts | 16 - .../3.0.x/parameter-explode-false/index.ts | 3 - .../3.0.x/parameter-explode-false/sdk.gen.ts | 32 - .../parameter-explode-false/types.gen.ts | 21 - .../@hey-api/schemas/default/schemas.gen.ts | 1987 ---------------- .../@hey-api/sdk/default/client.gen.ts | 18 - .../plugins/@hey-api/sdk/default/index.ts | 3 - .../plugins/@hey-api/sdk/default/sdk.gen.ts | 409 ---- .../plugins/@hey-api/sdk/default/types.gen.ts | 2023 ---------------- .../@hey-api/sdk/throwOnError/client.gen.ts | 19 - .../@hey-api/sdk/throwOnError/index.ts | 3 - .../@hey-api/sdk/throwOnError/sdk.gen.ts | 409 ---- .../@hey-api/sdk/throwOnError/types.gen.ts | 2023 ---------------- .../transformers/type-format/client.gen.ts | 16 - .../transformers/type-format/index.ts | 3 - .../transformers/type-format/sdk.gen.ts | 32 - .../type-format/transformers.gen.ts | 13 - .../transformers/type-format/types.gen.ts | 32 - .../transformers/type-format/zod.gen.ts | 15 - .../read-write-only-custom-name/client.gen.ts | 16 - .../read-write-only-custom-name/index.ts | 2 - .../read-write-only-custom-name/types.gen.ts | 87 - .../read-write-only-ignore/client.gen.ts | 16 - .../read-write-only-ignore/index.ts | 2 - .../read-write-only-ignore/types.gen.ts | 77 - .../angular-query-experimental.gen.ts | 1128 --------- .../asClass/client.gen.ts | 18 - .../asClass/index.ts | 3 - .../asClass/sdk.gen.ts | 506 ---- .../asClass/types.gen.ts | 2023 ---------------- .../angular-query-experimental.gen.ts | 1129 --------- .../axios/client.gen.ts | 18 - .../angular-query-experimental/axios/index.ts | 3 - .../axios/sdk.gen.ts | 410 ---- .../axios/types.gen.ts | 2023 ---------------- .../angular-query-experimental.gen.ts | 1128 --------- .../fetch/client.gen.ts | 18 - .../angular-query-experimental/fetch/index.ts | 3 - .../fetch/sdk.gen.ts | 409 ---- .../fetch/types.gen.ts | 2023 ---------------- .../asClass/@tanstack/react-query.gen.ts | 1128 --------- .../react-query/asClass/client.gen.ts | 18 - .../@tanstack/react-query/asClass/index.ts | 3 - .../@tanstack/react-query/asClass/sdk.gen.ts | 506 ---- .../react-query/asClass/types.gen.ts | 2023 ---------------- .../axios/@tanstack/react-query.gen.ts | 1129 --------- .../@tanstack/react-query/axios/client.gen.ts | 18 - .../@tanstack/react-query/axios/index.ts | 3 - .../@tanstack/react-query/axios/sdk.gen.ts | 410 ---- .../@tanstack/react-query/axios/types.gen.ts | 2023 ---------------- .../fetch/@tanstack/react-query.gen.ts | 1128 --------- .../@tanstack/react-query/fetch/client.gen.ts | 18 - .../@tanstack/react-query/fetch/index.ts | 3 - .../@tanstack/react-query/fetch/sdk.gen.ts | 409 ---- .../@tanstack/react-query/fetch/types.gen.ts | 2023 ---------------- .../asClass/@tanstack/solid-query.gen.ts | 1128 --------- .../solid-query/asClass/client.gen.ts | 18 - .../@tanstack/solid-query/asClass/index.ts | 3 - .../@tanstack/solid-query/asClass/sdk.gen.ts | 506 ---- .../solid-query/asClass/types.gen.ts | 2023 ---------------- .../axios/@tanstack/solid-query.gen.ts | 1129 --------- .../@tanstack/solid-query/axios/client.gen.ts | 18 - .../@tanstack/solid-query/axios/index.ts | 3 - .../@tanstack/solid-query/axios/sdk.gen.ts | 410 ---- .../@tanstack/solid-query/axios/types.gen.ts | 2023 ---------------- .../fetch/@tanstack/solid-query.gen.ts | 1128 --------- .../@tanstack/solid-query/fetch/client.gen.ts | 18 - .../@tanstack/solid-query/fetch/index.ts | 3 - .../@tanstack/solid-query/fetch/sdk.gen.ts | 409 ---- .../@tanstack/solid-query/fetch/types.gen.ts | 2023 ---------------- .../asClass/@tanstack/svelte-query.gen.ts | 1128 --------- .../svelte-query/asClass/client.gen.ts | 18 - .../@tanstack/svelte-query/asClass/index.ts | 3 - .../@tanstack/svelte-query/asClass/sdk.gen.ts | 506 ---- .../svelte-query/asClass/types.gen.ts | 2023 ---------------- .../axios/@tanstack/svelte-query.gen.ts | 1129 --------- .../svelte-query/axios/client.gen.ts | 18 - .../@tanstack/svelte-query/axios/index.ts | 3 - .../@tanstack/svelte-query/axios/sdk.gen.ts | 410 ---- .../@tanstack/svelte-query/axios/types.gen.ts | 2023 ---------------- .../fetch/@tanstack/svelte-query.gen.ts | 1128 --------- .../svelte-query/fetch/client.gen.ts | 18 - .../@tanstack/svelte-query/fetch/index.ts | 3 - .../@tanstack/svelte-query/fetch/sdk.gen.ts | 409 ---- .../@tanstack/svelte-query/fetch/types.gen.ts | 2023 ---------------- .../asClass/@tanstack/vue-query.gen.ts | 1128 --------- .../@tanstack/vue-query/asClass/client.gen.ts | 18 - .../@tanstack/vue-query/asClass/index.ts | 3 - .../@tanstack/vue-query/asClass/sdk.gen.ts | 506 ---- .../@tanstack/vue-query/asClass/types.gen.ts | 2023 ---------------- .../axios/@tanstack/vue-query.gen.ts | 1129 --------- .../@tanstack/vue-query/axios/client.gen.ts | 18 - .../@tanstack/vue-query/axios/index.ts | 3 - .../@tanstack/vue-query/axios/sdk.gen.ts | 410 ---- .../@tanstack/vue-query/axios/types.gen.ts | 2023 ---------------- .../fetch/@tanstack/vue-query.gen.ts | 1128 --------- .../@tanstack/vue-query/fetch/client.gen.ts | 18 - .../@tanstack/vue-query/fetch/index.ts | 3 - .../@tanstack/vue-query/fetch/sdk.gen.ts | 409 ---- .../@tanstack/vue-query/fetch/types.gen.ts | 2023 ---------------- .../plugins/fastify/default/fastify.gen.ts | 130 -- .../3.0.x/plugins/fastify/default/index.ts | 2 - .../plugins/fastify/default/types.gen.ts | 2023 ---------------- .../plugins/my-plugin/default/client.gen.ts | 18 - .../3.0.x/plugins/my-plugin/default/index.ts | 2 - .../plugins/my-plugin/default/types.gen.ts | 2033 ----------------- .../3.0.x/plugins/zod/default/zod.gen.ts | 763 ------- .../3.0.x/read-write-only/client.gen.ts | 16 - .../generated/3.0.x/read-write-only/index.ts | 2 - .../3.0.x/read-write-only/types.gen.ts | 87 - .../3.0.x/security-api-key/client.gen.ts | 16 - .../generated/3.0.x/security-api-key/index.ts | 3 - .../3.0.x/security-api-key/sdk.gen.ts | 47 - .../3.0.x/security-api-key/types.gen.ts | 33 - .../3.0.x/security-false/client.gen.ts | 16 - .../generated/3.0.x/security-false/index.ts | 3 - .../generated/3.0.x/security-false/sdk.gen.ts | 26 - .../3.0.x/security-false/types.gen.ts | 19 - .../3.0.x/security-http-bearer/client.gen.ts | 16 - .../3.0.x/security-http-bearer/index.ts | 3 - .../3.0.x/security-http-bearer/sdk.gen.ts | 32 - .../3.0.x/security-http-bearer/types.gen.ts | 19 - .../3.0.x/security-oauth2/client.gen.ts | 16 - .../generated/3.0.x/security-oauth2/index.ts | 3 - .../3.0.x/security-oauth2/sdk.gen.ts | 32 - .../3.0.x/security-oauth2/types.gen.ts | 19 - .../security-open-id-connect/client.gen.ts | 16 - .../3.0.x/security-open-id-connect/index.ts | 3 - .../3.0.x/security-open-id-connect/sdk.gen.ts | 32 - .../security-open-id-connect/types.gen.ts | 19 - .../generated/3.0.x/servers/client.gen.ts | 18 - .../test/generated/3.0.x/servers/index.ts | 2 - .../test/generated/3.0.x/servers/types.gen.ts | 21 - .../3.0.x/transformers-all-of/client.gen.ts | 16 - .../3.0.x/transformers-all-of/index.ts | 2 - .../transformers-all-of/transformers.gen.ts | 35 - .../3.0.x/transformers-all-of/types.gen.ts | 46 - .../transformers-any-of-null/client.gen.ts | 16 - .../3.0.x/transformers-any-of-null/index.ts | 2 - .../transformers.gen.ts | 23 - .../transformers-any-of-null/types.gen.ts | 27 - .../3.0.x/transformers-array/client.gen.ts | 16 - .../3.0.x/transformers-array/index.ts | 2 - .../transformers-array/transformers.gen.ts | 11 - .../3.0.x/transformers-array/types.gen.ts | 25 - .../generated/3.0.x/type-invalid/index.ts | 2 - .../generated/3.0.x/type-invalid/types.gen.ts | 7 - .../generated/3.0.x/validators/zod.gen.ts | 23 - .../additional-properties-false/index.ts | 2 - .../additional-properties-false/types.gen.ts | 17 - .../3.1.x/additional-properties-true/index.ts | 2 - .../additional-properties-true/types.gen.ts | 21 - .../additional-properties-undefined/index.ts | 2 - .../types.gen.ts | 11 - .../array-items-one-of-length-1/index.ts | 2 - .../array-items-one-of-length-1/types.gen.ts | 11 - .../body-response-text-plain/client.gen.ts | 16 - .../3.1.x/body-response-text-plain/index.ts | 3 - .../3.1.x/body-response-text-plain/sdk.gen.ts | 31 - .../body-response-text-plain/types.gen.ts | 21 - .../generated/3.1.x/case-PascalCase/index.ts | 2 - .../3.1.x/case-PascalCase/types.gen.ts | 89 - .../generated/3.1.x/case-camelCase/index.ts | 2 - .../3.1.x/case-camelCase/types.gen.ts | 89 - .../generated/3.1.x/case-snake_case/index.ts | 2 - .../3.1.x/case-snake_case/types.gen.ts | 89 - .../test/generated/3.1.x/case/index.ts | 2 - .../test/generated/3.1.x/case/types.gen.ts | 89 - .../client-axios/base-url-false/client.gen.ts | 16 - .../client-axios/base-url-false/index.ts | 2 - .../client-axios/base-url-false/types.gen.ts | 2033 ----------------- .../base-url-number/client.gen.ts | 18 - .../client-axios/base-url-number/index.ts | 2 - .../client-axios/base-url-number/types.gen.ts | 2033 ----------------- .../base-url-strict/client.gen.ts | 18 - .../client-axios/base-url-strict/index.ts | 2 - .../client-axios/base-url-strict/types.gen.ts | 2033 ----------------- .../base-url-string/client.gen.ts | 18 - .../client-axios/base-url-string/index.ts | 2 - .../client-axios/base-url-string/types.gen.ts | 2033 ----------------- .../client-axios/bundle/client.gen.ts | 18 - .../client-axios/bundle/client/index.cjs | 2 - .../client-axios/bundle/client/index.d.cts | 207 -- .../client-axios/bundle/client/index.d.ts | 207 -- .../@hey-api/client-axios/bundle/index.ts | 3 - .../@hey-api/client-axios/bundle/sdk.gen.ts | 410 ---- .../@hey-api/client-axios/bundle/types.gen.ts | 2033 ----------------- .../client-axios/default/client.gen.ts | 18 - .../@hey-api/client-axios/default/index.ts | 3 - .../@hey-api/client-axios/default/sdk.gen.ts | 410 ---- .../client-axios/default/types.gen.ts | 2033 ----------------- .../sdk-client-optional/client.gen.ts | 18 - .../client-axios/sdk-client-optional/index.ts | 3 - .../sdk-client-optional/sdk.gen.ts | 410 ---- .../sdk-client-optional/types.gen.ts | 2033 ----------------- .../sdk-client-required/client.gen.ts | 18 - .../client-axios/sdk-client-required/index.ts | 3 - .../sdk-client-required/sdk.gen.ts | 409 ---- .../sdk-client-required/types.gen.ts | 2033 ----------------- .../client-fetch/base-url-false/client.gen.ts | 16 - .../client-fetch/base-url-false/index.ts | 2 - .../client-fetch/base-url-false/types.gen.ts | 2033 ----------------- .../base-url-number/client.gen.ts | 18 - .../client-fetch/base-url-number/index.ts | 2 - .../client-fetch/base-url-number/types.gen.ts | 2033 ----------------- .../base-url-strict/client.gen.ts | 18 - .../client-fetch/base-url-strict/index.ts | 2 - .../client-fetch/base-url-strict/types.gen.ts | 2033 ----------------- .../base-url-string/client.gen.ts | 18 - .../client-fetch/base-url-string/index.ts | 2 - .../client-fetch/base-url-string/types.gen.ts | 2033 ----------------- .../client-fetch/bundle/client.gen.ts | 18 - .../client-fetch/bundle/client/index.cjs | 2 - .../client-fetch/bundle/client/index.d.cts | 238 -- .../client-fetch/bundle/client/index.d.ts | 238 -- .../@hey-api/client-fetch/bundle/index.ts | 3 - .../@hey-api/client-fetch/bundle/sdk.gen.ts | 409 ---- .../@hey-api/client-fetch/bundle/types.gen.ts | 2033 ----------------- .../client-fetch/default/client.gen.ts | 18 - .../@hey-api/client-fetch/default/index.ts | 3 - .../@hey-api/client-fetch/default/sdk.gen.ts | 409 ---- .../client-fetch/default/types.gen.ts | 2033 ----------------- .../sdk-client-optional/client.gen.ts | 18 - .../client-fetch/sdk-client-optional/index.ts | 3 - .../sdk-client-optional/sdk.gen.ts | 409 ---- .../sdk-client-optional/types.gen.ts | 2033 ----------------- .../sdk-client-required/client.gen.ts | 18 - .../client-fetch/sdk-client-required/index.ts | 3 - .../sdk-client-required/sdk.gen.ts | 408 ---- .../sdk-client-required/types.gen.ts | 2033 ----------------- .../client-next/base-url-false/client.gen.ts | 16 - .../client-next/base-url-false/index.ts | 2 - .../client-next/base-url-false/types.gen.ts | 2033 ----------------- .../client-next/base-url-number/client.gen.ts | 18 - .../client-next/base-url-number/index.ts | 2 - .../client-next/base-url-number/types.gen.ts | 2033 ----------------- .../client-next/base-url-strict/client.gen.ts | 18 - .../client-next/base-url-strict/index.ts | 2 - .../client-next/base-url-strict/types.gen.ts | 2033 ----------------- .../client-next/base-url-string/client.gen.ts | 18 - .../client-next/base-url-string/index.ts | 2 - .../client-next/base-url-string/types.gen.ts | 2033 ----------------- .../@hey-api/client-next/bundle/client.gen.ts | 18 - .../client-next/bundle/client/index.cjs | 2 - .../client-next/bundle/client/index.d.cts | 229 -- .../client-next/bundle/client/index.d.ts | 229 -- .../@hey-api/client-next/bundle/index.ts | 3 - .../@hey-api/client-next/bundle/sdk.gen.ts | 409 ---- .../@hey-api/client-next/bundle/types.gen.ts | 2033 ----------------- .../client-next/default/client.gen.ts | 18 - .../@hey-api/client-next/default/index.ts | 3 - .../@hey-api/client-next/default/sdk.gen.ts | 409 ---- .../@hey-api/client-next/default/types.gen.ts | 2033 ----------------- .../sdk-client-optional/client.gen.ts | 18 - .../client-next/sdk-client-optional/index.ts | 3 - .../sdk-client-optional/sdk.gen.ts | 409 ---- .../sdk-client-optional/types.gen.ts | 2033 ----------------- .../sdk-client-required/client.gen.ts | 18 - .../client-next/sdk-client-required/index.ts | 3 - .../sdk-client-required/sdk.gen.ts | 408 ---- .../sdk-client-required/types.gen.ts | 2033 ----------------- .../client-nuxt/base-url-false/client.gen.ts | 16 - .../client-nuxt/base-url-false/index.ts | 2 - .../client-nuxt/base-url-false/types.gen.ts | 2033 ----------------- .../client-nuxt/base-url-number/client.gen.ts | 18 - .../client-nuxt/base-url-number/index.ts | 2 - .../client-nuxt/base-url-number/types.gen.ts | 2033 ----------------- .../client-nuxt/base-url-strict/client.gen.ts | 18 - .../client-nuxt/base-url-strict/index.ts | 2 - .../client-nuxt/base-url-strict/types.gen.ts | 2033 ----------------- .../client-nuxt/base-url-string/client.gen.ts | 18 - .../client-nuxt/base-url-string/index.ts | 2 - .../client-nuxt/base-url-string/types.gen.ts | 2033 ----------------- .../@hey-api/client-nuxt/bundle/client.gen.ts | 18 - .../client-nuxt/bundle/client/index.d.ts | 193 -- .../client-nuxt/bundle/client/index.js | 2 - .../@hey-api/client-nuxt/bundle/index.ts | 3 - .../@hey-api/client-nuxt/bundle/sdk.gen.ts | 409 ---- .../@hey-api/client-nuxt/bundle/types.gen.ts | 2033 ----------------- .../client-nuxt/default/client.gen.ts | 18 - .../@hey-api/client-nuxt/default/index.ts | 3 - .../@hey-api/client-nuxt/default/sdk.gen.ts | 409 ---- .../@hey-api/client-nuxt/default/types.gen.ts | 2033 ----------------- .../sdk-client-optional/client.gen.ts | 18 - .../client-nuxt/sdk-client-optional/index.ts | 3 - .../sdk-client-optional/sdk.gen.ts | 409 ---- .../sdk-client-optional/types.gen.ts | 2033 ----------------- .../sdk-client-required/client.gen.ts | 18 - .../client-nuxt/sdk-client-required/index.ts | 3 - .../sdk-client-required/sdk.gen.ts | 408 ---- .../sdk-client-required/types.gen.ts | 2033 ----------------- .../base-url-false/client.gen.ts | 16 - .../client-custom/base-url-false/index.ts | 2 - .../client-custom/base-url-false/types.gen.ts | 2033 ----------------- .../base-url-number/client.gen.ts | 18 - .../client-custom/base-url-number/index.ts | 2 - .../base-url-number/types.gen.ts | 2033 ----------------- .../base-url-strict/client.gen.ts | 18 - .../client-custom/base-url-strict/index.ts | 2 - .../base-url-strict/types.gen.ts | 2033 ----------------- .../base-url-string/client.gen.ts | 18 - .../client-custom/base-url-string/index.ts | 2 - .../base-url-string/types.gen.ts | 2033 ----------------- .../client-custom/bundle/client.gen.ts | 18 - .../client-custom/bundle/client/index.cjs | 2 - .../client-custom/bundle/client/index.d.cts | 231 -- .../client-custom/bundle/client/index.d.ts | 231 -- .../clients/client-custom/bundle/index.ts | 3 - .../clients/client-custom/bundle/sdk.gen.ts | 409 ---- .../clients/client-custom/bundle/types.gen.ts | 2033 ----------------- .../client-custom/default/client.gen.ts | 18 - .../clients/client-custom/default/index.ts | 3 - .../clients/client-custom/default/sdk.gen.ts | 409 ---- .../client-custom/default/types.gen.ts | 2033 ----------------- .../sdk-client-optional/client.gen.ts | 18 - .../sdk-client-optional/index.ts | 3 - .../sdk-client-optional/sdk.gen.ts | 409 ---- .../sdk-client-optional/types.gen.ts | 2033 ----------------- .../sdk-client-required/client.gen.ts | 18 - .../sdk-client-required/index.ts | 3 - .../sdk-client-required/sdk.gen.ts | 408 ---- .../sdk-client-required/types.gen.ts | 2033 ----------------- .../my-client/base-url-false/client.gen.ts | 16 - .../clients/my-client/base-url-false/index.ts | 2 - .../my-client/base-url-false/types.gen.ts | 2033 ----------------- .../my-client/base-url-number/client.gen.ts | 18 - .../my-client/base-url-number/index.ts | 2 - .../my-client/base-url-number/types.gen.ts | 2033 ----------------- .../my-client/base-url-strict/client.gen.ts | 18 - .../my-client/base-url-strict/index.ts | 2 - .../my-client/base-url-strict/types.gen.ts | 2033 ----------------- .../my-client/base-url-string/client.gen.ts | 18 - .../my-client/base-url-string/index.ts | 2 - .../my-client/base-url-string/types.gen.ts | 2033 ----------------- .../clients/my-client/bundle/client.gen.ts | 18 - .../clients/my-client/bundle/client/client.ts | 167 -- .../clients/my-client/bundle/client/index.ts | 19 - .../clients/my-client/bundle/client/plugin.ts | 28 - .../clients/my-client/bundle/client/types.ts | 159 -- .../clients/my-client/bundle/client/utils.ts | 406 ---- .../3.1.x/clients/my-client/bundle/index.ts | 3 - .../3.1.x/clients/my-client/bundle/sdk.gen.ts | 409 ---- .../clients/my-client/bundle/types.gen.ts | 2033 ----------------- .../clients/my-client/default/client.gen.ts | 18 - .../3.1.x/clients/my-client/default/index.ts | 3 - .../clients/my-client/default/sdk.gen.ts | 409 ---- .../clients/my-client/default/types.gen.ts | 2033 ----------------- .../sdk-client-optional/client.gen.ts | 18 - .../my-client/sdk-client-optional/index.ts | 3 - .../my-client/sdk-client-optional/sdk.gen.ts | 409 ---- .../sdk-client-optional/types.gen.ts | 2033 ----------------- .../sdk-client-required/client.gen.ts | 18 - .../my-client/sdk-client-required/index.ts | 3 - .../my-client/sdk-client-required/sdk.gen.ts | 408 ---- .../sdk-client-required/types.gen.ts | 2033 ----------------- .../3.1.x/components-request-bodies/index.ts | 2 - .../components-request-bodies/types.gen.ts | 29 - .../test/generated/3.1.x/const/index.ts | 2 - .../test/generated/3.1.x/const/types.gen.ts | 21 - .../generated/3.1.x/content-binary/index.ts | 2 - .../3.1.x/content-binary/types.gen.ts | 31 - .../3.1.x/discriminator-all-of/index.ts | 2 - .../3.1.x/discriminator-all-of/types.gen.ts | 49 - .../3.1.x/discriminator-any-of/index.ts | 2 - .../3.1.x/discriminator-any-of/types.gen.ts | 28 - .../3.1.x/discriminator-mapped-many/index.ts | 2 - .../discriminator-mapped-many/types.gen.ts | 19 - .../3.1.x/discriminator-one-of/index.ts | 2 - .../3.1.x/discriminator-one-of/types.gen.ts | 28 - .../generated/3.1.x/duplicate-null/index.ts | 2 - .../3.1.x/duplicate-null/types.gen.ts | 10 - .../test/generated/3.1.x/enum-escape/index.ts | 2 - .../generated/3.1.x/enum-escape/types.gen.ts | 11 - .../3.1.x/enum-inline-javascript/index.ts | 2 - .../3.1.x/enum-inline-javascript/types.gen.ts | 16 - .../enum-inline-typescript-namespace/index.ts | 2 - .../types.gen.ts | 16 - .../3.1.x/enum-inline-typescript/index.ts | 2 - .../3.1.x/enum-inline-typescript/types.gen.ts | 14 - .../test/generated/3.1.x/enum-inline/index.ts | 2 - .../generated/3.1.x/enum-inline/types.gen.ts | 11 - .../index.ts | 2 - .../types.gen.ts | 48 - .../index.ts | 2 - .../types.gen.ts | 48 - .../index.ts | 2 - .../types.gen.ts | 48 - .../index.ts | 2 - .../types.gen.ts | 48 - .../index.ts | 2 - .../types.gen.ts | 48 - .../index.ts | 2 - .../types.gen.ts | 31 - .../index.ts | 2 - .../types.gen.ts | 31 - .../index.ts | 2 - .../types.gen.ts | 31 - .../index.ts | 2 - .../types.gen.ts | 31 - .../index.ts | 2 - .../types.gen.ts | 31 - .../3.1.x/enum-names-values/index.ts | 2 - .../3.1.x/enum-names-values/types.gen.ts | 15 - .../test/generated/3.1.x/enum-null/index.ts | 2 - .../generated/3.1.x/enum-null/types.gen.ts | 11 - .../test/generated/3.1.x/enum-null/zod.gen.ts | 18 - .../3.1.x/exclude-deprecated/index.ts | 2 - .../3.1.x/exclude-deprecated/types.gen.ts | 21 - .../@tanstack/react-query.gen.ts | 99 - .../internal-name-conflict/client.gen.ts | 16 - .../3.1.x/internal-name-conflict/index.ts | 3 - .../3.1.x/internal-name-conflict/sdk.gen.ts | 40 - .../3.1.x/internal-name-conflict/types.gen.ts | 47 - .../3.1.x/object-properties-all-of/index.ts | 2 - .../object-properties-all-of/types.gen.ts | 15 - .../3.1.x/object-properties-any-of/index.ts | 2 - .../object-properties-any-of/types.gen.ts | 15 - .../3.1.x/object-properties-one-of/index.ts | 2 - .../object-properties-one-of/types.gen.ts | 15 - .../generated/3.1.x/operation-204/index.ts | 2 - .../3.1.x/operation-204/types.gen.ts | 25 - .../@tanstack/react-query.gen.ts | 123 - .../3.1.x/pagination-ref-any-of/client.gen.ts | 16 - .../3.1.x/pagination-ref-any-of/index.ts | 3 - .../3.1.x/pagination-ref-any-of/sdk.gen.ts | 30 - .../3.1.x/pagination-ref-any-of/types.gen.ts | 23 - .../client.gen.ts | 16 - .../parameter-explode-false-axios/index.ts | 3 - .../parameter-explode-false-axios/sdk.gen.ts | 32 - .../types.gen.ts | 21 - .../parameter-explode-false/client.gen.ts | 16 - .../3.1.x/parameter-explode-false/index.ts | 3 - .../3.1.x/parameter-explode-false/sdk.gen.ts | 32 - .../parameter-explode-false/types.gen.ts | 21 - .../generated/3.1.x/parameter-tuple/index.ts | 2 - .../3.1.x/parameter-tuple/types.gen.ts | 26 - .../@hey-api/schemas/default/schemas.gen.ts | 1981 ---------------- .../@hey-api/sdk/default/client.gen.ts | 18 - .../plugins/@hey-api/sdk/default/index.ts | 3 - .../plugins/@hey-api/sdk/default/sdk.gen.ts | 409 ---- .../plugins/@hey-api/sdk/default/types.gen.ts | 2033 ----------------- .../@hey-api/sdk/throwOnError/client.gen.ts | 19 - .../@hey-api/sdk/throwOnError/index.ts | 3 - .../@hey-api/sdk/throwOnError/sdk.gen.ts | 409 ---- .../@hey-api/sdk/throwOnError/types.gen.ts | 2033 ----------------- .../transformers/type-format/client.gen.ts | 16 - .../transformers/type-format/index.ts | 3 - .../transformers/type-format/sdk.gen.ts | 32 - .../type-format/transformers.gen.ts | 13 - .../transformers/type-format/types.gen.ts | 32 - .../transformers/type-format/zod.gen.ts | 15 - .../read-write-only-custom-name/client.gen.ts | 16 - .../read-write-only-custom-name/index.ts | 2 - .../read-write-only-custom-name/types.gen.ts | 95 - .../read-write-only-ignore/client.gen.ts | 16 - .../read-write-only-ignore/index.ts | 2 - .../read-write-only-ignore/types.gen.ts | 85 - .../angular-query-experimental.gen.ts | 1128 --------- .../asClass/client.gen.ts | 18 - .../asClass/index.ts | 3 - .../asClass/sdk.gen.ts | 506 ---- .../asClass/types.gen.ts | 2033 ----------------- .../angular-query-experimental.gen.ts | 1129 --------- .../axios/client.gen.ts | 18 - .../angular-query-experimental/axios/index.ts | 3 - .../axios/sdk.gen.ts | 410 ---- .../axios/types.gen.ts | 2033 ----------------- .../angular-query-experimental.gen.ts | 1128 --------- .../fetch/client.gen.ts | 18 - .../angular-query-experimental/fetch/index.ts | 3 - .../fetch/sdk.gen.ts | 409 ---- .../fetch/types.gen.ts | 2033 ----------------- .../asClass/@tanstack/react-query.gen.ts | 1128 --------- .../react-query/asClass/client.gen.ts | 18 - .../@tanstack/react-query/asClass/index.ts | 3 - .../@tanstack/react-query/asClass/sdk.gen.ts | 506 ---- .../react-query/asClass/types.gen.ts | 2033 ----------------- .../axios/@tanstack/react-query.gen.ts | 1129 --------- .../@tanstack/react-query/axios/client.gen.ts | 18 - .../@tanstack/react-query/axios/index.ts | 3 - .../@tanstack/react-query/axios/sdk.gen.ts | 410 ---- .../@tanstack/react-query/axios/types.gen.ts | 2033 ----------------- .../fetch/@tanstack/react-query.gen.ts | 1128 --------- .../@tanstack/react-query/fetch/client.gen.ts | 18 - .../@tanstack/react-query/fetch/index.ts | 3 - .../@tanstack/react-query/fetch/sdk.gen.ts | 409 ---- .../@tanstack/react-query/fetch/types.gen.ts | 2033 ----------------- .../asClass/@tanstack/solid-query.gen.ts | 1128 --------- .../solid-query/asClass/client.gen.ts | 18 - .../@tanstack/solid-query/asClass/index.ts | 3 - .../@tanstack/solid-query/asClass/sdk.gen.ts | 506 ---- .../solid-query/asClass/types.gen.ts | 2033 ----------------- .../axios/@tanstack/solid-query.gen.ts | 1129 --------- .../@tanstack/solid-query/axios/client.gen.ts | 18 - .../@tanstack/solid-query/axios/index.ts | 3 - .../@tanstack/solid-query/axios/sdk.gen.ts | 410 ---- .../@tanstack/solid-query/axios/types.gen.ts | 2033 ----------------- .../fetch/@tanstack/solid-query.gen.ts | 1128 --------- .../@tanstack/solid-query/fetch/client.gen.ts | 18 - .../@tanstack/solid-query/fetch/index.ts | 3 - .../@tanstack/solid-query/fetch/sdk.gen.ts | 409 ---- .../@tanstack/solid-query/fetch/types.gen.ts | 2033 ----------------- .../asClass/@tanstack/svelte-query.gen.ts | 1128 --------- .../svelte-query/asClass/client.gen.ts | 18 - .../@tanstack/svelte-query/asClass/index.ts | 3 - .../@tanstack/svelte-query/asClass/sdk.gen.ts | 506 ---- .../svelte-query/asClass/types.gen.ts | 2033 ----------------- .../axios/@tanstack/svelte-query.gen.ts | 1129 --------- .../svelte-query/axios/client.gen.ts | 18 - .../@tanstack/svelte-query/axios/index.ts | 3 - .../@tanstack/svelte-query/axios/sdk.gen.ts | 410 ---- .../@tanstack/svelte-query/axios/types.gen.ts | 2033 ----------------- .../fetch/@tanstack/svelte-query.gen.ts | 1128 --------- .../svelte-query/fetch/client.gen.ts | 18 - .../@tanstack/svelte-query/fetch/index.ts | 3 - .../@tanstack/svelte-query/fetch/sdk.gen.ts | 409 ---- .../@tanstack/svelte-query/fetch/types.gen.ts | 2033 ----------------- .../asClass/@tanstack/vue-query.gen.ts | 1128 --------- .../@tanstack/vue-query/asClass/client.gen.ts | 18 - .../@tanstack/vue-query/asClass/index.ts | 3 - .../@tanstack/vue-query/asClass/sdk.gen.ts | 506 ---- .../@tanstack/vue-query/asClass/types.gen.ts | 2033 ----------------- .../axios/@tanstack/vue-query.gen.ts | 1129 --------- .../@tanstack/vue-query/axios/client.gen.ts | 18 - .../@tanstack/vue-query/axios/index.ts | 3 - .../@tanstack/vue-query/axios/sdk.gen.ts | 410 ---- .../@tanstack/vue-query/axios/types.gen.ts | 2033 ----------------- .../fetch/@tanstack/vue-query.gen.ts | 1128 --------- .../@tanstack/vue-query/fetch/client.gen.ts | 18 - .../@tanstack/vue-query/fetch/index.ts | 3 - .../@tanstack/vue-query/fetch/sdk.gen.ts | 409 ---- .../@tanstack/vue-query/fetch/types.gen.ts | 2033 ----------------- .../plugins/fastify/default/fastify.gen.ts | 130 -- .../3.1.x/plugins/fastify/default/index.ts | 2 - .../plugins/fastify/default/types.gen.ts | 2033 ----------------- .../plugins/my-plugin/default/client.gen.ts | 18 - .../3.1.x/plugins/my-plugin/default/index.ts | 2 - .../plugins/my-plugin/default/types.gen.ts | 2033 ----------------- .../3.1.x/plugins/zod/default/zod.gen.ts | 754 ------ .../3.1.x/read-write-only/client.gen.ts | 16 - .../generated/3.1.x/read-write-only/index.ts | 2 - .../3.1.x/read-write-only/types.gen.ts | 95 - .../test/generated/3.1.x/ref-type/index.ts | 2 - .../generated/3.1.x/ref-type/types.gen.ts | 31 - .../3.1.x/required-all-of-ref/index.ts | 2 - .../3.1.x/required-all-of-ref/types.gen.ts | 16 - .../3.1.x/required-any-of-ref/index.ts | 2 - .../3.1.x/required-any-of-ref/types.gen.ts | 14 - .../3.1.x/required-one-of-ref/index.ts | 2 - .../3.1.x/required-one-of-ref/types.gen.ts | 14 - .../generated/3.1.x/schema-const/index.ts | 2 - .../generated/3.1.x/schema-const/types.gen.ts | 23 - .../generated/3.1.x/schema-const/zod.gen.ts | 19 - .../3.1.x/security-api-key/client.gen.ts | 16 - .../generated/3.1.x/security-api-key/index.ts | 3 - .../3.1.x/security-api-key/sdk.gen.ts | 47 - .../3.1.x/security-api-key/types.gen.ts | 33 - .../3.1.x/security-false/client.gen.ts | 16 - .../generated/3.1.x/security-false/index.ts | 3 - .../generated/3.1.x/security-false/sdk.gen.ts | 26 - .../3.1.x/security-false/types.gen.ts | 19 - .../3.1.x/security-http-bearer/client.gen.ts | 16 - .../3.1.x/security-http-bearer/index.ts | 3 - .../3.1.x/security-http-bearer/sdk.gen.ts | 32 - .../3.1.x/security-http-bearer/types.gen.ts | 19 - .../3.1.x/security-oauth2/client.gen.ts | 16 - .../generated/3.1.x/security-oauth2/index.ts | 3 - .../3.1.x/security-oauth2/sdk.gen.ts | 32 - .../3.1.x/security-oauth2/types.gen.ts | 19 - .../security-open-id-connect/client.gen.ts | 16 - .../3.1.x/security-open-id-connect/index.ts | 3 - .../3.1.x/security-open-id-connect/sdk.gen.ts | 32 - .../security-open-id-connect/types.gen.ts | 19 - .../generated/3.1.x/servers/client.gen.ts | 18 - .../test/generated/3.1.x/servers/index.ts | 2 - .../test/generated/3.1.x/servers/types.gen.ts | 21 - .../3.1.x/transformers-all-of/client.gen.ts | 16 - .../3.1.x/transformers-all-of/index.ts | 2 - .../transformers-all-of/transformers.gen.ts | 35 - .../3.1.x/transformers-all-of/types.gen.ts | 46 - .../transformers-any-of-null/client.gen.ts | 16 - .../3.1.x/transformers-any-of-null/index.ts | 2 - .../transformers.gen.ts | 40 - .../transformers-any-of-null/types.gen.ts | 53 - .../3.1.x/transformers-array/client.gen.ts | 16 - .../3.1.x/transformers-array/index.ts | 2 - .../transformers-array/transformers.gen.ts | 11 - .../3.1.x/transformers-array/types.gen.ts | 25 - .../generated/3.1.x/type-invalid/index.ts | 2 - .../generated/3.1.x/type-invalid/types.gen.ts | 7 - .../generated/3.1.x/validators/zod.gen.ts | 23 - .../3.1.x/zod-bigint-min-max/zod.gen.ts | 7 - .../3.1.x/zod-circular-ref-2/zod.gen.ts | 16 - .../3.1.x/zod-circular-ref/zod.gen.ts | 19 - .../3.1.x/zod-union-merge/zod.gen.ts | 16 - .../test/generated/perf/client.gen.ts | 18 - .../test/generated/perf/index.ts | 3 - .../test/generated/perf/sdk.gen.ts | 409 ---- .../test/generated/perf/types.gen.ts | 2033 ----------------- .../test/generated/v2/core/ApiError.ts | 21 - .../generated/v2/core/ApiRequestOptions.ts | 21 - .../test/generated/v2/core/ApiResult.ts | 7 - .../generated/v2/core/CancelablePromise.ts | 126 - .../test/generated/v2/core/OpenAPI.ts | 56 - .../test/generated/v2/core/request.ts | 350 --- .../test/generated/v2/index.ts | 6 - .../test/generated/v2/schemas.gen.ts | 669 ------ .../test/generated/v2/sdk.gen.ts | 658 ------ .../test/generated/v2/types.gen.ts | 762 ------ .../generated/v3-schemas-form/schemas.gen.ts | 1834 --------------- .../generated/v3-schemas-json/schemas.gen.ts | 1994 ---------------- .../generated/v3-schemas-name/schemas.gen.ts | 1994 ---------------- .../generated/v3-types-PascalCase/index.ts | 2 - .../v3-types-PascalCase/types.gen.ts | 1970 ---------------- .../test/generated/v3/core/ApiError.ts | 21 - .../generated/v3/core/ApiRequestOptions.ts | 21 - .../test/generated/v3/core/ApiResult.ts | 7 - .../generated/v3/core/CancelablePromise.ts | 126 - .../test/generated/v3/core/OpenAPI.ts | 56 - .../test/generated/v3/core/request.ts | 350 --- .../test/generated/v3/index.ts | 6 - .../test/generated/v3/sdk.gen.ts | 913 -------- .../test/generated/v3/types.gen.ts | 1537 ------------- .../generated/v3_angular/core/ApiError.ts | 21 - .../v3_angular/core/ApiRequestOptions.ts | 21 - .../generated/v3_angular/core/ApiResult.ts | 7 - .../test/generated/v3_angular/core/OpenAPI.ts | 55 - .../test/generated/v3_angular/core/request.ts | 337 --- .../test/generated/v3_angular/index.ts | 5 - .../test/generated/v3_angular/sdk.gen.ts | 1030 --------- .../test/generated/v3_angular/types.gen.ts | 1414 ------------ .../v3_angular_transform/core/ApiError.ts | 21 - .../core/ApiRequestOptions.ts | 21 - .../v3_angular_transform/core/ApiResult.ts | 7 - .../v3_angular_transform/core/OpenAPI.ts | 55 - .../v3_angular_transform/core/request.ts | 337 --- .../generated/v3_angular_transform/index.ts | 5 - .../generated/v3_angular_transform/sdk.gen.ts | 87 - .../v3_angular_transform/types.gen.ts | 106 - .../core/ApiError.ts | 21 - .../core/ApiRequestOptions.ts | 21 - .../core/ApiResult.ts | 7 - .../v3_angular_tree_shakeable/core/OpenAPI.ts | 55 - .../v3_angular_tree_shakeable/core/request.ts | 337 --- .../v3_angular_tree_shakeable/index.ts | 5 - .../v3_angular_tree_shakeable/sdk.gen.ts | 801 ------- .../v3_angular_tree_shakeable/types.gen.ts | 1414 ------------ .../core/ApiError.ts | 21 - .../core/ApiRequestOptions.ts | 21 - .../core/ApiResult.ts | 7 - .../core/OpenAPI.ts | 55 - .../core/request.ts | 337 --- .../index.ts | 5 - .../sdk.gen.ts | 79 - .../types.gen.ts | 106 - .../test/generated/v3_axios/core/ApiError.ts | 21 - .../v3_axios/core/ApiRequestOptions.ts | 21 - .../test/generated/v3_axios/core/ApiResult.ts | 7 - .../v3_axios/core/CancelablePromise.ts | 126 - .../test/generated/v3_axios/core/OpenAPI.ts | 57 - .../test/generated/v3_axios/core/request.ts | 347 --- .../test/generated/v3_axios/index.ts | 6 - .../test/generated/v3_axios/sdk.gen.ts | 913 -------- .../test/generated/v3_axios/types.gen.ts | 1537 ------------- .../v3_axios_transform/core/ApiError.ts | 21 - .../core/ApiRequestOptions.ts | 21 - .../v3_axios_transform/core/ApiResult.ts | 7 - .../core/CancelablePromise.ts | 126 - .../v3_axios_transform/core/OpenAPI.ts | 57 - .../v3_axios_transform/core/request.ts | 347 --- .../generated/v3_axios_transform/index.ts | 6 - .../generated/v3_axios_transform/sdk.gen.ts | 80 - .../generated/v3_axios_transform/types.gen.ts | 106 - .../test/generated/v3_client/ApiClient.ts | 101 - .../test/generated/v3_client/core/ApiError.ts | 21 - .../v3_client/core/ApiRequestOptions.ts | 21 - .../generated/v3_client/core/ApiResult.ts | 7 - .../v3_client/core/BaseHttpRequest.ts | 10 - .../v3_client/core/CancelablePromise.ts | 126 - .../v3_client/core/FetchHttpRequest.ts | 22 - .../test/generated/v3_client/core/OpenAPI.ts | 56 - .../test/generated/v3_client/core/request.ts | 350 --- .../test/generated/v3_client/index.ts | 8 - .../test/generated/v3_client/sdk.gen.ts | 958 -------- .../test/generated/v3_client/types.gen.ts | 1414 ------------ .../v3_client_transform/ApiClient.ts | 35 - .../v3_client_transform/core/ApiError.ts | 21 - .../core/ApiRequestOptions.ts | 21 - .../v3_client_transform/core/ApiResult.ts | 7 - .../core/BaseHttpRequest.ts | 10 - .../core/CancelablePromise.ts | 126 - .../core/FetchHttpRequest.ts | 22 - .../v3_client_transform/core/OpenAPI.ts | 56 - .../v3_client_transform/core/request.ts | 350 --- .../generated/v3_client_transform/index.ts | 8 - .../generated/v3_client_transform/sdk.gen.ts | 81 - .../v3_client_transform/types.gen.ts | 106 - .../test/generated/v3_date/index.ts | 2 - .../test/generated/v3_date/types.gen.ts | 967 -------- .../v3_enums_typescript/core/ApiError.ts | 21 - .../core/ApiRequestOptions.ts | 21 - .../v3_enums_typescript/core/ApiResult.ts | 7 - .../core/CancelablePromise.ts | 126 - .../v3_enums_typescript/core/OpenAPI.ts | 56 - .../v3_enums_typescript/core/request.ts | 350 --- .../generated/v3_enums_typescript/index.ts | 6 - .../generated/v3_enums_typescript/sdk.gen.ts | 913 -------- .../v3_enums_typescript/types.gen.ts | 1493 ------------ .../core/ApiError.ts | 21 - .../core/ApiRequestOptions.ts | 21 - .../core/ApiResult.ts | 7 - .../core/CancelablePromise.ts | 126 - .../core/OpenAPI.ts | 56 - .../core/request.ts | 350 --- .../v3_enums_typescript_namespace/index.ts | 6 - .../v3_enums_typescript_namespace/sdk.gen.ts | 913 -------- .../types.gen.ts | 1524 ------------ .../core/ApiError.ts | 21 - .../core/ApiRequestOptions.ts | 21 - .../core/ApiResult.ts | 7 - .../core/CancelablePromise.ts | 126 - .../v3_legacy_positional_args/core/OpenAPI.ts | 56 - .../v3_legacy_positional_args/core/request.ts | 350 --- .../v3_legacy_positional_args/index.ts | 6 - .../v3_legacy_positional_args/sdk.gen.ts | 85 - .../v3_legacy_positional_args/types.gen.ts | 102 - .../test/generated/v3_no_index/client.gen.ts | 18 - .../test/generated/v3_no_index/types.gen.ts | 1970 ---------------- .../test/generated/v3_node/core/ApiError.ts | 21 - .../v3_node/core/ApiRequestOptions.ts | 21 - .../test/generated/v3_node/core/ApiResult.ts | 7 - .../v3_node/core/CancelablePromise.ts | 126 - .../test/generated/v3_node/core/OpenAPI.ts | 57 - .../test/generated/v3_node/core/request.ts | 350 --- .../test/generated/v3_node/index.ts | 6 - .../test/generated/v3_node/sdk.gen.ts | 913 -------- .../test/generated/v3_node/types.gen.ts | 1537 ------------- .../v3_node_transform/core/ApiError.ts | 21 - .../core/ApiRequestOptions.ts | 21 - .../v3_node_transform/core/ApiResult.ts | 7 - .../core/CancelablePromise.ts | 126 - .../v3_node_transform/core/OpenAPI.ts | 57 - .../v3_node_transform/core/request.ts | 350 --- .../test/generated/v3_node_transform/index.ts | 6 - .../generated/v3_node_transform/sdk.gen.ts | 80 - .../generated/v3_node_transform/types.gen.ts | 106 - .../generated/v3_options/core/ApiError.ts | 21 - .../v3_options/core/ApiRequestOptions.ts | 21 - .../generated/v3_options/core/ApiResult.ts | 7 - .../v3_options/core/CancelablePromise.ts | 126 - .../test/generated/v3_options/core/OpenAPI.ts | 56 - .../test/generated/v3_options/core/request.ts | 350 --- .../test/generated/v3_options/index.ts | 6 - .../test/generated/v3_options/sdk.gen.ts | 84 - .../test/generated/v3_options/types.gen.ts | 102 - .../generated/v3_services_filter/index.ts | 3 - .../generated/v3_services_filter/sdk.gen.ts | 75 - .../generated/v3_services_filter/types.gen.ts | 1090 --------- .../test/generated/v3_services_name/index.ts | 3 - .../generated/v3_services_name/sdk.gen.ts | 222 -- .../generated/v3_services_name/types.gen.ts | 1195 ---------- .../generated/v3_transform/core/ApiError.ts | 21 - .../v3_transform/core/ApiRequestOptions.ts | 21 - .../generated/v3_transform/core/ApiResult.ts | 7 - .../v3_transform/core/CancelablePromise.ts | 126 - .../generated/v3_transform/core/OpenAPI.ts | 56 - .../generated/v3_transform/core/request.ts | 350 --- .../test/generated/v3_transform/index.ts | 6 - .../test/generated/v3_transform/sdk.gen.ts | 80 - .../test/generated/v3_transform/types.gen.ts | 106 - .../test/generated/v3_tree_shakeable/index.ts | 3 - .../generated/v3_tree_shakeable/sdk.gen.ts | 799 ------- .../generated/v3_tree_shakeable/types.gen.ts | 1537 ------------- .../test/generated/v3_types/index.ts | 2 - .../test/generated/v3_types/types.gen.ts | 1970 ---------------- .../test/generated/v3_types_no_tree/index.ts | 2 - .../generated/v3_types_no_tree/types.gen.ts | 1970 ---------------- .../test/generated/v3_xhr/core/ApiError.ts | 21 - .../v3_xhr/core/ApiRequestOptions.ts | 21 - .../test/generated/v3_xhr/core/ApiResult.ts | 7 - .../v3_xhr/core/CancelablePromise.ts | 126 - .../test/generated/v3_xhr/core/OpenAPI.ts | 56 - .../test/generated/v3_xhr/core/request.ts | 350 --- .../test/generated/v3_xhr/index.ts | 6 - .../test/generated/v3_xhr/sdk.gen.ts | 913 -------- .../test/generated/v3_xhr/types.gen.ts | 1537 ------------- .../v3_xhr_transform/core/ApiError.ts | 21 - .../core/ApiRequestOptions.ts | 21 - .../v3_xhr_transform/core/ApiResult.ts | 7 - .../core/CancelablePromise.ts | 126 - .../v3_xhr_transform/core/OpenAPI.ts | 56 - .../v3_xhr_transform/core/request.ts | 350 --- .../test/generated/v3_xhr_transform/index.ts | 6 - .../generated/v3_xhr_transform/sdk.gen.ts | 80 - .../generated/v3_xhr_transform/types.gen.ts | 106 - 1042 files changed, 349366 deletions(-) delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-PascalCase/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-PascalCase/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-camelCase/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-camelCase/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-preserve/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-preserve/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-snake_case/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-snake_case/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-PascalCase/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-PascalCase/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-camelCase/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-camelCase/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-preserve/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-preserve/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-snake_case/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-snake_case/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/exclude-deprecated/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/exclude-deprecated/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/form-data/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/form-data/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/form-data/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/form-data/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/zod.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/fastify.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/plugins/zod/default/zod.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-basic/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-basic/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-basic/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-basic/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-false/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-false/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-false/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-false/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/servers-host/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/servers-host/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/servers-host/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/servers/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/servers/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/2.0.x/servers/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-false/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-false/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-true/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-true/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-undefined/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-undefined/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/array-items-one-of-length-1/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/array-items-one-of-length-1/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/case-PascalCase/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/case-PascalCase/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/case-camelCase/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/case-camelCase/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/case-snake_case/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/case-snake_case/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/case/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/case/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/components-request-bodies/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/components-request-bodies/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/content-binary/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/content-binary/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/discriminator-all-of/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/discriminator-all-of/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/discriminator-any-of/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/discriminator-any-of/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/discriminator-mapped-many/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/discriminator-mapped-many/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/discriminator-one-of/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/discriminator-one-of/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-escape/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-escape/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-javascript/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-javascript/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript-namespace/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript-namespace/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-inline/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-inline/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-PascalCase/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-PascalCase/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-camelCase/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-camelCase/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-preserve/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-preserve/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-snake_case/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-snake_case/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-PascalCase/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-PascalCase/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-camelCase/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-camelCase/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-preserve/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-preserve/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-snake_case/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-snake_case/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-null/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-null/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/enum-null/zod.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/exclude-deprecated/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/exclude-deprecated/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/@tanstack/react-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/operation-204/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/operation-204/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/zod.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/fastify.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/plugins/zod/default/zod.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-false/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-false/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-false/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-false/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/servers/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/servers/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/servers/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/transformers.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/transformers.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/transformers.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/type-invalid/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/type-invalid/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.0.x/validators/zod.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-false/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-false/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-true/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-true/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-undefined/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-undefined/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/array-items-one-of-length-1/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/array-items-one-of-length-1/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/case-PascalCase/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/case-PascalCase/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/case-camelCase/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/case-camelCase/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/case-snake_case/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/case-snake_case/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/case/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/case/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.cjs delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.d.cts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.d.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.cjs delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.d.cts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.d.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.cjs delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.d.cts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.d.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client/index.d.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client/index.js delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.cjs delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.d.cts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.d.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/client.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/plugin.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/types.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/utils.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/components-request-bodies/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/components-request-bodies/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/const/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/const/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/content-binary/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/content-binary/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/discriminator-all-of/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/discriminator-all-of/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/discriminator-any-of/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/discriminator-any-of/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/discriminator-mapped-many/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/discriminator-mapped-many/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/discriminator-one-of/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/discriminator-one-of/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/duplicate-null/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/duplicate-null/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-escape/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-escape/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-javascript/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-javascript/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript-namespace/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript-namespace/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-inline/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-inline/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-PascalCase/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-PascalCase/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-camelCase/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-camelCase/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-preserve/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-preserve/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-snake_case/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-snake_case/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-PascalCase/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-PascalCase/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-camelCase/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-camelCase/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-preserve/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-preserve/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-snake_case/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-snake_case/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-null/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-null/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/enum-null/zod.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/exclude-deprecated/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/exclude-deprecated/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/@tanstack/react-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/object-properties-all-of/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/object-properties-all-of/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/object-properties-any-of/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/object-properties-any-of/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/object-properties-one-of/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/object-properties-one-of/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/operation-204/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/operation-204/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/@tanstack/react-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/parameter-tuple/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/parameter-tuple/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/schemas/default/schemas.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/zod.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/fastify.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/plugins/zod/default/zod.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/ref-type/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/ref-type/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/required-all-of-ref/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/required-all-of-ref/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/required-any-of-ref/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/required-any-of-ref/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/required-one-of-ref/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/required-one-of-ref/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/schema-const/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/schema-const/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/schema-const/zod.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-false/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-false/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-false/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-false/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/servers/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/servers/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/servers/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/transformers.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/transformers.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/transformers.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/type-invalid/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/type-invalid/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/validators/zod.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/zod-bigint-min-max/zod.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/zod-circular-ref-2/zod.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/zod-circular-ref/zod.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/3.1.x/zod-union-merge/zod.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/perf/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/perf/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/perf/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/perf/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v2/core/ApiError.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v2/core/ApiRequestOptions.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v2/core/ApiResult.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v2/core/CancelablePromise.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v2/core/OpenAPI.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v2/core/request.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v2/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v2/schemas.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v2/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v2/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3-schemas-form/schemas.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3-schemas-json/schemas.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3-schemas-name/schemas.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3-types-PascalCase/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3-types-PascalCase/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3/core/ApiError.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3/core/ApiRequestOptions.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3/core/ApiResult.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3/core/CancelablePromise.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3/core/OpenAPI.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3/core/request.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular/core/ApiError.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular/core/ApiRequestOptions.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular/core/ApiResult.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular/core/OpenAPI.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular/core/request.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiError.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiRequestOptions.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiResult.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_transform/core/OpenAPI.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_transform/core/request.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_transform/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_transform/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_transform/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiError.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiRequestOptions.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiResult.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/OpenAPI.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/request.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiError.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiRequestOptions.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiResult.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/OpenAPI.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/request.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_axios/core/ApiError.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_axios/core/ApiRequestOptions.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_axios/core/ApiResult.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_axios/core/CancelablePromise.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_axios/core/OpenAPI.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_axios/core/request.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_axios/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_axios/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_axios/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiError.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiRequestOptions.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiResult.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_axios_transform/core/CancelablePromise.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_axios_transform/core/OpenAPI.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_axios_transform/core/request.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_axios_transform/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_axios_transform/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_axios_transform/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client/ApiClient.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client/core/ApiError.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client/core/ApiRequestOptions.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client/core/ApiResult.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client/core/BaseHttpRequest.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client/core/CancelablePromise.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client/core/FetchHttpRequest.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client/core/OpenAPI.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client/core/request.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/ApiClient.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiError.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiRequestOptions.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiResult.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/core/BaseHttpRequest.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/core/CancelablePromise.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/core/FetchHttpRequest.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/core/OpenAPI.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/core/request.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_client_transform/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_date/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_date/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiError.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiRequestOptions.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiResult.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/CancelablePromise.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/OpenAPI.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/request.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiError.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiRequestOptions.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiResult.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/CancelablePromise.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/OpenAPI.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/request.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiError.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiRequestOptions.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiResult.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/CancelablePromise.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/OpenAPI.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/request.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_no_index/client.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_no_index/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_node/core/ApiError.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_node/core/ApiRequestOptions.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_node/core/ApiResult.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_node/core/CancelablePromise.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_node/core/OpenAPI.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_node/core/request.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_node/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_node/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_node/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiError.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiRequestOptions.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiResult.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_node_transform/core/CancelablePromise.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_node_transform/core/OpenAPI.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_node_transform/core/request.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_node_transform/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_node_transform/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_node_transform/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_options/core/ApiError.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_options/core/ApiRequestOptions.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_options/core/ApiResult.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_options/core/CancelablePromise.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_options/core/OpenAPI.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_options/core/request.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_options/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_options/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_options/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_services_filter/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_services_filter/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_services_filter/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_services_name/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_services_name/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_services_name/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_transform/core/ApiError.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_transform/core/ApiRequestOptions.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_transform/core/ApiResult.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_transform/core/CancelablePromise.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_transform/core/OpenAPI.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_transform/core/request.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_transform/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_transform/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_transform/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_tree_shakeable/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_tree_shakeable/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_tree_shakeable/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_types/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_types/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_types_no_tree/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_types_no_tree/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiError.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiRequestOptions.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiResult.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr/core/CancelablePromise.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr/core/OpenAPI.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr/core/request.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr/types.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiError.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiRequestOptions.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiResult.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/CancelablePromise.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/OpenAPI.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/request.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr_transform/index.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr_transform/sdk.gen.ts delete mode 100644 packages/openapi-ts-tests/test/generated/v3_xhr_transform/types.gen.ts diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/sdk.gen.ts deleted file mode 100644 index d305a220c..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/sdk.gen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { PostFooData, PostFooResponse } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const postFoo = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - bodySerializer: null, - url: '/foo', - ...options, - headers: { - 'Content-Type': 'text/plain', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/types.gen.ts deleted file mode 100644 index 40b2576de..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/body-response-text-plain/types.gen.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type PostFooData = { - body: string; - path?: never; - query?: never; - url: '/foo'; -}; - -export type PostFooResponses = { - /** - * OK - */ - 200: string; -}; - -export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; - -export type ClientOptions = { - baseUrl: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-PascalCase/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-PascalCase/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-PascalCase/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-PascalCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-PascalCase/types.gen.ts deleted file mode 100644 index 0e81c5237..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-PascalCase/types.gen.ts +++ /dev/null @@ -1,47 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _110 = '1-10' | '11-20'; - -export const _110 = { - 110: '1-10', - 1120: '11-20' -} as const; - -export type MyFoo = 'myFoo' | 'myBar'; - -export const MyFoo = { - MyFoo: 'myFoo', - MyBar: 'myBar' -} as const; - -export type MyFoo2 = 'MyFoo' | 'MyBar'; - -export const MyFoo2 = { - MyFoo: 'MyFoo', - MyBar: 'MyBar' -} as const; - -export type Foo = 'foo' | 'bar' | '' | true | false; - -export const Foo = { - Foo: 'foo', - Bar: 'bar', - '': '', - True: true, - False: false -} as const; - -export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; - -export const Numbers = { - 100: 100, - 200: 200, - 300: 300, - '-100': -100, - '-200': -200, - '-300': -300 -} as const; - -export type ClientOptions = { - baseUrl: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts deleted file mode 100644 index 43dcbcf0f..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts +++ /dev/null @@ -1,47 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _110 = '1-10' | '11-20'; - -export const _110 = { - '1_10': '1-10', - '11_20': '11-20' -} as const; - -export type MyFoo = 'myFoo' | 'myBar'; - -export const MyFoo = { - MY_FOO: 'myFoo', - MY_BAR: 'myBar' -} as const; - -export type MyFoo2 = 'MyFoo' | 'MyBar'; - -export const MyFoo2 = { - MY_FOO: 'MyFoo', - MY_BAR: 'MyBar' -} as const; - -export type Foo = 'foo' | 'bar' | '' | true | false; - -export const Foo = { - FOO: 'foo', - BAR: 'bar', - '': '', - TRUE: true, - FALSE: false -} as const; - -export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; - -export const Numbers = { - 100: 100, - 200: 200, - 300: 300, - '-100': -100, - '-200': -200, - '-300': -300 -} as const; - -export type ClientOptions = { - baseUrl: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-camelCase/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-camelCase/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-camelCase/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-camelCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-camelCase/types.gen.ts deleted file mode 100644 index 6ddbb66e2..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-camelCase/types.gen.ts +++ /dev/null @@ -1,47 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _110 = '1-10' | '11-20'; - -export const _110 = { - 110: '1-10', - 1120: '11-20' -} as const; - -export type MyFoo = 'myFoo' | 'myBar'; - -export const MyFoo = { - myFoo: 'myFoo', - myBar: 'myBar' -} as const; - -export type MyFoo2 = 'MyFoo' | 'MyBar'; - -export const MyFoo2 = { - myFoo: 'MyFoo', - myBar: 'MyBar' -} as const; - -export type Foo = 'foo' | 'bar' | '' | true | false; - -export const Foo = { - foo: 'foo', - bar: 'bar', - '': '', - true: true, - false: false -} as const; - -export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; - -export const Numbers = { - 100: 100, - 200: 200, - 300: 300, - '-100': -100, - '-200': -200, - '-300': -300 -} as const; - -export type ClientOptions = { - baseUrl: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-preserve/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-preserve/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-preserve/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-preserve/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-preserve/types.gen.ts deleted file mode 100644 index 26c60818f..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-preserve/types.gen.ts +++ /dev/null @@ -1,47 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _110 = '1-10' | '11-20'; - -export const _110 = { - '1-10': '1-10', - '11-20': '11-20' -} as const; - -export type MyFoo = 'myFoo' | 'myBar'; - -export const MyFoo = { - myFoo: 'myFoo', - myBar: 'myBar' -} as const; - -export type MyFoo2 = 'MyFoo' | 'MyBar'; - -export const MyFoo2 = { - MyFoo: 'MyFoo', - MyBar: 'MyBar' -} as const; - -export type Foo = 'foo' | 'bar' | '' | true | false; - -export const Foo = { - foo: 'foo', - bar: 'bar', - '': '', - true: true, - false: false -} as const; - -export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; - -export const Numbers = { - 100: 100, - 200: 200, - 300: 300, - '-100': -100, - '-200': -200, - '-300': -300 -} as const; - -export type ClientOptions = { - baseUrl: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-snake_case/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-snake_case/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-snake_case/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-snake_case/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-snake_case/types.gen.ts deleted file mode 100644 index 57379cddf..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-javascript-snake_case/types.gen.ts +++ /dev/null @@ -1,47 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _110 = '1-10' | '11-20'; - -export const _110 = { - '1_10': '1-10', - '11_20': '11-20' -} as const; - -export type MyFoo = 'myFoo' | 'myBar'; - -export const MyFoo = { - my_foo: 'myFoo', - my_bar: 'myBar' -} as const; - -export type MyFoo2 = 'MyFoo' | 'MyBar'; - -export const MyFoo2 = { - my_foo: 'MyFoo', - my_bar: 'MyBar' -} as const; - -export type Foo = 'foo' | 'bar' | '' | true | false; - -export const Foo = { - foo: 'foo', - bar: 'bar', - '': '', - true: true, - false: false -} as const; - -export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; - -export const Numbers = { - 100: 100, - 200: 200, - 300: 300, - '-100': -100, - '-200': -200, - '-300': -300 -} as const; - -export type ClientOptions = { - baseUrl: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-PascalCase/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-PascalCase/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-PascalCase/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-PascalCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-PascalCase/types.gen.ts deleted file mode 100644 index 0383a8002..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-PascalCase/types.gen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export enum _110 { - _110 = '1-10', - _1120 = '11-20' -} - -export enum MyFoo { - MyFoo = 'myFoo', - MyBar = 'myBar' -} - -export enum MyFoo2 { - MyFoo = 'MyFoo', - MyBar = 'MyBar' -} - -export type Foo = 'foo' | 'bar' | '' | true | false; - -export enum Numbers { - _100 = 100, - _200 = 200, - _300 = 300, - '_-100' = -100, - '_-200' = -200, - '_-300' = -300 -} - -export type ClientOptions = { - baseUrl: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts deleted file mode 100644 index 57e4c00b3..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export enum _110 { - '1_10' = '1-10', - '11_20' = '11-20' -} - -export enum MyFoo { - MY_FOO = 'myFoo', - MY_BAR = 'myBar' -} - -export enum MyFoo2 { - MY_FOO = 'MyFoo', - MY_BAR = 'MyBar' -} - -export type Foo = 'foo' | 'bar' | '' | true | false; - -export enum Numbers { - _100 = 100, - _200 = 200, - _300 = 300, - '_-100' = -100, - '_-200' = -200, - '_-300' = -300 -} - -export type ClientOptions = { - baseUrl: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-camelCase/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-camelCase/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-camelCase/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-camelCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-camelCase/types.gen.ts deleted file mode 100644 index 331983c35..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-camelCase/types.gen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export enum _110 { - _110 = '1-10', - _1120 = '11-20' -} - -export enum MyFoo { - myFoo = 'myFoo', - myBar = 'myBar' -} - -export enum MyFoo2 { - myFoo = 'MyFoo', - myBar = 'MyBar' -} - -export type Foo = 'foo' | 'bar' | '' | true | false; - -export enum Numbers { - _100 = 100, - _200 = 200, - _300 = 300, - '_-100' = -100, - '_-200' = -200, - '_-300' = -300 -} - -export type ClientOptions = { - baseUrl: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-preserve/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-preserve/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-preserve/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-preserve/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-preserve/types.gen.ts deleted file mode 100644 index 73b16f183..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-preserve/types.gen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export enum _110 { - '1-10' = '1-10', - '11-20' = '11-20' -} - -export enum MyFoo { - myFoo = 'myFoo', - myBar = 'myBar' -} - -export enum MyFoo2 { - MyFoo = 'MyFoo', - MyBar = 'MyBar' -} - -export type Foo = 'foo' | 'bar' | '' | true | false; - -export enum Numbers { - _100 = 100, - _200 = 200, - _300 = 300, - '_-100' = -100, - '_-200' = -200, - '_-300' = -300 -} - -export type ClientOptions = { - baseUrl: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-snake_case/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-snake_case/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-snake_case/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-snake_case/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-snake_case/types.gen.ts deleted file mode 100644 index 5a684d859..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values-typescript-snake_case/types.gen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export enum _110 { - '1_10' = '1-10', - '11_20' = '11-20' -} - -export enum MyFoo { - my_foo = 'myFoo', - my_bar = 'myBar' -} - -export enum MyFoo2 { - my_foo = 'MyFoo', - my_bar = 'MyBar' -} - -export type Foo = 'foo' | 'bar' | '' | true | false; - -export enum Numbers { - _100 = 100, - _200 = 200, - _300 = 300, - '_-100' = -100, - '_-200' = -200, - '_-300' = -300 -} - -export type ClientOptions = { - baseUrl: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values/types.gen.ts deleted file mode 100644 index 64b608956..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/enum-names-values/types.gen.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _110 = '1-10' | '11-20'; - -export type MyFoo = 'myFoo' | 'myBar'; - -export type MyFoo2 = 'MyFoo' | 'MyBar'; - -export type Foo = 'foo' | 'bar' | '' | true | false; - -export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; - -export type ClientOptions = { - baseUrl: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/exclude-deprecated/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/exclude-deprecated/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/exclude-deprecated/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/exclude-deprecated/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/exclude-deprecated/types.gen.ts deleted file mode 100644 index 6ab2de374..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/exclude-deprecated/types.gen.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = string; - -export type PostFooData = { - body: Foo; - path?: never; - query?: never; - url: '/foo'; -}; - -export type PostFooResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type ClientOptions = { - baseUrl: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/form-data/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/form-data/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/form-data/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/form-data/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/form-data/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/form-data/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/form-data/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/form-data/sdk.gen.ts deleted file mode 100644 index e888d7115..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/form-data/sdk.gen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer } from '@hey-api/client-fetch'; -import type { PostV1FooData, PostV1FooResponse } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const postV1Foo = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/v1/foo', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/form-data/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/form-data/types.gen.ts deleted file mode 100644 index 35f2e9d76..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/form-data/types.gen.ts +++ /dev/null @@ -1,28 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - status?: number; -}; - -export type PostV1FooData = { - body: { - file: Blob | File; - info: string; - }; - path?: never; - query?: never; - url: '/v1/foo'; -}; - -export type PostV1FooResponses = { - /** - * OK - */ - 200: Foo; -}; - -export type PostV1FooResponse = PostV1FooResponses[keyof PostV1FooResponses]; - -export type ClientOptions = { - baseUrl: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts deleted file mode 100644 index dd829f310..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts +++ /dev/null @@ -1,671 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export const CommentWithBreaksSchema = { - description: `Testing multiline comments in string: First line -Second line - -Fourth line`, - type: 'integer' -} as const; - -export const CommentWithBackticksSchema = { - description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work', - type: 'integer' -} as const; - -export const CommentWithBackticksAndQuotesSchema = { - description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`, - type: 'integer' -} as const; - -export const CommentWithSlashesSchema = { - description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work', - type: 'integer' -} as const; - -export const CommentWithExpressionPlaceholdersSchema = { - description: 'Testing expression placeholders in string: ${expression} should work', - type: 'integer' -} as const; - -export const CommentWithQuotesSchema = { - description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`, - type: 'integer' -} as const; - -export const CommentWithReservedCharactersSchema = { - description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work', - type: 'integer' -} as const; - -export const SimpleIntegerSchema = { - description: 'This is a simple number', - type: 'integer' -} as const; - -export const SimpleBooleanSchema = { - description: 'This is a simple boolean', - type: 'boolean' -} as const; - -export const SimpleStringSchema = { - description: 'This is a simple string', - type: 'string' -} as const; - -export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = { - description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)', - type: 'string' -} as const; - -export const SimpleFileSchema = { - description: 'This is a simple file', - format: 'binary', - type: 'string' -} as const; - -export const SimpleReferenceSchema = { - description: 'This is a simple reference', - '$ref': '#/definitions/ModelWithString' -} as const; - -export const SimpleStringWithPatternSchema = { - description: 'This is a simple string', - type: 'string', - maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$' -} as const; - -export const EnumWithStringsSchema = { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串'] -} as const; - -export const EnumWithNumbersSchema = { - description: 'This is a simple enum with numbers', - enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3] -} as const; - -export const EnumFromDescriptionSchema = { - description: 'Success=1,Warning=2,Error=3', - type: 'number' -} as const; - -export const EnumWithExtensionsSchema = { - description: 'This is a simple enum with numbers', - enum: [200, 400, 500], - 'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'], - 'x-enum-descriptions': ['Used when the status of something is successful', 'Used when the status of something has a warning', 'Used when the status of something has an error'] -} as const; - -export const ArrayWithNumbersSchema = { - description: 'This is a simple array with numbers', - type: 'array', - items: { - type: 'integer' - } -} as const; - -export const ArrayWithBooleansSchema = { - description: 'This is a simple array with booleans', - type: 'array', - items: { - type: 'boolean' - } -} as const; - -export const ArrayWithStringsSchema = { - description: 'This is a simple array with strings', - type: 'array', - items: { - type: 'string' - } -} as const; - -export const ArrayWithReferencesSchema = { - description: 'This is a simple array with references', - type: 'array', - items: { - '$ref': '#/definitions/ModelWithString' - } -} as const; - -export const ArrayWithArraySchema = { - description: 'This is a simple array containing an array', - type: 'array', - items: { - type: 'array', - items: { - '$ref': '#/definitions/ModelWithString' - } - } -} as const; - -export const ArrayWithPropertiesSchema = { - description: 'This is a simple array with properties', - type: 'array', - items: { - type: 'object', - properties: { - foo: { - type: 'string' - }, - bar: { - type: 'string' - } - } - } -} as const; - -export const DictionaryWithStringSchema = { - description: 'This is a string dictionary', - type: 'object', - additionalProperties: { - type: 'string' - } -} as const; - -export const DictionaryWithReferenceSchema = { - description: 'This is a string reference', - type: 'object', - additionalProperties: { - '$ref': '#/definitions/ModelWithString' - } -} as const; - -export const DictionaryWithArraySchema = { - description: 'This is a complex dictionary', - type: 'object', - additionalProperties: { - type: 'array', - items: { - '$ref': '#/definitions/ModelWithString' - } - } -} as const; - -export const DictionaryWithDictionarySchema = { - description: 'This is a string dictionary', - type: 'object', - additionalProperties: { - type: 'object', - additionalProperties: { - type: 'string' - } - } -} as const; - -export const DictionaryWithPropertiesSchema = { - description: 'This is a complex dictionary', - type: 'object', - additionalProperties: { - type: 'object', - properties: { - foo: { - type: 'string' - }, - bar: { - type: 'string' - } - } - } -} as const; - -export const DateSchema = { - description: 'This is a type-only model that defines Date as a string', - type: 'string' -} as const; - -export const ModelWithIntegerSchema = { - description: 'This is a model with one number property', - type: 'object', - properties: { - prop: { - description: 'This is a simple number property', - type: 'integer' - } - } -} as const; - -export const ModelWithBooleanSchema = { - description: 'This is a model with one boolean property', - type: 'object', - properties: { - prop: { - description: 'This is a simple boolean property', - type: 'boolean' - } - } -} as const; - -export const ModelWithStringSchema = { - description: 'This is a model with one string property', - type: 'object', - properties: { - prop: { - description: 'This is a simple string property', - type: 'string' - } - } -} as const; - -export const ModelWithStringErrorSchema = { - description: 'This is a model with one string property', - type: 'object', - properties: { - prop: { - description: 'This is a simple string property', - type: 'string' - } - } -} as const; - -export const ModelWithNullableStringSchema = { - description: 'This is a model with one string property', - type: 'object', - required: ['nullableRequiredProp'], - properties: { - nullableProp: { - description: 'This is a simple string property', - type: 'string', - 'x-nullable': true - }, - nullableRequiredProp: { - description: 'This is a simple string property', - type: 'string', - 'x-nullable': true - } - } -} as const; - -export const ModelWithEnumSchema = { - description: 'This is a model with one enum', - type: 'object', - properties: { - test: { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] - }, - statusCode: { - description: 'These are the HTTP error code enums', - enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar'] - }, - bool: { - description: 'Simple boolean enum', - type: 'boolean', - enum: [true] - } - } -} as const; - -export const ModelWithEnumFromDescriptionSchema = { - description: 'This is a model with one enum', - type: 'object', - properties: { - test: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' - } - } -} as const; - -export const ModelWithNestedEnumsSchema = { - description: 'This is a model with nested enums', - type: 'object', - properties: { - dictionaryWithEnum: { - type: 'object', - additionalProperties: { - enum: ['Success', 'Warning', 'Error'] - } - }, - dictionaryWithEnumFromDescription: { - type: 'object', - additionalProperties: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' - } - }, - arrayWithEnum: { - type: 'array', - items: { - enum: ['Success', 'Warning', 'Error'] - } - }, - arrayWithDescription: { - type: 'array', - items: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' - } - } - } -} as const; - -export const ModelWithReferenceSchema = { - description: 'This is a model with one property containing a reference', - type: 'object', - properties: { - prop: { - '$ref': '#/definitions/ModelWithProperties' - } - } -} as const; - -export const ModelWithArraySchema = { - description: 'This is a model with one property containing an array', - type: 'object', - properties: { - prop: { - type: 'array', - items: { - '$ref': '#/definitions/ModelWithString' - } - }, - propWithFile: { - type: 'array', - items: { - format: 'binary', - type: 'string' - } - }, - propWithNumber: { - type: 'array', - items: { - type: 'number' - } - } - } -} as const; - -export const ModelWithDictionarySchema = { - description: 'This is a model with one property containing a dictionary', - type: 'object', - properties: { - prop: { - type: 'object', - additionalProperties: { - type: 'string' - } - } - } -} as const; - -export const ModelWithCircularReferenceSchema = { - description: 'This is a model with one property containing a circular reference', - type: 'object', - properties: { - prop: { - '$ref': '#/definitions/ModelWithCircularReference' - } - } -} as const; - -export const ModelWithPropertiesSchema = { - description: 'This is a model with one nested property', - type: 'object', - required: ['required', 'requiredAndReadOnly'], - properties: { - required: { - type: 'string' - }, - requiredAndReadOnly: { - type: 'string', - readOnly: true - }, - string: { - type: 'string' - }, - number: { - type: 'number' - }, - boolean: { - type: 'boolean' - }, - reference: { - '$ref': '#/definitions/ModelWithString' - }, - 'property with space': { - type: 'string' - }, - default: { - type: 'string' - }, - try: { - type: 'string' - }, - '@namespace.string': { - type: 'string', - readOnly: true - }, - '@namespace.integer': { - type: 'integer', - readOnly: true - } - } -} as const; - -export const ModelWithNestedPropertiesSchema = { - description: 'This is a model with one nested property', - type: 'object', - required: ['first'], - properties: { - first: { - type: 'object', - required: ['second'], - readOnly: true, - properties: { - second: { - type: 'object', - required: ['third'], - readOnly: true, - properties: { - third: { - type: 'string', - readOnly: true - } - } - } - } - } - } -} as const; - -export const ModelWithDuplicatePropertiesSchema = { - description: 'This is a model with duplicated properties', - type: 'object', - properties: { - prop: { - '$ref': '#/definitions/ModelWithString' - } - } -} as const; - -export const ModelWithOrderedPropertiesSchema = { - description: 'This is a model with ordered properties', - type: 'object', - properties: { - zebra: { - type: 'string' - }, - apple: { - type: 'string' - }, - hawaii: { - type: 'string' - } - } -} as const; - -export const ModelWithDuplicateImportsSchema = { - description: 'This is a model with duplicated imports', - type: 'object', - properties: { - propA: { - '$ref': '#/definitions/ModelWithString' - }, - propB: { - '$ref': '#/definitions/ModelWithString' - }, - propC: { - '$ref': '#/definitions/ModelWithString' - } - } -} as const; - -export const ModelThatExtendsSchema = { - description: 'This is a model that extends another model', - type: 'object', - allOf: [ - { - '$ref': '#/definitions/ModelWithString' - }, - { - type: 'object', - properties: { - propExtendsA: { - type: 'string' - }, - propExtendsB: { - '$ref': '#/definitions/ModelWithString' - } - } - } - ] -} as const; - -export const ModelThatExtendsExtendsSchema = { - description: 'This is a model that extends another model', - type: 'object', - allOf: [ - { - '$ref': '#/definitions/ModelWithString' - }, - { - '$ref': '#/definitions/ModelThatExtends' - }, - { - type: 'object', - properties: { - propExtendsC: { - type: 'string' - }, - propExtendsD: { - '$ref': '#/definitions/ModelWithString' - } - } - } - ] -} as const; - -export const defaultSchema = { - type: 'object', - properties: { - name: { - type: 'string' - } - } -} as const; - -export const ModelWithPatternSchema = { - description: 'This is a model that contains a some patterns', - type: 'object', - required: ['key', 'name'], - properties: { - key: { - maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$', - type: 'string' - }, - name: { - maxLength: 255, - type: 'string' - }, - enabled: { - type: 'boolean', - readOnly: true - }, - modified: { - type: 'string', - format: 'date-time', - readOnly: true - }, - id: { - type: 'string', - pattern: '^\\d{2}-\\d{3}-\\d{4}$' - }, - text: { - type: 'string', - pattern: '^\\w+$' - }, - patternWithSingleQuotes: { - type: 'string', - pattern: "^[a-zA-Z0-9']*$" - }, - patternWithNewline: { - type: 'string', - pattern: 'aaa\\nbbb' - }, - patternWithBacktick: { - type: 'string', - pattern: 'aaa`bbb' - } - } -} as const; - -export const parameter_ActivityParamsSchema = { - type: 'object', - properties: { - description: { - type: 'string' - }, - graduate_id: { - type: 'integer' - }, - organization_id: { - type: 'integer' - }, - parent_activity: { - type: 'integer' - }, - post_id: { - type: 'integer' - } - } -} as const; - -export const response_PostActivityResponseSchema = { - type: 'object', - properties: { - description: { - type: 'string' - }, - graduate_id: { - type: 'integer' - }, - organization_id: { - type: 'integer' - }, - parent_activity_id: { - type: 'integer' - }, - post_id: { - type: 'integer' - } - } -} as const; - -export const failure_FailureSchema = { - type: 'object', - properties: { - error: { - type: 'string' - }, - message: { - type: 'string' - }, - reference_code: { - type: 'string' - } - } -} as const; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/sdk.gen.ts deleted file mode 100644 index 8c3eadef9..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/sdk.gen.ts +++ /dev/null @@ -1,277 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const serviceWithEmptyTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions/', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options - }); -}; - -export const callWithDefaultParameters = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Body should not be unknown - * Body should not be unknown - */ -export const postApiVbyApiVersionBody = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/body', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/types.gen.ts deleted file mode 100644 index 56640474e..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/default/types.gen.ts +++ /dev/null @@ -1,1164 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - foo?: string; - bar?: string; -}>; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a type-only model that defines Date as a string - */ -export type _Date = string; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp: string | null; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -export type Default = { - name?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ParameterActivityParams = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity?: number; - post_id?: number; -}; - -export type ResponsePostActivityResponse = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity_id?: number; - post_id?: number; -}; - -export type FailureFailure = { - error?: string; - message?: string; - reference_code?: string; -}; - -export type ServiceWithEmptyTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions/'; -}; - -export type CallWithParametersData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter that goes into the query params - */ - parameterQuery: string; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query: { - /** - * This is a simple string with default value - */ - parameterString: string; - /** - * This is a simple number with default value - */ - parameterNumber: number; - /** - * This is a simple boolean with default value - */ - parameterBoolean: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - }; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: string; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: NonAsciiStringæøåÆøÅöôêÊ字符串; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PostApiVbyApiVersionBodyData = { - /** - * Body should not be unknown - */ - body: ParameterActivityParams; - path?: never; - query?: never; - url: '/api/v{api-version}/body'; -}; - -export type PostApiVbyApiVersionBodyErrors = { - /** - * Bad Request - */ - 400: FailureFailure; - /** - * Internal Server Error - */ - 500: FailureFailure; -}; - -export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; - -export type PostApiVbyApiVersionBodyResponses = { - /** - * OK - */ - 200: ResponsePostActivityResponse; -}; - -export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts deleted file mode 100644 index caa002cde..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base', - throwOnError: true -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts deleted file mode 100644 index c6bb42442..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts +++ /dev/null @@ -1,277 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const serviceWithEmptyTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions/', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options - }); -}; - -export const callWithDefaultParameters = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Body should not be unknown - * Body should not be unknown - */ -export const postApiVbyApiVersionBody = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/body', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts deleted file mode 100644 index 56640474e..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts +++ /dev/null @@ -1,1164 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - foo?: string; - bar?: string; -}>; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a type-only model that defines Date as a string - */ -export type _Date = string; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp: string | null; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -export type Default = { - name?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ParameterActivityParams = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity?: number; - post_id?: number; -}; - -export type ResponsePostActivityResponse = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity_id?: number; - post_id?: number; -}; - -export type FailureFailure = { - error?: string; - message?: string; - reference_code?: string; -}; - -export type ServiceWithEmptyTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions/'; -}; - -export type CallWithParametersData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter that goes into the query params - */ - parameterQuery: string; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query: { - /** - * This is a simple string with default value - */ - parameterString: string; - /** - * This is a simple number with default value - */ - parameterNumber: number; - /** - * This is a simple boolean with default value - */ - parameterBoolean: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - }; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: string; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: NonAsciiStringæøåÆøÅöôêÊ字符串; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PostApiVbyApiVersionBodyData = { - /** - * Body should not be unknown - */ - body: ParameterActivityParams; - path?: never; - query?: never; - url: '/api/v{api-version}/body'; -}; - -export type PostApiVbyApiVersionBodyErrors = { - /** - * Bad Request - */ - 400: FailureFailure; - /** - * Internal Server Error - */ - 500: FailureFailure; -}; - -export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; - -export type PostApiVbyApiVersionBodyResponses = { - /** - * OK - */ - 200: ResponsePostActivityResponse; -}; - -export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts deleted file mode 100644 index b3e776847..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { PostFooData, PostFooResponse } from './types.gen'; -import { postFooResponseTransformer } from './transformers.gen'; -import { zPostFooResponse } from './zod.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const postFoo = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - responseTransformer: postFooResponseTransformer, - responseValidator: async (data) => { - return await zPostFooResponse.parseAsync(data); - }, - url: '/foo', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts deleted file mode 100644 index 419690a91..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { PostFooResponse } from './types.gen'; - -const fooSchemaResponseTransformer = (data: any) => { - data.foo = BigInt(data.foo.toString()); - return data; -}; - -export const postFooResponseTransformer = async (data: any): Promise => { - data = fooSchemaResponseTransformer(data); - return data; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/types.gen.ts deleted file mode 100644 index 7066bdf0e..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/types.gen.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - bar?: number; - foo: bigint; - id: string; -}; - -export type Bar = { - foo: number; - [key: string]: number; -}; - -export type PostFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type PostFooResponses = { - /** - * OK - */ - 200: Foo; -}; - -export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; - -export type ClientOptions = { - baseUrl: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/zod.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/zod.gen.ts deleted file mode 100644 index 328fe6811..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/transformers/type-format/zod.gen.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { z } from 'zod'; - -export const zFoo = z.object({ - bar: z.number().int().optional(), - foo: z.coerce.bigint(), - id: z.string() -}); - -export const zBar = z.object({ - foo: z.number().int() -}); - -export const zPostFooResponse = zFoo; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts deleted file mode 100644 index 19e7990c4..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts +++ /dev/null @@ -1,37 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type ReadableFooRead = ReadableBarRead & { - readonly foo?: string; -}; - -export type WritableFooRead = WritableBarRead; - -export type ReadableBarRead = Baz & { - readonly bar?: string; -}; - -export type WritableBarRead = Baz; - -export type Baz = { - baz?: string; -}; - -export type PostFooReadData = { - body: WritableFooRead; - path?: never; - query?: never; - url: '/foo-read'; -}; - -export type PostFooReadResponses = { - /** - * OK - */ - 200: ReadableFooRead; -}; - -export type PostFooReadResponse = PostFooReadResponses[keyof PostFooReadResponses]; - -export type ClientOptions = { - baseUrl: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts deleted file mode 100644 index ed86a05be..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts +++ /dev/null @@ -1,33 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type FooRead = BarRead & { - readonly foo?: string; -}; - -export type BarRead = Baz & { - readonly bar?: string; -}; - -export type Baz = { - baz?: string; -}; - -export type PostFooReadData = { - body: FooRead; - path?: never; - query?: never; - url: '/foo-read'; -}; - -export type PostFooReadResponses = { - /** - * OK - */ - 200: FooRead; -}; - -export type PostFooReadResponse = PostFooReadResponses[keyof PostFooReadResponses]; - -export type ClientOptions = { - baseUrl: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts deleted file mode 100644 index ca14d791e..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts +++ /dev/null @@ -1,708 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, DefaultService, SimpleService, DescriptionsService, ParametersService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, ComplexService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError } from '@tanstack/angular-query-experimental'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); - -export const serviceWithEmptyTagOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.serviceWithEmptyTag({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: serviceWithEmptyTagQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NoContentService.callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await CollectionFormatService.collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await TypesService.types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ComplexService.complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); - -export const postApiVbyApiVersionBodyOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.postApiVbyApiVersionBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionBodyMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.postApiVbyApiVersionBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts deleted file mode 100644 index bfd6beb48..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts +++ /dev/null @@ -1,356 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export class DefaultService { - public static serviceWithEmptyTag(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static patchApiVbyApiVersionNoTag(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static fooWow(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - /** - * Body should not be unknown - * Body should not be unknown - */ - public static postApiVbyApiVersionBody(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/body', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class SimpleService { - public static deleteCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static getCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static headCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static optionsCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static patchCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static postCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static putCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); - } - -} - -export class DescriptionsService { - public static callWithDescriptions(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions/', - ...options - }); - } - -} - -export class ParametersService { - public static callWithParameters(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options - }); - } - - public static callWithWeirdParameterNames(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options - }); - } - -} - -export class DefaultsService { - public static callWithDefaultParameters(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callWithDefaultOptionalParameters(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callToTestOrderOfParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - -} - -export class DuplicateService { - public static duplicateName(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName2(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName3(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName4(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - -} - -export class NoContentService { - public static callWithNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); - } - - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - -} - -export class ResponseService { - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - - public static callWithResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithDuplicateResponses(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithResponses(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); - } - -} - -export class MultipleTags1Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags2Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags3Service { - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class CollectionFormatService { - public static collectionFormat(options: Options) { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/collectionFormat', - ...options - }); - } - -} - -export class TypesService { - public static types(options: Options) { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/types', - ...options - }); - } - -} - -export class ComplexService { - public static complexTypes(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); - } - -} - -export class HeaderService { - public static callWithResultFromHeader(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); - } - -} - -export class ErrorService { - public static testErrorCode(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts deleted file mode 100644 index 56640474e..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts +++ /dev/null @@ -1,1164 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - foo?: string; - bar?: string; -}>; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a type-only model that defines Date as a string - */ -export type _Date = string; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp: string | null; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -export type Default = { - name?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ParameterActivityParams = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity?: number; - post_id?: number; -}; - -export type ResponsePostActivityResponse = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity_id?: number; - post_id?: number; -}; - -export type FailureFailure = { - error?: string; - message?: string; - reference_code?: string; -}; - -export type ServiceWithEmptyTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions/'; -}; - -export type CallWithParametersData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter that goes into the query params - */ - parameterQuery: string; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query: { - /** - * This is a simple string with default value - */ - parameterString: string; - /** - * This is a simple number with default value - */ - parameterNumber: number; - /** - * This is a simple boolean with default value - */ - parameterBoolean: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - }; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: string; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: NonAsciiStringæøåÆøÅöôêÊ字符串; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PostApiVbyApiVersionBodyData = { - /** - * Body should not be unknown - */ - body: ParameterActivityParams; - path?: never; - query?: never; - url: '/api/v{api-version}/body'; -}; - -export type PostApiVbyApiVersionBodyErrors = { - /** - * Bad Request - */ - 400: FailureFailure; - /** - * Internal Server Error - */ - 500: FailureFailure; -}; - -export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; - -export type PostApiVbyApiVersionBodyResponses = { - /** - * OK - */ - 200: ResponsePostActivityResponse; -}; - -export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts deleted file mode 100644 index 2103361ab..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts +++ /dev/null @@ -1,709 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, serviceWithEmptyTag, patchApiVbyApiVersionNoTag, fooWow, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, callWithDescriptions, callWithParameters, callWithWeirdParameterNames, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, complexTypes, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, postApiVbyApiVersionBody } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError } from '@tanstack/angular-query-experimental'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; -import type { AxiosError } from 'axios'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); - -export const serviceWithEmptyTagOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await serviceWithEmptyTag({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: serviceWithEmptyTagQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); - -export const postApiVbyApiVersionBodyOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionBodyMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts deleted file mode 100644 index 1d97df8bc..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts deleted file mode 100644 index dac17aaa1..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts +++ /dev/null @@ -1,277 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-axios'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const serviceWithEmptyTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions/', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options - }); -}; - -export const callWithDefaultParameters = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Body should not be unknown - * Body should not be unknown - */ -export const postApiVbyApiVersionBody = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/body', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts deleted file mode 100644 index b8bb1830f..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts +++ /dev/null @@ -1,1164 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - foo?: string; - bar?: string; -}>; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a type-only model that defines Date as a string - */ -export type _Date = string; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp: string | null; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -export type Default = { - name?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ParameterActivityParams = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity?: number; - post_id?: number; -}; - -export type ResponsePostActivityResponse = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity_id?: number; - post_id?: number; -}; - -export type FailureFailure = { - error?: string; - message?: string; - reference_code?: string; -}; - -export type ServiceWithEmptyTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions/'; -}; - -export type CallWithParametersData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter that goes into the query params - */ - parameterQuery: string; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query: { - /** - * This is a simple string with default value - */ - parameterString: string; - /** - * This is a simple number with default value - */ - parameterNumber: number; - /** - * This is a simple boolean with default value - */ - parameterBoolean: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - }; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: string; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: NonAsciiStringæøåÆøÅöôêÊ字符串; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PostApiVbyApiVersionBodyData = { - /** - * Body should not be unknown - */ - body: ParameterActivityParams; - path?: never; - query?: never; - url: '/api/v{api-version}/body'; -}; - -export type PostApiVbyApiVersionBodyErrors = { - /** - * Bad Request - */ - 400: FailureFailure; - /** - * Internal Server Error - */ - 500: FailureFailure; -}; - -export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; - -export type PostApiVbyApiVersionBodyResponses = { - /** - * OK - */ - 200: ResponsePostActivityResponse; -}; - -export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts deleted file mode 100644 index e30beba43..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts +++ /dev/null @@ -1,708 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, serviceWithEmptyTag, patchApiVbyApiVersionNoTag, fooWow, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, callWithDescriptions, callWithParameters, callWithWeirdParameterNames, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, complexTypes, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, postApiVbyApiVersionBody } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError } from '@tanstack/angular-query-experimental'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); - -export const serviceWithEmptyTagOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await serviceWithEmptyTag({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: serviceWithEmptyTagQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); - -export const postApiVbyApiVersionBodyOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionBodyMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts deleted file mode 100644 index 8c3eadef9..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts +++ /dev/null @@ -1,277 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const serviceWithEmptyTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions/', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options - }); -}; - -export const callWithDefaultParameters = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Body should not be unknown - * Body should not be unknown - */ -export const postApiVbyApiVersionBody = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/body', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts deleted file mode 100644 index 56640474e..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts +++ /dev/null @@ -1,1164 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - foo?: string; - bar?: string; -}>; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a type-only model that defines Date as a string - */ -export type _Date = string; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp: string | null; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -export type Default = { - name?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ParameterActivityParams = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity?: number; - post_id?: number; -}; - -export type ResponsePostActivityResponse = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity_id?: number; - post_id?: number; -}; - -export type FailureFailure = { - error?: string; - message?: string; - reference_code?: string; -}; - -export type ServiceWithEmptyTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions/'; -}; - -export type CallWithParametersData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter that goes into the query params - */ - parameterQuery: string; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query: { - /** - * This is a simple string with default value - */ - parameterString: string; - /** - * This is a simple number with default value - */ - parameterNumber: number; - /** - * This is a simple boolean with default value - */ - parameterBoolean: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - }; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: string; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: NonAsciiStringæøåÆøÅöôêÊ字符串; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PostApiVbyApiVersionBodyData = { - /** - * Body should not be unknown - */ - body: ParameterActivityParams; - path?: never; - query?: never; - url: '/api/v{api-version}/body'; -}; - -export type PostApiVbyApiVersionBodyErrors = { - /** - * Bad Request - */ - 400: FailureFailure; - /** - * Internal Server Error - */ - 500: FailureFailure; -}; - -export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; - -export type PostApiVbyApiVersionBodyResponses = { - /** - * OK - */ - 200: ResponsePostActivityResponse; -}; - -export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts deleted file mode 100644 index dd75fa888..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts +++ /dev/null @@ -1,708 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, DefaultService, SimpleService, DescriptionsService, ParametersService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, ComplexService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; -import { queryOptions, type UseMutationOptions, type DefaultError } from '@tanstack/react-query'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); - -export const serviceWithEmptyTagOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.serviceWithEmptyTag({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: serviceWithEmptyTagQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NoContentService.callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await CollectionFormatService.collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await TypesService.types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ComplexService.complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); - -export const postApiVbyApiVersionBodyOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.postApiVbyApiVersionBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionBodyMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.postApiVbyApiVersionBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts deleted file mode 100644 index bfd6beb48..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts +++ /dev/null @@ -1,356 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export class DefaultService { - public static serviceWithEmptyTag(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static patchApiVbyApiVersionNoTag(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static fooWow(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - /** - * Body should not be unknown - * Body should not be unknown - */ - public static postApiVbyApiVersionBody(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/body', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class SimpleService { - public static deleteCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static getCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static headCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static optionsCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static patchCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static postCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static putCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); - } - -} - -export class DescriptionsService { - public static callWithDescriptions(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions/', - ...options - }); - } - -} - -export class ParametersService { - public static callWithParameters(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options - }); - } - - public static callWithWeirdParameterNames(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options - }); - } - -} - -export class DefaultsService { - public static callWithDefaultParameters(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callWithDefaultOptionalParameters(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callToTestOrderOfParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - -} - -export class DuplicateService { - public static duplicateName(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName2(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName3(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName4(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - -} - -export class NoContentService { - public static callWithNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); - } - - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - -} - -export class ResponseService { - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - - public static callWithResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithDuplicateResponses(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithResponses(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); - } - -} - -export class MultipleTags1Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags2Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags3Service { - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class CollectionFormatService { - public static collectionFormat(options: Options) { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/collectionFormat', - ...options - }); - } - -} - -export class TypesService { - public static types(options: Options) { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/types', - ...options - }); - } - -} - -export class ComplexService { - public static complexTypes(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); - } - -} - -export class HeaderService { - public static callWithResultFromHeader(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); - } - -} - -export class ErrorService { - public static testErrorCode(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/types.gen.ts deleted file mode 100644 index 56640474e..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/asClass/types.gen.ts +++ /dev/null @@ -1,1164 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - foo?: string; - bar?: string; -}>; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a type-only model that defines Date as a string - */ -export type _Date = string; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp: string | null; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -export type Default = { - name?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ParameterActivityParams = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity?: number; - post_id?: number; -}; - -export type ResponsePostActivityResponse = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity_id?: number; - post_id?: number; -}; - -export type FailureFailure = { - error?: string; - message?: string; - reference_code?: string; -}; - -export type ServiceWithEmptyTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions/'; -}; - -export type CallWithParametersData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter that goes into the query params - */ - parameterQuery: string; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query: { - /** - * This is a simple string with default value - */ - parameterString: string; - /** - * This is a simple number with default value - */ - parameterNumber: number; - /** - * This is a simple boolean with default value - */ - parameterBoolean: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - }; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: string; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: NonAsciiStringæøåÆøÅöôêÊ字符串; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PostApiVbyApiVersionBodyData = { - /** - * Body should not be unknown - */ - body: ParameterActivityParams; - path?: never; - query?: never; - url: '/api/v{api-version}/body'; -}; - -export type PostApiVbyApiVersionBodyErrors = { - /** - * Bad Request - */ - 400: FailureFailure; - /** - * Internal Server Error - */ - 500: FailureFailure; -}; - -export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; - -export type PostApiVbyApiVersionBodyResponses = { - /** - * OK - */ - 200: ResponsePostActivityResponse; -}; - -export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts deleted file mode 100644 index b471576fd..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts +++ /dev/null @@ -1,709 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, serviceWithEmptyTag, patchApiVbyApiVersionNoTag, fooWow, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, callWithDescriptions, callWithParameters, callWithWeirdParameterNames, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, complexTypes, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, postApiVbyApiVersionBody } from '../sdk.gen'; -import { queryOptions, type UseMutationOptions, type DefaultError } from '@tanstack/react-query'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; -import type { AxiosError } from 'axios'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); - -export const serviceWithEmptyTagOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await serviceWithEmptyTag({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: serviceWithEmptyTagQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); - -export const postApiVbyApiVersionBodyOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionBodyMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/client.gen.ts deleted file mode 100644 index 1d97df8bc..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/sdk.gen.ts deleted file mode 100644 index dac17aaa1..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/sdk.gen.ts +++ /dev/null @@ -1,277 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-axios'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const serviceWithEmptyTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions/', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options - }); -}; - -export const callWithDefaultParameters = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Body should not be unknown - * Body should not be unknown - */ -export const postApiVbyApiVersionBody = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/body', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/types.gen.ts deleted file mode 100644 index b8bb1830f..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/axios/types.gen.ts +++ /dev/null @@ -1,1164 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - foo?: string; - bar?: string; -}>; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a type-only model that defines Date as a string - */ -export type _Date = string; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp: string | null; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -export type Default = { - name?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ParameterActivityParams = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity?: number; - post_id?: number; -}; - -export type ResponsePostActivityResponse = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity_id?: number; - post_id?: number; -}; - -export type FailureFailure = { - error?: string; - message?: string; - reference_code?: string; -}; - -export type ServiceWithEmptyTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions/'; -}; - -export type CallWithParametersData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter that goes into the query params - */ - parameterQuery: string; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query: { - /** - * This is a simple string with default value - */ - parameterString: string; - /** - * This is a simple number with default value - */ - parameterNumber: number; - /** - * This is a simple boolean with default value - */ - parameterBoolean: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - }; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: string; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: NonAsciiStringæøåÆøÅöôêÊ字符串; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PostApiVbyApiVersionBodyData = { - /** - * Body should not be unknown - */ - body: ParameterActivityParams; - path?: never; - query?: never; - url: '/api/v{api-version}/body'; -}; - -export type PostApiVbyApiVersionBodyErrors = { - /** - * Bad Request - */ - 400: FailureFailure; - /** - * Internal Server Error - */ - 500: FailureFailure; -}; - -export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; - -export type PostApiVbyApiVersionBodyResponses = { - /** - * OK - */ - 200: ResponsePostActivityResponse; -}; - -export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts deleted file mode 100644 index ff1ce5508..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts +++ /dev/null @@ -1,708 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, serviceWithEmptyTag, patchApiVbyApiVersionNoTag, fooWow, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, callWithDescriptions, callWithParameters, callWithWeirdParameterNames, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, complexTypes, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, postApiVbyApiVersionBody } from '../sdk.gen'; -import { queryOptions, type UseMutationOptions, type DefaultError } from '@tanstack/react-query'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); - -export const serviceWithEmptyTagOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await serviceWithEmptyTag({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: serviceWithEmptyTagQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); - -export const postApiVbyApiVersionBodyOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionBodyMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts deleted file mode 100644 index 8c3eadef9..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts +++ /dev/null @@ -1,277 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const serviceWithEmptyTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions/', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options - }); -}; - -export const callWithDefaultParameters = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Body should not be unknown - * Body should not be unknown - */ -export const postApiVbyApiVersionBody = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/body', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/types.gen.ts deleted file mode 100644 index 56640474e..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/react-query/fetch/types.gen.ts +++ /dev/null @@ -1,1164 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - foo?: string; - bar?: string; -}>; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a type-only model that defines Date as a string - */ -export type _Date = string; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp: string | null; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -export type Default = { - name?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ParameterActivityParams = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity?: number; - post_id?: number; -}; - -export type ResponsePostActivityResponse = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity_id?: number; - post_id?: number; -}; - -export type FailureFailure = { - error?: string; - message?: string; - reference_code?: string; -}; - -export type ServiceWithEmptyTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions/'; -}; - -export type CallWithParametersData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter that goes into the query params - */ - parameterQuery: string; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query: { - /** - * This is a simple string with default value - */ - parameterString: string; - /** - * This is a simple number with default value - */ - parameterNumber: number; - /** - * This is a simple boolean with default value - */ - parameterBoolean: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - }; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: string; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: NonAsciiStringæøåÆøÅöôêÊ字符串; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PostApiVbyApiVersionBodyData = { - /** - * Body should not be unknown - */ - body: ParameterActivityParams; - path?: never; - query?: never; - url: '/api/v{api-version}/body'; -}; - -export type PostApiVbyApiVersionBodyErrors = { - /** - * Bad Request - */ - 400: FailureFailure; - /** - * Internal Server Error - */ - 500: FailureFailure; -}; - -export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; - -export type PostApiVbyApiVersionBodyResponses = { - /** - * OK - */ - 200: ResponsePostActivityResponse; -}; - -export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts deleted file mode 100644 index 209343aee..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts +++ /dev/null @@ -1,708 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, DefaultService, SimpleService, DescriptionsService, ParametersService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, ComplexService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError } from '@tanstack/solid-query'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); - -export const serviceWithEmptyTagOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.serviceWithEmptyTag({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: serviceWithEmptyTagQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NoContentService.callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await CollectionFormatService.collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await TypesService.types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ComplexService.complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); - -export const postApiVbyApiVersionBodyOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.postApiVbyApiVersionBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionBodyMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.postApiVbyApiVersionBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts deleted file mode 100644 index bfd6beb48..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts +++ /dev/null @@ -1,356 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export class DefaultService { - public static serviceWithEmptyTag(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static patchApiVbyApiVersionNoTag(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static fooWow(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - /** - * Body should not be unknown - * Body should not be unknown - */ - public static postApiVbyApiVersionBody(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/body', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class SimpleService { - public static deleteCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static getCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static headCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static optionsCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static patchCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static postCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static putCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); - } - -} - -export class DescriptionsService { - public static callWithDescriptions(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions/', - ...options - }); - } - -} - -export class ParametersService { - public static callWithParameters(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options - }); - } - - public static callWithWeirdParameterNames(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options - }); - } - -} - -export class DefaultsService { - public static callWithDefaultParameters(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callWithDefaultOptionalParameters(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callToTestOrderOfParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - -} - -export class DuplicateService { - public static duplicateName(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName2(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName3(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName4(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - -} - -export class NoContentService { - public static callWithNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); - } - - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - -} - -export class ResponseService { - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - - public static callWithResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithDuplicateResponses(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithResponses(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); - } - -} - -export class MultipleTags1Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags2Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags3Service { - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class CollectionFormatService { - public static collectionFormat(options: Options) { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/collectionFormat', - ...options - }); - } - -} - -export class TypesService { - public static types(options: Options) { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/types', - ...options - }); - } - -} - -export class ComplexService { - public static complexTypes(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); - } - -} - -export class HeaderService { - public static callWithResultFromHeader(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); - } - -} - -export class ErrorService { - public static testErrorCode(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/types.gen.ts deleted file mode 100644 index 56640474e..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/asClass/types.gen.ts +++ /dev/null @@ -1,1164 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - foo?: string; - bar?: string; -}>; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a type-only model that defines Date as a string - */ -export type _Date = string; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp: string | null; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -export type Default = { - name?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ParameterActivityParams = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity?: number; - post_id?: number; -}; - -export type ResponsePostActivityResponse = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity_id?: number; - post_id?: number; -}; - -export type FailureFailure = { - error?: string; - message?: string; - reference_code?: string; -}; - -export type ServiceWithEmptyTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions/'; -}; - -export type CallWithParametersData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter that goes into the query params - */ - parameterQuery: string; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query: { - /** - * This is a simple string with default value - */ - parameterString: string; - /** - * This is a simple number with default value - */ - parameterNumber: number; - /** - * This is a simple boolean with default value - */ - parameterBoolean: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - }; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: string; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: NonAsciiStringæøåÆøÅöôêÊ字符串; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PostApiVbyApiVersionBodyData = { - /** - * Body should not be unknown - */ - body: ParameterActivityParams; - path?: never; - query?: never; - url: '/api/v{api-version}/body'; -}; - -export type PostApiVbyApiVersionBodyErrors = { - /** - * Bad Request - */ - 400: FailureFailure; - /** - * Internal Server Error - */ - 500: FailureFailure; -}; - -export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; - -export type PostApiVbyApiVersionBodyResponses = { - /** - * OK - */ - 200: ResponsePostActivityResponse; -}; - -export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts deleted file mode 100644 index 9447fb08c..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts +++ /dev/null @@ -1,709 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, serviceWithEmptyTag, patchApiVbyApiVersionNoTag, fooWow, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, callWithDescriptions, callWithParameters, callWithWeirdParameterNames, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, complexTypes, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, postApiVbyApiVersionBody } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError } from '@tanstack/solid-query'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; -import type { AxiosError } from 'axios'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); - -export const serviceWithEmptyTagOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await serviceWithEmptyTag({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: serviceWithEmptyTagQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); - -export const postApiVbyApiVersionBodyOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionBodyMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts deleted file mode 100644 index 1d97df8bc..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts deleted file mode 100644 index dac17aaa1..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts +++ /dev/null @@ -1,277 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-axios'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const serviceWithEmptyTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions/', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options - }); -}; - -export const callWithDefaultParameters = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Body should not be unknown - * Body should not be unknown - */ -export const postApiVbyApiVersionBody = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/body', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/types.gen.ts deleted file mode 100644 index b8bb1830f..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/axios/types.gen.ts +++ /dev/null @@ -1,1164 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - foo?: string; - bar?: string; -}>; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a type-only model that defines Date as a string - */ -export type _Date = string; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp: string | null; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -export type Default = { - name?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ParameterActivityParams = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity?: number; - post_id?: number; -}; - -export type ResponsePostActivityResponse = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity_id?: number; - post_id?: number; -}; - -export type FailureFailure = { - error?: string; - message?: string; - reference_code?: string; -}; - -export type ServiceWithEmptyTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions/'; -}; - -export type CallWithParametersData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter that goes into the query params - */ - parameterQuery: string; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query: { - /** - * This is a simple string with default value - */ - parameterString: string; - /** - * This is a simple number with default value - */ - parameterNumber: number; - /** - * This is a simple boolean with default value - */ - parameterBoolean: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - }; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: string; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: NonAsciiStringæøåÆøÅöôêÊ字符串; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PostApiVbyApiVersionBodyData = { - /** - * Body should not be unknown - */ - body: ParameterActivityParams; - path?: never; - query?: never; - url: '/api/v{api-version}/body'; -}; - -export type PostApiVbyApiVersionBodyErrors = { - /** - * Bad Request - */ - 400: FailureFailure; - /** - * Internal Server Error - */ - 500: FailureFailure; -}; - -export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; - -export type PostApiVbyApiVersionBodyResponses = { - /** - * OK - */ - 200: ResponsePostActivityResponse; -}; - -export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts deleted file mode 100644 index d42562174..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts +++ /dev/null @@ -1,708 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, serviceWithEmptyTag, patchApiVbyApiVersionNoTag, fooWow, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, callWithDescriptions, callWithParameters, callWithWeirdParameterNames, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, complexTypes, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, postApiVbyApiVersionBody } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError } from '@tanstack/solid-query'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); - -export const serviceWithEmptyTagOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await serviceWithEmptyTag({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: serviceWithEmptyTagQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); - -export const postApiVbyApiVersionBodyOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionBodyMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts deleted file mode 100644 index 8c3eadef9..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts +++ /dev/null @@ -1,277 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const serviceWithEmptyTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions/', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options - }); -}; - -export const callWithDefaultParameters = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Body should not be unknown - * Body should not be unknown - */ -export const postApiVbyApiVersionBody = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/body', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/types.gen.ts deleted file mode 100644 index 56640474e..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/solid-query/fetch/types.gen.ts +++ /dev/null @@ -1,1164 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - foo?: string; - bar?: string; -}>; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a type-only model that defines Date as a string - */ -export type _Date = string; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp: string | null; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -export type Default = { - name?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ParameterActivityParams = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity?: number; - post_id?: number; -}; - -export type ResponsePostActivityResponse = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity_id?: number; - post_id?: number; -}; - -export type FailureFailure = { - error?: string; - message?: string; - reference_code?: string; -}; - -export type ServiceWithEmptyTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions/'; -}; - -export type CallWithParametersData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter that goes into the query params - */ - parameterQuery: string; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query: { - /** - * This is a simple string with default value - */ - parameterString: string; - /** - * This is a simple number with default value - */ - parameterNumber: number; - /** - * This is a simple boolean with default value - */ - parameterBoolean: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - }; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: string; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: NonAsciiStringæøåÆøÅöôêÊ字符串; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PostApiVbyApiVersionBodyData = { - /** - * Body should not be unknown - */ - body: ParameterActivityParams; - path?: never; - query?: never; - url: '/api/v{api-version}/body'; -}; - -export type PostApiVbyApiVersionBodyErrors = { - /** - * Bad Request - */ - 400: FailureFailure; - /** - * Internal Server Error - */ - 500: FailureFailure; -}; - -export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; - -export type PostApiVbyApiVersionBodyResponses = { - /** - * OK - */ - 200: ResponsePostActivityResponse; -}; - -export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts deleted file mode 100644 index 9d1e3eb8d..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts +++ /dev/null @@ -1,708 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, DefaultService, SimpleService, DescriptionsService, ParametersService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, ComplexService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError } from '@tanstack/svelte-query'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); - -export const serviceWithEmptyTagOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.serviceWithEmptyTag({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: serviceWithEmptyTagQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NoContentService.callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await CollectionFormatService.collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await TypesService.types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ComplexService.complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); - -export const postApiVbyApiVersionBodyOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.postApiVbyApiVersionBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionBodyMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.postApiVbyApiVersionBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts deleted file mode 100644 index bfd6beb48..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts +++ /dev/null @@ -1,356 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export class DefaultService { - public static serviceWithEmptyTag(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static patchApiVbyApiVersionNoTag(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static fooWow(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - /** - * Body should not be unknown - * Body should not be unknown - */ - public static postApiVbyApiVersionBody(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/body', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class SimpleService { - public static deleteCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static getCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static headCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static optionsCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static patchCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static postCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static putCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); - } - -} - -export class DescriptionsService { - public static callWithDescriptions(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions/', - ...options - }); - } - -} - -export class ParametersService { - public static callWithParameters(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options - }); - } - - public static callWithWeirdParameterNames(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options - }); - } - -} - -export class DefaultsService { - public static callWithDefaultParameters(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callWithDefaultOptionalParameters(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callToTestOrderOfParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - -} - -export class DuplicateService { - public static duplicateName(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName2(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName3(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName4(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - -} - -export class NoContentService { - public static callWithNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); - } - - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - -} - -export class ResponseService { - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - - public static callWithResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithDuplicateResponses(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithResponses(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); - } - -} - -export class MultipleTags1Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags2Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags3Service { - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class CollectionFormatService { - public static collectionFormat(options: Options) { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/collectionFormat', - ...options - }); - } - -} - -export class TypesService { - public static types(options: Options) { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/types', - ...options - }); - } - -} - -export class ComplexService { - public static complexTypes(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); - } - -} - -export class HeaderService { - public static callWithResultFromHeader(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); - } - -} - -export class ErrorService { - public static testErrorCode(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts deleted file mode 100644 index 56640474e..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts +++ /dev/null @@ -1,1164 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - foo?: string; - bar?: string; -}>; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a type-only model that defines Date as a string - */ -export type _Date = string; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp: string | null; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -export type Default = { - name?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ParameterActivityParams = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity?: number; - post_id?: number; -}; - -export type ResponsePostActivityResponse = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity_id?: number; - post_id?: number; -}; - -export type FailureFailure = { - error?: string; - message?: string; - reference_code?: string; -}; - -export type ServiceWithEmptyTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions/'; -}; - -export type CallWithParametersData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter that goes into the query params - */ - parameterQuery: string; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query: { - /** - * This is a simple string with default value - */ - parameterString: string; - /** - * This is a simple number with default value - */ - parameterNumber: number; - /** - * This is a simple boolean with default value - */ - parameterBoolean: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - }; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: string; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: NonAsciiStringæøåÆøÅöôêÊ字符串; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PostApiVbyApiVersionBodyData = { - /** - * Body should not be unknown - */ - body: ParameterActivityParams; - path?: never; - query?: never; - url: '/api/v{api-version}/body'; -}; - -export type PostApiVbyApiVersionBodyErrors = { - /** - * Bad Request - */ - 400: FailureFailure; - /** - * Internal Server Error - */ - 500: FailureFailure; -}; - -export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; - -export type PostApiVbyApiVersionBodyResponses = { - /** - * OK - */ - 200: ResponsePostActivityResponse; -}; - -export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts deleted file mode 100644 index 8edd12a3e..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts +++ /dev/null @@ -1,709 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, serviceWithEmptyTag, patchApiVbyApiVersionNoTag, fooWow, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, callWithDescriptions, callWithParameters, callWithWeirdParameterNames, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, complexTypes, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, postApiVbyApiVersionBody } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError } from '@tanstack/svelte-query'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; -import type { AxiosError } from 'axios'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); - -export const serviceWithEmptyTagOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await serviceWithEmptyTag({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: serviceWithEmptyTagQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); - -export const postApiVbyApiVersionBodyOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionBodyMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts deleted file mode 100644 index 1d97df8bc..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts deleted file mode 100644 index dac17aaa1..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts +++ /dev/null @@ -1,277 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-axios'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const serviceWithEmptyTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions/', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options - }); -}; - -export const callWithDefaultParameters = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Body should not be unknown - * Body should not be unknown - */ -export const postApiVbyApiVersionBody = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/body', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/types.gen.ts deleted file mode 100644 index b8bb1830f..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/axios/types.gen.ts +++ /dev/null @@ -1,1164 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - foo?: string; - bar?: string; -}>; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a type-only model that defines Date as a string - */ -export type _Date = string; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp: string | null; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -export type Default = { - name?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ParameterActivityParams = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity?: number; - post_id?: number; -}; - -export type ResponsePostActivityResponse = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity_id?: number; - post_id?: number; -}; - -export type FailureFailure = { - error?: string; - message?: string; - reference_code?: string; -}; - -export type ServiceWithEmptyTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions/'; -}; - -export type CallWithParametersData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter that goes into the query params - */ - parameterQuery: string; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query: { - /** - * This is a simple string with default value - */ - parameterString: string; - /** - * This is a simple number with default value - */ - parameterNumber: number; - /** - * This is a simple boolean with default value - */ - parameterBoolean: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - }; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: string; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: NonAsciiStringæøåÆøÅöôêÊ字符串; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PostApiVbyApiVersionBodyData = { - /** - * Body should not be unknown - */ - body: ParameterActivityParams; - path?: never; - query?: never; - url: '/api/v{api-version}/body'; -}; - -export type PostApiVbyApiVersionBodyErrors = { - /** - * Bad Request - */ - 400: FailureFailure; - /** - * Internal Server Error - */ - 500: FailureFailure; -}; - -export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; - -export type PostApiVbyApiVersionBodyResponses = { - /** - * OK - */ - 200: ResponsePostActivityResponse; -}; - -export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts deleted file mode 100644 index 861ca8e05..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts +++ /dev/null @@ -1,708 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, serviceWithEmptyTag, patchApiVbyApiVersionNoTag, fooWow, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, callWithDescriptions, callWithParameters, callWithWeirdParameterNames, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, complexTypes, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, postApiVbyApiVersionBody } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError } from '@tanstack/svelte-query'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); - -export const serviceWithEmptyTagOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await serviceWithEmptyTag({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: serviceWithEmptyTagQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); - -export const postApiVbyApiVersionBodyOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionBodyMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts deleted file mode 100644 index 8c3eadef9..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts +++ /dev/null @@ -1,277 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const serviceWithEmptyTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions/', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options - }); -}; - -export const callWithDefaultParameters = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Body should not be unknown - * Body should not be unknown - */ -export const postApiVbyApiVersionBody = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/body', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts deleted file mode 100644 index 56640474e..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts +++ /dev/null @@ -1,1164 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - foo?: string; - bar?: string; -}>; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a type-only model that defines Date as a string - */ -export type _Date = string; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp: string | null; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -export type Default = { - name?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ParameterActivityParams = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity?: number; - post_id?: number; -}; - -export type ResponsePostActivityResponse = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity_id?: number; - post_id?: number; -}; - -export type FailureFailure = { - error?: string; - message?: string; - reference_code?: string; -}; - -export type ServiceWithEmptyTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions/'; -}; - -export type CallWithParametersData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter that goes into the query params - */ - parameterQuery: string; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query: { - /** - * This is a simple string with default value - */ - parameterString: string; - /** - * This is a simple number with default value - */ - parameterNumber: number; - /** - * This is a simple boolean with default value - */ - parameterBoolean: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - }; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: string; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: NonAsciiStringæøåÆøÅöôêÊ字符串; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PostApiVbyApiVersionBodyData = { - /** - * Body should not be unknown - */ - body: ParameterActivityParams; - path?: never; - query?: never; - url: '/api/v{api-version}/body'; -}; - -export type PostApiVbyApiVersionBodyErrors = { - /** - * Bad Request - */ - 400: FailureFailure; - /** - * Internal Server Error - */ - 500: FailureFailure; -}; - -export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; - -export type PostApiVbyApiVersionBodyResponses = { - /** - * OK - */ - 200: ResponsePostActivityResponse; -}; - -export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts deleted file mode 100644 index b55f69dd6..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts +++ /dev/null @@ -1,708 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, DefaultService, SimpleService, DescriptionsService, ParametersService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, ComplexService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; -import { queryOptions, type UseMutationOptions, type DefaultError } from '@tanstack/vue-query'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); - -export const serviceWithEmptyTagOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.serviceWithEmptyTag({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: serviceWithEmptyTagQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NoContentService.callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await CollectionFormatService.collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await TypesService.types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ComplexService.complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); - -export const postApiVbyApiVersionBodyOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.postApiVbyApiVersionBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionBodyMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.postApiVbyApiVersionBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts deleted file mode 100644 index bfd6beb48..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts +++ /dev/null @@ -1,356 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export class DefaultService { - public static serviceWithEmptyTag(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static patchApiVbyApiVersionNoTag(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static fooWow(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - /** - * Body should not be unknown - * Body should not be unknown - */ - public static postApiVbyApiVersionBody(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/body', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class SimpleService { - public static deleteCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static getCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static headCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static optionsCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static patchCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static postCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static putCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); - } - -} - -export class DescriptionsService { - public static callWithDescriptions(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions/', - ...options - }); - } - -} - -export class ParametersService { - public static callWithParameters(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options - }); - } - - public static callWithWeirdParameterNames(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options - }); - } - -} - -export class DefaultsService { - public static callWithDefaultParameters(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callWithDefaultOptionalParameters(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callToTestOrderOfParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - -} - -export class DuplicateService { - public static duplicateName(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName2(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName3(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName4(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - -} - -export class NoContentService { - public static callWithNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); - } - - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - -} - -export class ResponseService { - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - - public static callWithResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithDuplicateResponses(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithResponses(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); - } - -} - -export class MultipleTags1Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags2Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags3Service { - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class CollectionFormatService { - public static collectionFormat(options: Options) { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/collectionFormat', - ...options - }); - } - -} - -export class TypesService { - public static types(options: Options) { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/types', - ...options - }); - } - -} - -export class ComplexService { - public static complexTypes(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); - } - -} - -export class HeaderService { - public static callWithResultFromHeader(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); - } - -} - -export class ErrorService { - public static testErrorCode(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/types.gen.ts deleted file mode 100644 index 56640474e..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/asClass/types.gen.ts +++ /dev/null @@ -1,1164 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - foo?: string; - bar?: string; -}>; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a type-only model that defines Date as a string - */ -export type _Date = string; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp: string | null; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -export type Default = { - name?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ParameterActivityParams = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity?: number; - post_id?: number; -}; - -export type ResponsePostActivityResponse = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity_id?: number; - post_id?: number; -}; - -export type FailureFailure = { - error?: string; - message?: string; - reference_code?: string; -}; - -export type ServiceWithEmptyTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions/'; -}; - -export type CallWithParametersData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter that goes into the query params - */ - parameterQuery: string; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query: { - /** - * This is a simple string with default value - */ - parameterString: string; - /** - * This is a simple number with default value - */ - parameterNumber: number; - /** - * This is a simple boolean with default value - */ - parameterBoolean: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - }; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: string; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: NonAsciiStringæøåÆøÅöôêÊ字符串; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PostApiVbyApiVersionBodyData = { - /** - * Body should not be unknown - */ - body: ParameterActivityParams; - path?: never; - query?: never; - url: '/api/v{api-version}/body'; -}; - -export type PostApiVbyApiVersionBodyErrors = { - /** - * Bad Request - */ - 400: FailureFailure; - /** - * Internal Server Error - */ - 500: FailureFailure; -}; - -export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; - -export type PostApiVbyApiVersionBodyResponses = { - /** - * OK - */ - 200: ResponsePostActivityResponse; -}; - -export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts deleted file mode 100644 index 53685b154..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts +++ /dev/null @@ -1,709 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, serviceWithEmptyTag, patchApiVbyApiVersionNoTag, fooWow, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, callWithDescriptions, callWithParameters, callWithWeirdParameterNames, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, complexTypes, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, postApiVbyApiVersionBody } from '../sdk.gen'; -import { queryOptions, type UseMutationOptions, type DefaultError } from '@tanstack/vue-query'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; -import type { AxiosError } from 'axios'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); - -export const serviceWithEmptyTagOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await serviceWithEmptyTag({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: serviceWithEmptyTagQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); - -export const postApiVbyApiVersionBodyOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionBodyMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts deleted file mode 100644 index 1d97df8bc..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts deleted file mode 100644 index dac17aaa1..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts +++ /dev/null @@ -1,277 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-axios'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const serviceWithEmptyTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions/', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options - }); -}; - -export const callWithDefaultParameters = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Body should not be unknown - * Body should not be unknown - */ -export const postApiVbyApiVersionBody = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/body', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/types.gen.ts deleted file mode 100644 index b8bb1830f..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/axios/types.gen.ts +++ /dev/null @@ -1,1164 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - foo?: string; - bar?: string; -}>; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a type-only model that defines Date as a string - */ -export type _Date = string; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp: string | null; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -export type Default = { - name?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ParameterActivityParams = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity?: number; - post_id?: number; -}; - -export type ResponsePostActivityResponse = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity_id?: number; - post_id?: number; -}; - -export type FailureFailure = { - error?: string; - message?: string; - reference_code?: string; -}; - -export type ServiceWithEmptyTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions/'; -}; - -export type CallWithParametersData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter that goes into the query params - */ - parameterQuery: string; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query: { - /** - * This is a simple string with default value - */ - parameterString: string; - /** - * This is a simple number with default value - */ - parameterNumber: number; - /** - * This is a simple boolean with default value - */ - parameterBoolean: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - }; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: string; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: NonAsciiStringæøåÆøÅöôêÊ字符串; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PostApiVbyApiVersionBodyData = { - /** - * Body should not be unknown - */ - body: ParameterActivityParams; - path?: never; - query?: never; - url: '/api/v{api-version}/body'; -}; - -export type PostApiVbyApiVersionBodyErrors = { - /** - * Bad Request - */ - 400: FailureFailure; - /** - * Internal Server Error - */ - 500: FailureFailure; -}; - -export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; - -export type PostApiVbyApiVersionBodyResponses = { - /** - * OK - */ - 200: ResponsePostActivityResponse; -}; - -export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts deleted file mode 100644 index 932ae795e..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts +++ /dev/null @@ -1,708 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, serviceWithEmptyTag, patchApiVbyApiVersionNoTag, fooWow, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, callWithDescriptions, callWithParameters, callWithWeirdParameterNames, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, complexTypes, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, postApiVbyApiVersionBody } from '../sdk.gen'; -import { queryOptions, type UseMutationOptions, type DefaultError } from '@tanstack/vue-query'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); - -export const serviceWithEmptyTagOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await serviceWithEmptyTag({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: serviceWithEmptyTagQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionBodyQueryKey = (options: Options) => createQueryKey('postApiVbyApiVersionBody', options); - -export const postApiVbyApiVersionBodyOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionBodyMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts deleted file mode 100644 index 8c3eadef9..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts +++ /dev/null @@ -1,277 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyBData, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, ComplexTypesData, ComplexTypesResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponse, PostApiVbyApiVersionBodyError } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const serviceWithEmptyTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions/', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options - }); -}; - -export const callWithDefaultParameters = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Body should not be unknown - * Body should not be unknown - */ -export const postApiVbyApiVersionBody = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/body', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/types.gen.ts deleted file mode 100644 index 56640474e..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/@tanstack/vue-query/fetch/types.gen.ts +++ /dev/null @@ -1,1164 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - foo?: string; - bar?: string; -}>; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a type-only model that defines Date as a string - */ -export type _Date = string; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp: string | null; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -export type Default = { - name?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ParameterActivityParams = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity?: number; - post_id?: number; -}; - -export type ResponsePostActivityResponse = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity_id?: number; - post_id?: number; -}; - -export type FailureFailure = { - error?: string; - message?: string; - reference_code?: string; -}; - -export type ServiceWithEmptyTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions/'; -}; - -export type CallWithParametersData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter that goes into the query params - */ - parameterQuery: string; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query: { - /** - * This is a simple string with default value - */ - parameterString: string; - /** - * This is a simple number with default value - */ - parameterNumber: number; - /** - * This is a simple boolean with default value - */ - parameterBoolean: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - }; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: string; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: NonAsciiStringæøåÆøÅöôêÊ字符串; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PostApiVbyApiVersionBodyData = { - /** - * Body should not be unknown - */ - body: ParameterActivityParams; - path?: never; - query?: never; - url: '/api/v{api-version}/body'; -}; - -export type PostApiVbyApiVersionBodyErrors = { - /** - * Bad Request - */ - 400: FailureFailure; - /** - * Internal Server Error - */ - 500: FailureFailure; -}; - -export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; - -export type PostApiVbyApiVersionBodyResponses = { - /** - * OK - */ - 200: ResponsePostActivityResponse; -}; - -export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/fastify.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/fastify.gen.ts deleted file mode 100644 index 9edc94612..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/fastify.gen.ts +++ /dev/null @@ -1,74 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, CallWithNoContentResponseResponses, CallWithResponseAndNoContentResponseResponses, DummyAResponses, DummyBResponses, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponses, CallWithResponsesErrors, CallWithResponsesResponses, CollectionFormatData, TypesData, TypesResponses, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponses, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Responses, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyErrors, PostApiVbyApiVersionBodyResponses } from './types.gen'; -import type { RouteHandler } from 'fastify'; - -export type RouteHandlers = { - callWithDescriptions: RouteHandler<{ - Querystring?: CallWithDescriptionsData['query']; - }>; - callWithParameters: RouteHandler<{ - Headers: CallWithParametersData['headers']; - Params: CallWithParametersData['path']; - Querystring: CallWithParametersData['query']; - }>; - callWithWeirdParameterNames: RouteHandler<{ - Headers: CallWithWeirdParameterNamesData['headers']; - Params: CallWithWeirdParameterNamesData['path']; - Querystring: CallWithWeirdParameterNamesData['query']; - }>; - callWithDefaultParameters: RouteHandler<{ - Querystring: CallWithDefaultParametersData['query']; - }>; - callWithDefaultOptionalParameters: RouteHandler<{ - Querystring?: CallWithDefaultOptionalParametersData['query']; - }>; - callToTestOrderOfParams: RouteHandler<{ - Querystring: CallToTestOrderOfParamsData['query']; - }>; - callWithNoContentResponse: RouteHandler<{ - Reply: CallWithNoContentResponseResponses; - }>; - callWithResponseAndNoContentResponse: RouteHandler<{ - Reply: CallWithResponseAndNoContentResponseResponses; - }>; - dummyA: RouteHandler<{ - Reply: DummyAResponses; - }>; - dummyB: RouteHandler<{ - Reply: DummyBResponses; - }>; - callWithDuplicateResponses: RouteHandler<{ - Reply: Omit & CallWithDuplicateResponsesResponses; - }>; - callWithResponses: RouteHandler<{ - Reply: Omit & CallWithResponsesResponses; - }>; - collectionFormat: RouteHandler<{ - Querystring: CollectionFormatData['query']; - }>; - types: RouteHandler<{ - Params?: TypesData['path']; - Querystring: TypesData['query']; - Reply: TypesResponses; - }>; - complexTypes: RouteHandler<{ - Querystring: ComplexTypesData['query']; - Reply: ComplexTypesErrors & ComplexTypesResponses; - }>; - callWithResultFromHeader: RouteHandler<{ - Reply: CallWithResultFromHeaderErrors & CallWithResultFromHeaderResponses; - }>; - testErrorCode: RouteHandler<{ - Querystring: TestErrorCodeData['query']; - Reply: TestErrorCodeErrors & TestErrorCodeResponses; - }>; - nonAsciiæøåÆøÅöôêÊ字符串: RouteHandler<{ - Querystring: NonAsciiæøåÆøÅöôêÊ字符串Data['query']; - Reply: NonAsciiæøåÆøÅöôêÊ字符串Responses; - }>; - postApiVbyApiVersionBody: RouteHandler<{ - Body: PostApiVbyApiVersionBodyData['body']; - Reply: PostApiVbyApiVersionBodyErrors & PostApiVbyApiVersionBodyResponses; - }>; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/types.gen.ts deleted file mode 100644 index 56640474e..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/fastify/default/types.gen.ts +++ /dev/null @@ -1,1164 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - foo?: string; - bar?: string; -}>; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a type-only model that defines Date as a string - */ -export type _Date = string; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp: string | null; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -export type Default = { - name?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ParameterActivityParams = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity?: number; - post_id?: number; -}; - -export type ResponsePostActivityResponse = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity_id?: number; - post_id?: number; -}; - -export type FailureFailure = { - error?: string; - message?: string; - reference_code?: string; -}; - -export type ServiceWithEmptyTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions/'; -}; - -export type CallWithParametersData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter that goes into the query params - */ - parameterQuery: string; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - body?: never; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query: { - /** - * This is a simple string with default value - */ - parameterString: string; - /** - * This is a simple number with default value - */ - parameterNumber: number; - /** - * This is a simple boolean with default value - */ - parameterBoolean: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: unknown; -}; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - }; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: string; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: NonAsciiStringæøåÆøÅöôêÊ字符串; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PostApiVbyApiVersionBodyData = { - /** - * Body should not be unknown - */ - body: ParameterActivityParams; - path?: never; - query?: never; - url: '/api/v{api-version}/body'; -}; - -export type PostApiVbyApiVersionBodyErrors = { - /** - * Bad Request - */ - 400: FailureFailure; - /** - * Internal Server Error - */ - 500: FailureFailure; -}; - -export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; - -export type PostApiVbyApiVersionBodyResponses = { - /** - * OK - */ - 200: ResponsePostActivityResponse; -}; - -export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/my-plugin/default/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/zod/default/zod.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/plugins/zod/default/zod.gen.ts deleted file mode 100644 index 08f27248d..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/plugins/zod/default/zod.gen.ts +++ /dev/null @@ -1,271 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { z } from 'zod'; - -export const zCommentWithBreaks = z.number().int(); - -export const zCommentWithBackticks = z.number().int(); - -export const zCommentWithBackticksAndQuotes = z.number().int(); - -export const zCommentWithSlashes = z.number().int(); - -export const zCommentWithExpressionPlaceholders = z.number().int(); - -export const zCommentWithQuotes = z.number().int(); - -export const zCommentWithReservedCharacters = z.number().int(); - -export const zSimpleInteger = z.number().int(); - -export const zSimpleBoolean = z.boolean(); - -export const zSimpleString = z.string(); - -export const zNonAsciiStringæøåÆøÅöôêÊ字符串 = z.string(); - -export const zSimpleFile = z.string(); - -export const zModelWithString = z.object({ - prop: z.string().optional() -}); - -export const zSimpleReference = zModelWithString; - -export const zSimpleStringWithPattern = z.string().max(64).regex(/^[a-zA-Z0-9_]*$/); - -export const zEnumWithStrings = z.enum([ - 'Success', - 'Warning', - 'Error', - "'Single Quote'", - '"Double Quotes"', - 'Non-ascii: øæåôöØÆÅÔÖ字符串' -]); - -export const zEnumWithNumbers = z.unknown(); - -export const zEnumFromDescription = z.number(); - -export const zEnumWithExtensions = z.unknown(); - -export const zArrayWithNumbers = z.array(z.number().int()); - -export const zArrayWithBooleans = z.array(z.boolean()); - -export const zArrayWithStrings = z.array(z.string()); - -export const zArrayWithReferences = z.array(zModelWithString); - -export const zArrayWithArray = z.array(z.array(zModelWithString)); - -export const zArrayWithProperties = z.array(z.object({ - foo: z.string().optional(), - bar: z.string().optional() -})); - -export const zDictionaryWithString = z.object({}); - -export const zDictionaryWithReference = z.object({}); - -export const zDictionaryWithArray = z.object({}); - -export const zDictionaryWithDictionary = z.object({}); - -export const zDictionaryWithProperties = z.object({}); - -export const zDate = z.string(); - -export const zModelWithInteger = z.object({ - prop: z.number().int().optional() -}); - -export const zModelWithBoolean = z.object({ - prop: z.boolean().optional() -}); - -export const zModelWithStringError = z.object({ - prop: z.string().optional() -}); - -export const zModelWithNullableString = z.object({ - nullableProp: z.union([ - z.string(), - z.null() - ]).optional(), - nullableRequiredProp: z.union([ - z.string(), - z.null() - ]) -}); - -export const zModelWithEnum = z.object({ - test: z.enum([ - 'Success', - 'Warning', - 'Error', - 'ØÆÅ字符串' - ]).optional(), - statusCode: z.enum([ - '100', - '200 FOO', - '300 FOO_BAR', - '400 foo-bar', - '500 foo.bar', - '600 foo&bar' - ]).optional(), - bool: z.unknown().optional() -}); - -export const zModelWithEnumFromDescription = z.object({ - test: z.number().int().optional() -}); - -export const zModelWithNestedEnums = z.object({ - dictionaryWithEnum: z.object({}).optional(), - dictionaryWithEnumFromDescription: z.object({}).optional(), - arrayWithEnum: z.array(z.enum([ - 'Success', - 'Warning', - 'Error' - ])).optional(), - arrayWithDescription: z.array(z.number().int()).optional() -}); - -export const zModelWithProperties = z.object({ - required: z.string(), - requiredAndReadOnly: z.string().readonly(), - string: z.string().optional(), - number: z.number().optional(), - boolean: z.boolean().optional(), - reference: zModelWithString.optional(), - 'property with space': z.string().optional(), - default: z.string().optional(), - try: z.string().optional(), - '@namespace.string': z.string().readonly().optional(), - '@namespace.integer': z.number().int().readonly().optional() -}); - -export const zModelWithReference = z.object({ - prop: zModelWithProperties.optional() -}); - -export const zModelWithArray = z.object({ - prop: z.array(zModelWithString).optional(), - propWithFile: z.array(z.string()).optional(), - propWithNumber: z.array(z.number()).optional() -}); - -export const zModelWithDictionary = z.object({ - prop: z.object({}).optional() -}); - -export const zModelWithCircularReference: z.AnyZodObject = z.object({ - prop: z.lazy(() => { - return zModelWithCircularReference; - }).optional() -}); - -export const zModelWithNestedProperties = z.object({ - first: z.object({ - second: z.object({ - third: z.string().readonly() - }).readonly() - }).readonly() -}); - -export const zModelWithDuplicateProperties = z.object({ - prop: zModelWithString.optional() -}); - -export const zModelWithOrderedProperties = z.object({ - zebra: z.string().optional(), - apple: z.string().optional(), - hawaii: z.string().optional() -}); - -export const zModelWithDuplicateImports = z.object({ - propA: zModelWithString.optional(), - propB: zModelWithString.optional(), - propC: zModelWithString.optional() -}); - -export const zModelThatExtends = zModelWithString.merge(z.object({ - propExtendsA: z.string().optional(), - propExtendsB: zModelWithString.optional() -})); - -export const zModelThatExtendsExtends = zModelWithString.merge(zModelThatExtends).merge(z.object({ - propExtendsC: z.string().optional(), - propExtendsD: zModelWithString.optional() -})); - -export const zDefault = z.object({ - name: z.string().optional() -}); - -export const zModelWithPattern = z.object({ - key: z.string().max(64).regex(/^[a-zA-Z0-9_]*$/), - name: z.string().max(255), - enabled: z.boolean().readonly().optional(), - modified: z.string().datetime().readonly().optional(), - id: z.string().regex(/^\d{2}-\d{3}-\d{4}$/).optional(), - text: z.string().regex(/^\w+$/).optional(), - patternWithSingleQuotes: z.string().regex(/^[a-zA-Z0-9']*$/).optional(), - patternWithNewline: z.string().regex(/aaa\nbbb/).optional(), - patternWithBacktick: z.string().regex(/aaa`bbb/).optional() -}); - -export const zParameterActivityParams = z.object({ - description: z.string().optional(), - graduate_id: z.number().int().optional(), - organization_id: z.number().int().optional(), - parent_activity: z.number().int().optional(), - post_id: z.number().int().optional() -}); - -export const zResponsePostActivityResponse = z.object({ - description: z.string().optional(), - graduate_id: z.number().int().optional(), - organization_id: z.number().int().optional(), - parent_activity_id: z.number().int().optional(), - post_id: z.number().int().optional() -}); - -export const zFailureFailure = z.object({ - error: z.string().optional(), - message: z.string().optional(), - reference_code: z.string().optional() -}); - -export const zCallWithResponseAndNoContentResponseResponse = z.union([ - z.number(), - z.unknown() -]); - -export const zCallWithResponseResponse = zModelWithString; - -export const zCallWithDuplicateResponsesResponse = zModelWithString; - -export const zCallWithResponsesResponse = z.union([ - z.object({ - '@namespace.string': z.string().readonly().optional(), - '@namespace.integer': z.number().int().readonly().optional(), - value: z.array(zModelWithString).readonly().optional() - }), - zModelThatExtends, - zModelThatExtendsExtends -]); - -export const zTypesResponse = z.union([ - z.number(), - z.string(), - z.boolean(), - z.object({}) -]); - -export const zComplexTypesResponse = z.array(zModelWithString); - -export const zNonAsciiæøåÆøÅöôêÊ字符串Response = zNonAsciiStringæøåÆøÅöôêÊ字符串; - -export const zPostApiVbyApiVersionBodyResponse = zResponsePostActivityResponse; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/types.gen.ts deleted file mode 100644 index 00a719fc6..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/read-write-only/types.gen.ts +++ /dev/null @@ -1,37 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type FooReadReadable = BarReadReadable & { - readonly foo?: string; -}; - -export type FooReadWritable = BarReadWritable; - -export type BarReadReadable = Baz & { - readonly bar?: string; -}; - -export type BarReadWritable = Baz; - -export type Baz = { - baz?: string; -}; - -export type PostFooReadData = { - body: FooReadWritable; - path?: never; - query?: never; - url: '/foo-read'; -}; - -export type PostFooReadResponses = { - /** - * OK - */ - 200: FooReadReadable; -}; - -export type PostFooReadResponse = PostFooReadResponses[keyof PostFooReadResponses]; - -export type ClientOptions = { - baseUrl: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/sdk.gen.ts deleted file mode 100644 index 60211f6ff..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/sdk.gen.ts +++ /dev/null @@ -1,33 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { SendEmailData, SendEmailResponse2, SendEmailError } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -/** - * Send a single email - */ -export const sendEmail = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/email', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/types.gen.ts deleted file mode 100644 index fcf50280e..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/schema-unknown/types.gen.ts +++ /dev/null @@ -1,136 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type SendEmailRequest = { - /** - * The sender email address. Must have a registered and confirmed Sender Signature. - */ - From?: string; - /** - * Recipient email address. Multiple addresses are comma seperated. Max 50. - */ - To?: string; - /** - * Recipient email address. Multiple addresses are comma seperated. Max 50. - */ - Cc?: string; - /** - * Bcc recipient email address. Multiple addresses are comma seperated. Max 50. - */ - Bcc?: string; - /** - * Email Subject - */ - Subject?: string; - /** - * Email tag that allows you to categorize outgoing emails and get detailed statistics. - */ - Tag?: string; - /** - * If no TextBody specified HTML email message - */ - HtmlBody?: string; - /** - * If no HtmlBody specified Plain text email message - */ - TextBody?: string; - /** - * Reply To override email address. Defaults to the Reply To set in the sender signature. - */ - ReplyTo?: string; - /** - * Activate open tracking for this email. - */ - TrackOpens?: boolean; - /** - * Replace links in content to enable "click tracking" stats. Default is 'null', which uses the server's LinkTracking setting'. - */ - TrackLinks?: 'None' | 'HtmlAndText' | 'HtmlOnly' | 'TextOnly'; - Headers?: HeaderCollection; - Attachments?: AttachmentCollection; -}; - -/** - * A single header for an email message. - */ -export type MessageHeader = { - /** - * The header's name. - */ - Name?: string; - /** - * The header's value. - */ - Value?: string; -}; - -export type HeaderCollection = Array; - -/** - * An attachment for an email message. - */ -export type Attachment = { - Name?: string; - Content?: string; - ContentType?: string; - ContentID?: string; -}; - -export type AttachmentCollection = Array; - -/** - * The standard response when a postmark message is sent - */ -export type SendEmailResponse = { - To?: string; - SubmittedAt?: string; - MessageID?: string; - ErrorCode?: number; - Message?: string; -}; - -/** - * A Postmark API error. - */ -export type StandardPostmarkResponse = { - ErrorCode?: number; - Message?: string; -}; - -export type SendEmailData = { - body?: SendEmailRequest; - headers: { - /** - * The token associated with the Server on which this request will operate. - */ - 'X-Postmark-Server-Token': string; - }; - path?: never; - query?: never; - url: '/email'; -}; - -export type SendEmailErrors = { - /** - * An error was generated due to incorrect use of the API. See the Message associated with this response for more information. - */ - 422: StandardPostmarkResponse; - /** - * Indicates an internal server error occurred. - */ - 500: unknown; -}; - -export type SendEmailError = SendEmailErrors[keyof SendEmailErrors]; - -export type SendEmailResponses = { - /** - * OK - */ - 200: SendEmailResponse; -}; - -export type SendEmailResponse2 = SendEmailResponses[keyof SendEmailResponses]; - -export type ClientOptions = { - baseUrl: `${string}://api.postmarkapp.com` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/sdk.gen.ts deleted file mode 100644 index 2bd416990..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/sdk.gen.ts +++ /dev/null @@ -1,33 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { GetFooData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const getFoo = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - security: [ - { - in: 'query', - name: 'foo', - type: 'apiKey' - } - ], - url: '/foo', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/types.gen.ts deleted file mode 100644 index a53fefa03..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/security-api-key/types.gen.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type ClientOptions = { - baseUrl: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/sdk.gen.ts deleted file mode 100644 index 69fd85eda..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/sdk.gen.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { GetFooData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const getFoo = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - security: [ - { - scheme: 'basic', - type: 'http' - } - ], - url: '/foo', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/types.gen.ts deleted file mode 100644 index a53fefa03..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/security-basic/types.gen.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type ClientOptions = { - baseUrl: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-false/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-false/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/security-false/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-false/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-false/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/security-false/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-false/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-false/sdk.gen.ts deleted file mode 100644 index 14ebd7036..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/security-false/sdk.gen.ts +++ /dev/null @@ -1,26 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { GetFooData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const getFoo = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/foo', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-false/types.gen.ts deleted file mode 100644 index a53fefa03..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/security-false/types.gen.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type ClientOptions = { - baseUrl: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/sdk.gen.ts deleted file mode 100644 index bcb05a226..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/sdk.gen.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { GetFooData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const getFoo = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - security: [ - { - scheme: 'bearer', - type: 'http' - } - ], - url: '/foo', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/types.gen.ts deleted file mode 100644 index a53fefa03..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/security-oauth2/types.gen.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type ClientOptions = { - baseUrl: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/types.gen.ts deleted file mode 100644 index 6906f1774..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/servers-base-path/types.gen.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: string; -}; - -export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}/v1` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/servers-host/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/servers-host/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/servers-host/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/servers-host/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/servers-host/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/servers-host/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/servers-host/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/servers-host/types.gen.ts deleted file mode 100644 index b39de6295..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/servers-host/types.gen.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: string; -}; - -export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; - -export type ClientOptions = { - baseUrl: `${string}://foo.com` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/servers/client.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/servers/client.gen.ts deleted file mode 100644 index 89e76c00f..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/servers/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'https://foo.com/v1' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/servers/index.ts b/packages/openapi-ts-tests/test/generated/2.0.x/servers/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/servers/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/2.0.x/servers/types.gen.ts b/packages/openapi-ts-tests/test/generated/2.0.x/servers/types.gen.ts deleted file mode 100644 index 499949960..000000000 --- a/packages/openapi-ts-tests/test/generated/2.0.x/servers/types.gen.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: string; -}; - -export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; - -export type ClientOptions = { - baseUrl: 'https://foo.com/v1' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-false/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-false/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-false/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-false/types.gen.ts deleted file mode 100644 index 6b84c8ade..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-false/types.gen.ts +++ /dev/null @@ -1,17 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - foo: string; -}; - -export type Bar = Foo & { - [key: string]: never; -}; - -export type Baz = Foo & { - bar: string; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-true/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-true/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-true/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-true/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-true/types.gen.ts deleted file mode 100644 index 83d16749a..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-true/types.gen.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - foo: string; - [key: string]: unknown | string; -}; - -export type Bar = Foo & { - [key: string]: unknown; -}; - -export type Baz = Foo & { - bar: string; - [key: string]: unknown | string; -}; - -export type Qux = {}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-undefined/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-undefined/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-undefined/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-undefined/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-undefined/types.gen.ts deleted file mode 100644 index cb1ed0592..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/additional-properties-undefined/types.gen.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - foo: { - [key: string]: unknown; - }; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/array-items-one-of-length-1/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/array-items-one-of-length-1/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/array-items-one-of-length-1/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/array-items-one-of-length-1/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/array-items-one-of-length-1/types.gen.ts deleted file mode 100644 index b133cfb1a..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/array-items-one-of-length-1/types.gen.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - foo?: Array; -}; - -export type Bar = string; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/sdk.gen.ts deleted file mode 100644 index d305a220c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/sdk.gen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { PostFooData, PostFooResponse } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const postFoo = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - bodySerializer: null, - url: '/foo', - ...options, - headers: { - 'Content-Type': 'text/plain', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/types.gen.ts deleted file mode 100644 index ff0becc55..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/body-response-text-plain/types.gen.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type PostFooData = { - body: string; - path?: never; - query?: never; - url: '/foo'; -}; - -export type PostFooResponses = { - /** - * OK - */ - 200: string; -}; - -export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/case-PascalCase/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/case-PascalCase/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/case-PascalCase/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/case-PascalCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/case-PascalCase/types.gen.ts deleted file mode 100644 index 45f3cd481..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/case-PascalCase/types.gen.ts +++ /dev/null @@ -1,89 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * original name: 201 - */ -export type _201 = number; - -/** - * original name: Foo - */ -export type Foo = { - /** - * original name: fooBar - */ - fooBar: FooBar; - /** - * original name: BarBaz - */ - BarBaz: Foo; - /** - * original name: qux_quux - */ - qux_quux: { - /** - * original name: fooBar - */ - fooBar: FooBar2; - /** - * original name: BarBaz - */ - BarBaz: FooBar3; - /** - * original name: qux_quux - */ - qux_quux: boolean; - }; -}; - -/** - * original name: foo_bar - */ -export type FooBar = boolean; - -/** - * original name: fooBar - */ -export type FooBar2 = number; - -/** - * original name: FooBar - */ -export type FooBar3 = string; - -export type GetFooData = { - body: Foo; - path?: never; - query: { - /** - * original name: fooBar - */ - fooBar: string; - /** - * original name: BarBaz - */ - BarBaz: string; - /** - * original name: qux_quux - */ - qux_quux: string; - }; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: Foo; - /** - * OK - */ - 201: _201; -}; - -export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/case-camelCase/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/case-camelCase/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/case-camelCase/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/case-camelCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/case-camelCase/types.gen.ts deleted file mode 100644 index 2b4016129..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/case-camelCase/types.gen.ts +++ /dev/null @@ -1,89 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * original name: 201 - */ -export type _201 = number; - -/** - * original name: Foo - */ -export type foo = { - /** - * original name: fooBar - */ - fooBar: fooBar; - /** - * original name: BarBaz - */ - BarBaz: foo; - /** - * original name: qux_quux - */ - qux_quux: { - /** - * original name: fooBar - */ - fooBar: fooBar2; - /** - * original name: BarBaz - */ - BarBaz: fooBar3; - /** - * original name: qux_quux - */ - qux_quux: boolean; - }; -}; - -/** - * original name: foo_bar - */ -export type fooBar = boolean; - -/** - * original name: fooBar - */ -export type fooBar2 = number; - -/** - * original name: FooBar - */ -export type fooBar3 = string; - -export type getFooData = { - body: foo; - path?: never; - query: { - /** - * original name: fooBar - */ - fooBar: string; - /** - * original name: BarBaz - */ - BarBaz: string; - /** - * original name: qux_quux - */ - qux_quux: string; - }; - url: '/foo'; -}; - -export type getFooResponses = { - /** - * OK - */ - 200: foo; - /** - * OK - */ - 201: _201; -}; - -export type getFooResponse = getFooResponses[keyof getFooResponses]; - -export type clientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/case-snake_case/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/case-snake_case/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/case-snake_case/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/case-snake_case/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/case-snake_case/types.gen.ts deleted file mode 100644 index 0e7c47f83..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/case-snake_case/types.gen.ts +++ /dev/null @@ -1,89 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * original name: 201 - */ -export type _201 = number; - -/** - * original name: Foo - */ -export type foo = { - /** - * original name: fooBar - */ - fooBar: foo_bar; - /** - * original name: BarBaz - */ - BarBaz: foo; - /** - * original name: qux_quux - */ - qux_quux: { - /** - * original name: fooBar - */ - fooBar: foo_bar2; - /** - * original name: BarBaz - */ - BarBaz: foo_bar3; - /** - * original name: qux_quux - */ - qux_quux: boolean; - }; -}; - -/** - * original name: foo_bar - */ -export type foo_bar = boolean; - -/** - * original name: fooBar - */ -export type foo_bar2 = number; - -/** - * original name: FooBar - */ -export type foo_bar3 = string; - -export type get_foo_data = { - body: foo; - path?: never; - query: { - /** - * original name: fooBar - */ - fooBar: string; - /** - * original name: BarBaz - */ - BarBaz: string; - /** - * original name: qux_quux - */ - qux_quux: string; - }; - url: '/foo'; -}; - -export type get_foo_responses = { - /** - * OK - */ - 200: foo; - /** - * OK - */ - 201: _201; -}; - -export type get_foo_response = get_foo_responses[keyof get_foo_responses]; - -export type client_options = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/case/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/case/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/case/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/case/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/case/types.gen.ts deleted file mode 100644 index 0118c79fe..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/case/types.gen.ts +++ /dev/null @@ -1,89 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * original name: 201 - */ -export type _201 = number; - -/** - * original name: Foo - */ -export type Foo = { - /** - * original name: fooBar - */ - fooBar: foo_bar; - /** - * original name: BarBaz - */ - BarBaz: Foo; - /** - * original name: qux_quux - */ - qux_quux: { - /** - * original name: fooBar - */ - fooBar: fooBar; - /** - * original name: BarBaz - */ - BarBaz: FooBar; - /** - * original name: qux_quux - */ - qux_quux: boolean; - }; -}; - -/** - * original name: foo_bar - */ -export type foo_bar = boolean; - -/** - * original name: fooBar - */ -export type fooBar = number; - -/** - * original name: FooBar - */ -export type FooBar = string; - -export type GetFoo_Data = { - body: Foo; - path?: never; - query: { - /** - * original name: fooBar - */ - fooBar: string; - /** - * original name: BarBaz - */ - BarBaz: string; - /** - * original name: qux_quux - */ - qux_quux: string; - }; - url: '/foo'; -}; - -export type GetFoo_Responses = { - /** - * OK - */ - 200: Foo; - /** - * OK - */ - 201: _201; -}; - -export type GetFoo_Response = GetFoo_Responses[keyof GetFoo_Responses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/components-request-bodies/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/components-request-bodies/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/components-request-bodies/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/components-request-bodies/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/components-request-bodies/types.gen.ts deleted file mode 100644 index 769d4ee8c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/components-request-bodies/types.gen.ts +++ /dev/null @@ -1,29 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Foo - */ -export type Foo = { - page?: number; -}; - -export type PostFooData = { - /** - * Foo - */ - body: Foo; - path?: never; - query?: never; - url: '/foo'; -}; - -export type PostFooResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/content-binary/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/content-binary/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/content-binary/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/content-binary/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/content-binary/types.gen.ts deleted file mode 100644 index e8a09c992..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/content-binary/types.gen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - 200: string; -}; - -export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; - -export type GetBarData = { - body?: never; - path?: never; - query?: never; - url: '/bar'; -}; - -export type GetBarResponses = { - 200: Blob | File; -}; - -export type GetBarResponse = GetBarResponses[keyof GetBarResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-all-of/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-all-of/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-all-of/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-all-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-all-of/types.gen.ts deleted file mode 100644 index d74f66a4a..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-all-of/types.gen.ts +++ /dev/null @@ -1,49 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - id: string; -}; - -export type Bar = Foo & { - id: 'Bar'; -} & { - bar?: string; -}; - -export type Baz = Foo & { - id: 'Baz'; -} & { - baz?: string; -}; - -export type Qux = Foo & { - id: 'Qux'; -} & { - qux?: boolean; -}; - -export type FooMapped = { - id: string; -}; - -export type BarMapped = FooMapped & { - id: 'bar'; -} & { - bar?: string; -}; - -export type BazMapped = FooMapped & { - id: 'baz'; -} & { - baz?: string; -}; - -export type QuxMapped = FooMapped & { - id: 'QuxMapped'; -} & { - qux?: boolean; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-any-of/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-any-of/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-any-of/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-any-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-any-of/types.gen.ts deleted file mode 100644 index cdd9c641f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-any-of/types.gen.ts +++ /dev/null @@ -1,28 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = ({ - type?: 'Bar'; -} & Bar) | ({ - type?: 'Baz'; -} & Baz); - -export type Baz = Qux; - -export type Bar = Qux; - -export type Qux = { - id: string; - type: Quux; -}; - -export type Quux = 'Bar' | 'Baz'; - -export type Quuz = ({ - type?: 'bar'; -} & Bar) | ({ - type?: 'baz'; -} & Baz); - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-mapped-many/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-mapped-many/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-mapped-many/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-mapped-many/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-mapped-many/types.gen.ts deleted file mode 100644 index bbbd8dfa9..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-mapped-many/types.gen.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = ({ - foo?: 'one'; -} & Bar) | ({ - foo?: 'three'; -} & Baz); - -export type Bar = { - foo?: 'one' | 'two'; -}; - -export type Baz = { - foo?: 'three'; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-one-of/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-one-of/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-one-of/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-one-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-one-of/types.gen.ts deleted file mode 100644 index cdd9c641f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/discriminator-one-of/types.gen.ts +++ /dev/null @@ -1,28 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = ({ - type?: 'Bar'; -} & Bar) | ({ - type?: 'Baz'; -} & Baz); - -export type Baz = Qux; - -export type Bar = Qux; - -export type Qux = { - id: string; - type: Quux; -}; - -export type Quux = 'Bar' | 'Baz'; - -export type Quuz = ({ - type?: 'bar'; -} & Bar) | ({ - type?: 'baz'; -} & Baz); - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-escape/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-escape/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-escape/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-escape/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-escape/types.gen.ts deleted file mode 100644 index d3fff794b..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-escape/types.gen.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - foo?: "foo'bar" | 'foo"bar'; -}; - -export type Bar = "foo'bar" | 'foo"bar'; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-javascript/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-javascript/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-javascript/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-javascript/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-javascript/types.gen.ts deleted file mode 100644 index bf1c86991..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-javascript/types.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Type = 'foo' | 'bar'; - -export const Type = { - FOO: 'foo', - BAR: 'bar' -} as const; - -export type Foo = { - type?: 'foo' | 'bar'; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript-namespace/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript-namespace/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript-namespace/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript-namespace/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript-namespace/types.gen.ts deleted file mode 100644 index ef7778bd5..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript-namespace/types.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export namespace Foo { - export enum Type { - FOO = 'foo', - BAR = 'bar' - } -} - -export type Foo = { - type?: 'foo' | 'bar'; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript/types.gen.ts deleted file mode 100644 index 86b67e018..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline-typescript/types.gen.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export enum Type { - FOO = 'foo', - BAR = 'bar' -} - -export type Foo = { - type?: 'foo' | 'bar'; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline/types.gen.ts deleted file mode 100644 index de2459b6b..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-inline/types.gen.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Type = 'foo' | 'bar'; - -export type Foo = { - type?: 'foo' | 'bar'; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-PascalCase/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-PascalCase/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-PascalCase/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-PascalCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-PascalCase/types.gen.ts deleted file mode 100644 index 8c89a55c8..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-PascalCase/types.gen.ts +++ /dev/null @@ -1,48 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _110 = '1-10' | '11-20'; - -export const _110 = { - 110: '1-10', - 1120: '11-20' -} as const; - -export type MyFoo = 'myFoo' | 'myBar'; - -export const MyFoo = { - MyFoo: 'myFoo', - MyBar: 'myBar' -} as const; - -export type MyFoo2 = 'MyFoo' | 'MyBar'; - -export const MyFoo2 = { - MyFoo: 'MyFoo', - MyBar: 'MyBar' -} as const; - -export type Foo = 'foo' | 'bar' | null | '' | true | false; - -export const Foo = { - Foo: 'foo', - Bar: 'bar', - Null: null, - '': '', - True: true, - False: false -} as const; - -export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; - -export const Numbers = { - 100: 100, - 200: 200, - 300: 300, - '-100': -100, - '-200': -200, - '-300': -300 -} as const; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts deleted file mode 100644 index 66f2f4dc0..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts +++ /dev/null @@ -1,48 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _110 = '1-10' | '11-20'; - -export const _110 = { - '1_10': '1-10', - '11_20': '11-20' -} as const; - -export type MyFoo = 'myFoo' | 'myBar'; - -export const MyFoo = { - MY_FOO: 'myFoo', - MY_BAR: 'myBar' -} as const; - -export type MyFoo2 = 'MyFoo' | 'MyBar'; - -export const MyFoo2 = { - MY_FOO: 'MyFoo', - MY_BAR: 'MyBar' -} as const; - -export type Foo = 'foo' | 'bar' | null | '' | true | false; - -export const Foo = { - FOO: 'foo', - BAR: 'bar', - NULL: null, - '': '', - TRUE: true, - FALSE: false -} as const; - -export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; - -export const Numbers = { - 100: 100, - 200: 200, - 300: 300, - '-100': -100, - '-200': -200, - '-300': -300 -} as const; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-camelCase/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-camelCase/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-camelCase/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-camelCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-camelCase/types.gen.ts deleted file mode 100644 index 7f0f85ab5..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-camelCase/types.gen.ts +++ /dev/null @@ -1,48 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _110 = '1-10' | '11-20'; - -export const _110 = { - 110: '1-10', - 1120: '11-20' -} as const; - -export type MyFoo = 'myFoo' | 'myBar'; - -export const MyFoo = { - myFoo: 'myFoo', - myBar: 'myBar' -} as const; - -export type MyFoo2 = 'MyFoo' | 'MyBar'; - -export const MyFoo2 = { - myFoo: 'MyFoo', - myBar: 'MyBar' -} as const; - -export type Foo = 'foo' | 'bar' | null | '' | true | false; - -export const Foo = { - foo: 'foo', - bar: 'bar', - null: null, - '': '', - true: true, - false: false -} as const; - -export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; - -export const Numbers = { - 100: 100, - 200: 200, - 300: 300, - '-100': -100, - '-200': -200, - '-300': -300 -} as const; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-preserve/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-preserve/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-preserve/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-preserve/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-preserve/types.gen.ts deleted file mode 100644 index 2a631eac8..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-preserve/types.gen.ts +++ /dev/null @@ -1,48 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _110 = '1-10' | '11-20'; - -export const _110 = { - '1-10': '1-10', - '11-20': '11-20' -} as const; - -export type MyFoo = 'myFoo' | 'myBar'; - -export const MyFoo = { - myFoo: 'myFoo', - myBar: 'myBar' -} as const; - -export type MyFoo2 = 'MyFoo' | 'MyBar'; - -export const MyFoo2 = { - MyFoo: 'MyFoo', - MyBar: 'MyBar' -} as const; - -export type Foo = 'foo' | 'bar' | null | '' | true | false; - -export const Foo = { - foo: 'foo', - bar: 'bar', - null: null, - '': '', - true: true, - false: false -} as const; - -export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; - -export const Numbers = { - 100: 100, - 200: 200, - 300: 300, - '-100': -100, - '-200': -200, - '-300': -300 -} as const; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-snake_case/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-snake_case/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-snake_case/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-snake_case/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-snake_case/types.gen.ts deleted file mode 100644 index 81146d8df..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-javascript-snake_case/types.gen.ts +++ /dev/null @@ -1,48 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _110 = '1-10' | '11-20'; - -export const _110 = { - '1_10': '1-10', - '11_20': '11-20' -} as const; - -export type MyFoo = 'myFoo' | 'myBar'; - -export const MyFoo = { - my_foo: 'myFoo', - my_bar: 'myBar' -} as const; - -export type MyFoo2 = 'MyFoo' | 'MyBar'; - -export const MyFoo2 = { - my_foo: 'MyFoo', - my_bar: 'MyBar' -} as const; - -export type Foo = 'foo' | 'bar' | null | '' | true | false; - -export const Foo = { - foo: 'foo', - bar: 'bar', - null: null, - '': '', - true: true, - false: false -} as const; - -export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; - -export const Numbers = { - 100: 100, - 200: 200, - 300: 300, - '-100': -100, - '-200': -200, - '-300': -300 -} as const; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-PascalCase/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-PascalCase/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-PascalCase/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-PascalCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-PascalCase/types.gen.ts deleted file mode 100644 index 2f43e6815..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-PascalCase/types.gen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export enum _110 { - _110 = '1-10', - _1120 = '11-20' -} - -export enum MyFoo { - MyFoo = 'myFoo', - MyBar = 'myBar' -} - -export enum MyFoo2 { - MyFoo = 'MyFoo', - MyBar = 'MyBar' -} - -export type Foo = 'foo' | 'bar' | null | '' | true | false; - -export enum Numbers { - _100 = 100, - _200 = 200, - _300 = 300, - '_-100' = -100, - '_-200' = -200, - '_-300' = -300 -} - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts deleted file mode 100644 index 541fd2094..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export enum _110 { - '1_10' = '1-10', - '11_20' = '11-20' -} - -export enum MyFoo { - MY_FOO = 'myFoo', - MY_BAR = 'myBar' -} - -export enum MyFoo2 { - MY_FOO = 'MyFoo', - MY_BAR = 'MyBar' -} - -export type Foo = 'foo' | 'bar' | null | '' | true | false; - -export enum Numbers { - _100 = 100, - _200 = 200, - _300 = 300, - '_-100' = -100, - '_-200' = -200, - '_-300' = -300 -} - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-camelCase/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-camelCase/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-camelCase/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-camelCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-camelCase/types.gen.ts deleted file mode 100644 index 49796afc5..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-camelCase/types.gen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export enum _110 { - _110 = '1-10', - _1120 = '11-20' -} - -export enum MyFoo { - myFoo = 'myFoo', - myBar = 'myBar' -} - -export enum MyFoo2 { - myFoo = 'MyFoo', - myBar = 'MyBar' -} - -export type Foo = 'foo' | 'bar' | null | '' | true | false; - -export enum Numbers { - _100 = 100, - _200 = 200, - _300 = 300, - '_-100' = -100, - '_-200' = -200, - '_-300' = -300 -} - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-preserve/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-preserve/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-preserve/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-preserve/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-preserve/types.gen.ts deleted file mode 100644 index 9ee13c15d..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-preserve/types.gen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export enum _110 { - '1-10' = '1-10', - '11-20' = '11-20' -} - -export enum MyFoo { - myFoo = 'myFoo', - myBar = 'myBar' -} - -export enum MyFoo2 { - MyFoo = 'MyFoo', - MyBar = 'MyBar' -} - -export type Foo = 'foo' | 'bar' | null | '' | true | false; - -export enum Numbers { - _100 = 100, - _200 = 200, - _300 = 300, - '_-100' = -100, - '_-200' = -200, - '_-300' = -300 -} - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-snake_case/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-snake_case/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-snake_case/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-snake_case/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-snake_case/types.gen.ts deleted file mode 100644 index 3a07bbbc6..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values-typescript-snake_case/types.gen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export enum _110 { - '1_10' = '1-10', - '11_20' = '11-20' -} - -export enum MyFoo { - my_foo = 'myFoo', - my_bar = 'myBar' -} - -export enum MyFoo2 { - my_foo = 'MyFoo', - my_bar = 'MyBar' -} - -export type Foo = 'foo' | 'bar' | null | '' | true | false; - -export enum Numbers { - _100 = 100, - _200 = 200, - _300 = 300, - '_-100' = -100, - '_-200' = -200, - '_-300' = -300 -} - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values/types.gen.ts deleted file mode 100644 index 334fc7e35..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-names-values/types.gen.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _110 = '1-10' | '11-20'; - -export type MyFoo = 'myFoo' | 'myBar'; - -export type MyFoo2 = 'MyFoo' | 'MyBar'; - -export type Foo = 'foo' | 'bar' | null | '' | true | false; - -export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-null/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-null/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-null/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-null/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-null/types.gen.ts deleted file mode 100644 index 48d0f83a2..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-null/types.gen.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = 'foo' | 'bar' | null; - -export type Bar = 'foo' | 'bar'; - -export type Baz = 'foo' | 'bar'; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/enum-null/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/enum-null/zod.gen.ts deleted file mode 100644 index ef3e1daa7..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/enum-null/zod.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { z } from 'zod'; - -export const zFoo = z.enum([ - 'foo', - 'bar' -]); - -export const zBar = z.enum([ - 'foo', - 'bar' -]); - -export const zBaz = z.enum([ - 'foo', - 'bar' -]); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/exclude-deprecated/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/exclude-deprecated/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/exclude-deprecated/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/exclude-deprecated/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/exclude-deprecated/types.gen.ts deleted file mode 100644 index f09b2f30d..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/exclude-deprecated/types.gen.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = string; - -export type PostFooData = { - body: Foo; - path?: never; - query?: never; - url: '/foo'; -}; - -export type PostFooResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/@tanstack/react-query.gen.ts deleted file mode 100644 index d2d72e484..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/@tanstack/react-query.gen.ts +++ /dev/null @@ -1,99 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, create } from '../sdk.gen'; -import { queryOptions, type UseMutationOptions, type DefaultError } from '@tanstack/react-query'; -import type { CreateData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const createQueryKey2 = (options?: Options) => createQueryKey('create', options); - -export const createOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await create({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: createQueryKey2(options) - }); -}; - -export const createMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await create({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const createQueryKey2 = (options?: Options) => createQueryKey('create', options); - -export const createOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await create({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: createQueryKey2(options) - }); -}; - -export const createMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await create({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/sdk.gen.ts deleted file mode 100644 index 8f8c0777a..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/sdk.gen.ts +++ /dev/null @@ -1,40 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { CreateData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const create = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/foo', - ...options - }); -}; - -export const create = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/foo', - ...options - }); -}; - -export const create = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/foo', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/types.gen.ts deleted file mode 100644 index 38b0bfb2b..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/internal-name-conflict/types.gen.ts +++ /dev/null @@ -1,47 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type CreateData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type CreateResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type CreateData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type CreateResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type CreateData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type CreateResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/operation-204/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/operation-204/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/operation-204/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/operation-204/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/operation-204/types.gen.ts deleted file mode 100644 index 0250e75aa..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/operation-204/types.gen.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type PostFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type PostFooResponses = { - /** - * OK - */ - 200: string; - /** - * Created - */ - 204: void; -}; - -export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/client.gen.ts deleted file mode 100644 index c4dedd629..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/sdk.gen.ts deleted file mode 100644 index fd567117c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/sdk.gen.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-axios'; -import type { PostFooData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const postFoo = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/foo', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/types.gen.ts deleted file mode 100644 index e1ed1030b..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false-axios/types.gen.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type PostFooData = { - body?: never; - path?: never; - query?: { - foo?: Array; - }; - url: '/foo'; -}; - -export type PostFooResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ClientOptions = { - baseURL: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/sdk.gen.ts deleted file mode 100644 index b34dd5ddb..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/sdk.gen.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { PostFooData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const postFoo = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/foo', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/types.gen.ts deleted file mode 100644 index d69993ad2..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/parameter-explode-false/types.gen.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type PostFooData = { - body?: never; - path?: never; - query?: { - foo?: Array; - }; - url: '/foo'; -}; - -export type PostFooResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts deleted file mode 100644 index 9cc4305a3..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts +++ /dev/null @@ -1,1987 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export const _400Schema = { - description: 'Model with number-only name', - type: 'string' -} as const; - -export const camelCaseCommentWithBreaksSchema = { - description: `Testing multiline comments in string: First line -Second line - -Fourth line`, - type: 'integer' -} as const; - -export const CommentWithBreaksSchema = { - description: `Testing multiline comments in string: First line -Second line - -Fourth line`, - type: 'integer' -} as const; - -export const CommentWithBackticksSchema = { - description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work', - type: 'integer' -} as const; - -export const CommentWithBackticksAndQuotesSchema = { - description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`, - type: 'integer' -} as const; - -export const CommentWithSlashesSchema = { - description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work', - type: 'integer' -} as const; - -export const CommentWithExpressionPlaceholdersSchema = { - description: 'Testing expression placeholders in string: ${expression} should work', - type: 'integer' -} as const; - -export const CommentWithQuotesSchema = { - description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`, - type: 'integer' -} as const; - -export const CommentWithReservedCharactersSchema = { - description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work', - type: 'integer' -} as const; - -export const SimpleIntegerSchema = { - description: 'This is a simple number', - type: 'integer' -} as const; - -export const SimpleBooleanSchema = { - description: 'This is a simple boolean', - type: 'boolean' -} as const; - -export const SimpleStringSchema = { - description: 'This is a simple string', - type: 'string' -} as const; - -export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = { - description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)', - type: 'string' -} as const; - -export const SimpleFileSchema = { - description: 'This is a simple file', - format: 'binary', - type: 'string' -} as const; - -export const SimpleReferenceSchema = { - description: 'This is a simple reference', - allOf: [ - { - '$ref': '#/components/schemas/ModelWithString' - } - ] -} as const; - -export const SimpleStringWithPatternSchema = { - description: 'This is a simple string', - type: 'string', - nullable: true, - maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$' -} as const; - -export const EnumWithStringsSchema = { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串'] -} as const; - -export const EnumWithReplacedCharactersSchema = { - enum: ["'Single Quote'", '"Double Quotes"', 'øæåôöØÆÅÔÖ字符串', 3.1, ''], - type: 'string' -} as const; - -export const EnumWithNumbersSchema = { - description: 'This is a simple enum with numbers', - enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3], - default: 200 -} as const; - -export const EnumFromDescriptionSchema = { - description: 'Success=1,Warning=2,Error=3', - type: 'number' -} as const; - -export const EnumWithExtensionsSchema = { - description: 'This is a simple enum with numbers', - enum: [200, 400, 500], - 'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'], - 'x-enum-descriptions': ['Used when the status of something is successful', 'Used when the status of something has a warning', 'Used when the status of something has an error'] -} as const; - -export const EnumWithXEnumNamesSchema = { - enum: [0, 1, 2], - 'x-enumNames': ['zero', 'one', 'two'] -} as const; - -export const ArrayWithNumbersSchema = { - description: 'This is a simple array with numbers', - type: 'array', - items: { - type: 'integer' - } -} as const; - -export const ArrayWithBooleansSchema = { - description: 'This is a simple array with booleans', - type: 'array', - items: { - type: 'boolean' - } -} as const; - -export const ArrayWithStringsSchema = { - description: 'This is a simple array with strings', - type: 'array', - items: { - type: 'string' - }, - default: ['test'] -} as const; - -export const ArrayWithReferencesSchema = { - description: 'This is a simple array with references', - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithString' - } -} as const; - -export const ArrayWithArraySchema = { - description: 'This is a simple array containing an array', - type: 'array', - items: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithString' - } - } -} as const; - -export const ArrayWithPropertiesSchema = { - description: 'This is a simple array with properties', - type: 'array', - items: { - type: 'object', - properties: { - '16x16': { - '$ref': '#/components/schemas/camelCaseCommentWithBreaks' - }, - bar: { - type: 'string' - } - } - } -} as const; - -export const ArrayWithAnyOfPropertiesSchema = { - description: 'This is a simple array with any of properties', - type: 'array', - items: { - anyOf: [ - { - type: 'object', - properties: { - foo: { - type: 'string', - default: 'test' - } - } - }, - { - type: 'object', - properties: { - bar: { - type: 'string' - } - } - } - ] - } -} as const; - -export const AnyOfAnyAndNullSchema = { - type: 'object', - properties: { - data: { - anyOf: [ - {}, - { - nullable: true - } - ] - } - } -} as const; - -export const AnyOfArraysSchema = { - description: 'This is a simple array with any of properties', - type: 'object', - properties: { - results: { - items: { - anyOf: [ - { - type: 'object', - properties: { - foo: { - type: 'string' - } - } - }, - { - type: 'object', - properties: { - bar: { - type: 'string' - } - } - } - ] - }, - type: 'array' - } - } -} as const; - -export const DictionaryWithStringSchema = { - description: 'This is a string dictionary', - type: 'object', - additionalProperties: { - type: 'string' - } -} as const; - -export const DictionaryWithPropertiesAndAdditionalPropertiesSchema = { - type: 'object', - properties: { - foo: { - type: 'number' - }, - bar: { - type: 'boolean' - } - }, - additionalProperties: { - type: 'string' - } -} as const; - -export const DictionaryWithReferenceSchema = { - description: 'This is a string reference', - type: 'object', - additionalProperties: { - '$ref': '#/components/schemas/ModelWithString' - } -} as const; - -export const DictionaryWithArraySchema = { - description: 'This is a complex dictionary', - type: 'object', - additionalProperties: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithString' - } - } -} as const; - -export const DictionaryWithDictionarySchema = { - description: 'This is a string dictionary', - type: 'object', - additionalProperties: { - type: 'object', - additionalProperties: { - type: 'string' - } - } -} as const; - -export const DictionaryWithPropertiesSchema = { - description: 'This is a complex dictionary', - type: 'object', - additionalProperties: { - type: 'object', - properties: { - foo: { - type: 'string' - }, - bar: { - type: 'string' - } - } - } -} as const; - -export const ModelWithIntegerSchema = { - description: 'This is a model with one number property', - type: 'object', - properties: { - prop: { - description: 'This is a simple number property', - type: 'integer' - } - } -} as const; - -export const ModelWithBooleanSchema = { - description: 'This is a model with one boolean property', - type: 'object', - properties: { - prop: { - description: 'This is a simple boolean property', - type: 'boolean' - } - } -} as const; - -export const ModelWithStringSchema = { - description: 'This is a model with one string property', - type: 'object', - properties: { - prop: { - description: 'This is a simple string property', - type: 'string' - } - } -} as const; - -export const ModelWithStringErrorSchema = { - description: 'This is a model with one string property', - type: 'object', - properties: { - prop: { - description: 'This is a simple string property', - type: 'string' - } - } -} as const; - -export const Model_From_ZendeskSchema = { - description: `\`Comment\` or \`VoiceComment\`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets)`, - type: 'string' -} as const; - -export const ModelWithNullableStringSchema = { - description: 'This is a model with one string property', - type: 'object', - required: ['nullableRequiredProp1', 'nullableRequiredProp2'], - properties: { - nullableProp1: { - description: 'This is a simple string property', - type: 'string', - nullable: true - }, - nullableRequiredProp1: { - description: 'This is a simple string property', - type: 'string', - nullable: true - }, - nullableProp2: { - description: 'This is a simple string property', - nullable: true, - type: 'string' - }, - nullableRequiredProp2: { - description: 'This is a simple string property', - nullable: true, - type: 'string' - }, - 'foo_bar-enum': { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] - } - } -} as const; - -export const ModelWithEnumSchema = { - description: 'This is a model with one enum', - type: 'object', - properties: { - 'foo_bar-enum': { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] - }, - statusCode: { - description: 'These are the HTTP error code enums', - enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar'] - }, - bool: { - description: 'Simple boolean enum', - type: 'boolean', - enum: [true] - } - } -} as const; - -export const ModelWithEnumWithHyphenSchema = { - description: 'This is a model with one enum with escaped name', - type: 'object', - properties: { - 'foo-bar-baz-qux': { - type: 'string', - enum: ['3.0'], - title: 'Foo-Bar-Baz-Qux', - default: '3.0' - } - } -} as const; - -export const ModelWithEnumFromDescriptionSchema = { - description: 'This is a model with one enum', - type: 'object', - properties: { - test: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' - } - } -} as const; - -export const ModelWithNestedEnumsSchema = { - description: 'This is a model with nested enums', - type: 'object', - properties: { - dictionaryWithEnum: { - type: 'object', - additionalProperties: { - enum: ['Success', 'Warning', 'Error'] - } - }, - dictionaryWithEnumFromDescription: { - type: 'object', - additionalProperties: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' - } - }, - arrayWithEnum: { - type: 'array', - items: { - enum: ['Success', 'Warning', 'Error'] - } - }, - arrayWithDescription: { - type: 'array', - items: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' - } - }, - 'foo_bar-enum': { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] - } - } -} as const; - -export const ModelWithReferenceSchema = { - description: 'This is a model with one property containing a reference', - type: 'object', - properties: { - prop: { - '$ref': '#/components/schemas/ModelWithProperties' - } - } -} as const; - -export const ModelWithArrayReadOnlyAndWriteOnlySchema = { - description: 'This is a model with one property containing an array', - type: 'object', - properties: { - prop: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnly' - } - }, - propWithFile: { - type: 'array', - items: { - format: 'binary', - type: 'string' - } - }, - propWithNumber: { - type: 'array', - items: { - type: 'number' - } - } - } -} as const; - -export const ModelWithArraySchema = { - description: 'This is a model with one property containing an array', - type: 'object', - properties: { - prop: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithString' - } - }, - propWithFile: { - type: 'array', - items: { - format: 'binary', - type: 'string' - } - }, - propWithNumber: { - type: 'array', - items: { - type: 'number' - } - } - } -} as const; - -export const ModelWithDictionarySchema = { - description: 'This is a model with one property containing a dictionary', - type: 'object', - properties: { - prop: { - type: 'object', - additionalProperties: { - type: 'string' - } - } - } -} as const; - -export const DeprecatedModelSchema = { - deprecated: true, - description: 'This is a deprecated model with a deprecated property', - type: 'object', - properties: { - prop: { - deprecated: true, - description: 'This is a deprecated property', - type: 'string' - } - } -} as const; - -export const ModelWithCircularReferenceSchema = { - description: 'This is a model with one property containing a circular reference', - type: 'object', - properties: { - prop: { - '$ref': '#/components/schemas/ModelWithCircularReference' - } - } -} as const; - -export const CompositionWithOneOfSchema = { - description: "This is a model with one property with a 'one of' relationship", - type: 'object', - properties: { - propA: { - type: 'object', - oneOf: [ - { - '$ref': '#/components/schemas/ModelWithString' - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const CompositionWithOneOfAnonymousSchema = { - description: "This is a model with one property with a 'one of' relationship where the options are not $ref", - type: 'object', - properties: { - propA: { - type: 'object', - oneOf: [ - { - description: 'Anonymous object type', - type: 'object', - properties: { - propA: { - type: 'string' - } - } - }, - { - description: 'Anonymous string type', - type: 'string' - }, - { - description: 'Anonymous integer type', - type: 'integer' - } - ] - } - } -} as const; - -export const ModelCircleSchema = { - description: 'Circle', - type: 'object', - required: ['kind'], - properties: { - kind: { - type: 'string' - }, - radius: { - type: 'number' - } - } -} as const; - -export const ModelSquareSchema = { - description: 'Square', - type: 'object', - required: ['kind'], - properties: { - kind: { - type: 'string' - }, - sideLength: { - type: 'number' - } - } -} as const; - -export const CompositionWithOneOfDiscriminatorSchema = { - description: "This is a model with one property with a 'one of' relationship where the options are not $ref", - type: 'object', - oneOf: [ - { - '$ref': '#/components/schemas/ModelCircle' - }, - { - '$ref': '#/components/schemas/ModelSquare' - } - ], - discriminator: { - propertyName: 'kind', - mapping: { - circle: '#/components/schemas/ModelCircle', - square: '#/components/schemas/ModelSquare' - } - } -} as const; - -export const CompositionWithAnyOfSchema = { - description: "This is a model with one property with a 'any of' relationship", - type: 'object', - properties: { - propA: { - type: 'object', - anyOf: [ - { - '$ref': '#/components/schemas/ModelWithString' - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const CompositionWithAnyOfAnonymousSchema = { - description: "This is a model with one property with a 'any of' relationship where the options are not $ref", - type: 'object', - properties: { - propA: { - type: 'object', - anyOf: [ - { - description: 'Anonymous object type', - type: 'object', - properties: { - propA: { - type: 'string' - } - } - }, - { - description: 'Anonymous string type', - type: 'string' - }, - { - description: 'Anonymous integer type', - type: 'integer' - } - ] - } - } -} as const; - -export const CompositionWithNestedAnyAndTypeNullSchema = { - description: "This is a model with nested 'any of' property with a type null", - type: 'object', - properties: { - propA: { - type: 'object', - anyOf: [ - { - items: { - nullable: true, - allOf: [ - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - }, - type: 'array' - }, - { - items: { - nullable: true, - allOf: [ - { - '$ref': '#/components/schemas/ModelWithArray' - } - ] - }, - type: 'array' - } - ] - } - } -} as const; - -export const _3e_num_1ПериодSchema = { - enum: ['Bird', 'Dog'], - type: 'string' -} as const; - -export const ConstValueSchema = { - enum: ['ConstValue'], - type: 'string' -} as const; - -export const CompositionWithNestedAnyOfAndNullSchema = { - description: "This is a model with one property with a 'any of' relationship where the options are not $ref", - type: 'object', - properties: { - propA: { - nullable: true, - allOf: [ - { - items: { - anyOf: [ - { - '$ref': '#/components/schemas/3e-num_1Период' - }, - { - '$ref': '#/components/schemas/ConstValue' - } - ] - }, - type: 'array' - } - ], - title: 'Scopes' - } - } -} as const; - -export const CompositionWithOneOfAndNullableSchema = { - description: "This is a model with one property with a 'one of' relationship", - type: 'object', - properties: { - propA: { - nullable: true, - type: 'object', - oneOf: [ - { - type: 'object', - properties: { - boolean: { - type: 'boolean' - } - } - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const CompositionWithOneOfAndSimpleDictionarySchema = { - description: 'This is a model that contains a simple dictionary within composition', - type: 'object', - properties: { - propA: { - oneOf: [ - { - type: 'boolean' - }, - { - type: 'object', - additionalProperties: { - type: 'number' - } - } - ] - } - } -} as const; - -export const CompositionWithOneOfAndSimpleArrayDictionarySchema = { - description: 'This is a model that contains a dictionary of simple arrays within composition', - type: 'object', - properties: { - propA: { - oneOf: [ - { - type: 'boolean' - }, - { - type: 'object', - additionalProperties: { - type: 'array', - items: { - type: 'boolean' - } - } - } - ] - } - } -} as const; - -export const CompositionWithOneOfAndComplexArrayDictionarySchema = { - description: 'This is a model that contains a dictionary of complex arrays (composited) within composition', - type: 'object', - properties: { - propA: { - oneOf: [ - { - type: 'boolean' - }, - { - type: 'object', - additionalProperties: { - type: 'array', - items: { - oneOf: [ - { - type: 'number' - }, - { - type: 'string' - } - ] - } - } - } - ] - } - } -} as const; - -export const CompositionWithAllOfAndNullableSchema = { - description: "This is a model with one property with a 'all of' relationship", - type: 'object', - properties: { - propA: { - nullable: true, - type: 'object', - allOf: [ - { - type: 'object', - properties: { - boolean: { - type: 'boolean' - } - } - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const CompositionWithAnyOfAndNullableSchema = { - description: "This is a model with one property with a 'any of' relationship", - type: 'object', - properties: { - propA: { - nullable: true, - type: 'object', - anyOf: [ - { - type: 'object', - properties: { - boolean: { - type: 'boolean' - } - } - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const CompositionBaseModelSchema = { - description: 'This is a base model with two simple optional properties', - type: 'object', - properties: { - firstName: { - type: 'string' - }, - lastname: { - type: 'string' - } - } -} as const; - -export const CompositionExtendedModelSchema = { - description: 'This is a model that extends the base model', - type: 'object', - allOf: [ - { - '$ref': '#/components/schemas/CompositionBaseModel' - } - ], - properties: { - age: { - type: 'number' - } - }, - required: ['firstName', 'lastname', 'age'] -} as const; - -export const ModelWithPropertiesSchema = { - description: 'This is a model with one nested property', - type: 'object', - required: ['required', 'requiredAndReadOnly', 'requiredAndNullable'], - properties: { - required: { - type: 'string' - }, - requiredAndReadOnly: { - type: 'string', - readOnly: true - }, - requiredAndNullable: { - type: 'string', - nullable: true - }, - string: { - type: 'string' - }, - number: { - type: 'number' - }, - boolean: { - type: 'boolean' - }, - reference: { - '$ref': '#/components/schemas/ModelWithString' - }, - 'property with space': { - type: 'string' - }, - default: { - type: 'string' - }, - try: { - type: 'string' - }, - '@namespace.string': { - type: 'string', - readOnly: true - }, - '@namespace.integer': { - type: 'integer', - readOnly: true - } - } -} as const; - -export const ModelWithNestedPropertiesSchema = { - description: 'This is a model with one nested property', - type: 'object', - required: ['first'], - properties: { - first: { - type: 'object', - required: ['second'], - readOnly: true, - nullable: true, - properties: { - second: { - type: 'object', - required: ['third'], - readOnly: true, - nullable: true, - properties: { - third: { - type: 'string', - required: true, - readOnly: true, - nullable: true - } - } - } - } - } - } -} as const; - -export const ModelWithDuplicatePropertiesSchema = { - description: 'This is a model with duplicated properties', - type: 'object', - properties: { - prop: { - '$ref': '#/components/schemas/ModelWithString' - } - } -} as const; - -export const ModelWithOrderedPropertiesSchema = { - description: 'This is a model with ordered properties', - type: 'object', - properties: { - zebra: { - type: 'string' - }, - apple: { - type: 'string' - }, - hawaii: { - type: 'string' - } - } -} as const; - -export const ModelWithDuplicateImportsSchema = { - description: 'This is a model with duplicated imports', - type: 'object', - properties: { - propA: { - '$ref': '#/components/schemas/ModelWithString' - }, - propB: { - '$ref': '#/components/schemas/ModelWithString' - }, - propC: { - '$ref': '#/components/schemas/ModelWithString' - } - } -} as const; - -export const ModelThatExtendsSchema = { - description: 'This is a model that extends another model', - type: 'object', - allOf: [ - { - '$ref': '#/components/schemas/ModelWithString' - }, - { - type: 'object', - properties: { - propExtendsA: { - type: 'string' - }, - propExtendsB: { - '$ref': '#/components/schemas/ModelWithString' - } - } - } - ] -} as const; - -export const ModelThatExtendsExtendsSchema = { - description: 'This is a model that extends another model', - type: 'object', - allOf: [ - { - '$ref': '#/components/schemas/ModelWithString' - }, - { - '$ref': '#/components/schemas/ModelThatExtends' - }, - { - type: 'object', - properties: { - propExtendsC: { - type: 'string' - }, - propExtendsD: { - '$ref': '#/components/schemas/ModelWithString' - } - } - } - ] -} as const; - -export const ModelWithPatternSchema = { - description: 'This is a model that contains a some patterns', - type: 'object', - required: ['key', 'name'], - properties: { - key: { - maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$', - type: 'string' - }, - name: { - maxLength: 255, - type: 'string' - }, - enabled: { - type: 'boolean', - readOnly: true - }, - modified: { - type: 'string', - format: 'date-time', - readOnly: true - }, - id: { - type: 'string', - pattern: '^\\d{2}-\\d{3}-\\d{4}$' - }, - text: { - type: 'string', - pattern: '^\\w+$' - }, - patternWithSingleQuotes: { - type: 'string', - pattern: "^[a-zA-Z0-9']*$" - }, - patternWithNewline: { - type: 'string', - pattern: 'aaa\\nbbb' - }, - patternWithBacktick: { - type: 'string', - pattern: 'aaa`bbb' - } - } -} as const; - -export const FileSchema = { - required: ['mime'], - type: 'object', - properties: { - id: { - title: 'Id', - type: 'string', - readOnly: true, - minLength: 1 - }, - updated_at: { - title: 'Updated at', - type: 'string', - format: 'date-time', - readOnly: true - }, - created_at: { - title: 'Created at', - type: 'string', - format: 'date-time', - readOnly: true - }, - mime: { - title: 'Mime', - type: 'string', - maxLength: 24, - minLength: 1 - }, - file: { - title: 'File', - type: 'string', - readOnly: true, - format: 'uri' - } - } -} as const; - -export const defaultSchema = { - type: 'object', - properties: { - name: { - type: 'string' - } - } -} as const; - -export const PageableSchema = { - type: 'object', - properties: { - page: { - minimum: 0, - type: 'integer', - format: 'int32', - default: 0 - }, - size: { - minimum: 1, - type: 'integer', - format: 'int32' - }, - sort: { - type: 'array', - items: { - type: 'string' - } - } - } -} as const; - -export const FreeFormObjectWithoutAdditionalPropertiesSchema = { - description: 'This is a free-form object without additionalProperties.', - type: 'object' -} as const; - -export const FreeFormObjectWithAdditionalPropertiesEqTrueSchema = { - description: 'This is a free-form object with additionalProperties: true.', - type: 'object', - additionalProperties: true -} as const; - -export const FreeFormObjectWithAdditionalPropertiesEqEmptyObjectSchema = { - description: 'This is a free-form object with additionalProperties: {}.', - type: 'object', - additionalProperties: {} -} as const; - -export const ModelWithConstSchema = { - type: 'object', - properties: { - String: { - enum: ['String'], - type: 'string' - }, - number: { - enum: [0], - type: 'number' - }, - null: { - nullable: true - }, - withType: { - enum: ['Some string'], - type: 'string' - } - } -} as const; - -export const ModelWithAdditionalPropertiesEqTrueSchema = { - description: 'This is a model with one property and additionalProperties: true', - type: 'object', - properties: { - prop: { - description: 'This is a simple string property', - type: 'string' - } - }, - additionalProperties: true -} as const; - -export const NestedAnyOfArraysNullableSchema = { - properties: { - nullableArray: { - nullable: true, - allOf: [ - { - items: { - anyOf: [ - { - type: 'string' - }, - { - type: 'boolean' - } - ] - }, - type: 'array' - } - ] - } - }, - type: 'object' -} as const; - -export const CompositionWithOneOfAndPropertiesSchema = { - type: 'object', - oneOf: [ - { - type: 'object', - required: ['foo'], - properties: { - foo: { - '$ref': '#/components/parameters/SimpleParameter' - } - }, - additionalProperties: false - }, - { - type: 'object', - required: ['bar'], - properties: { - bar: { - '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' - } - }, - additionalProperties: false - } - ], - required: ['baz', 'qux'], - properties: { - baz: { - type: 'integer', - format: 'uint16', - minimum: 0, - nullable: true - }, - qux: { - type: 'integer', - format: 'uint8', - minimum: 0 - } - } -} as const; - -export const NullableObjectSchema = { - description: 'An object that can be null', - nullable: true, - type: 'object', - properties: { - foo: { - type: 'string' - } - }, - default: null -} as const; - -export const CharactersInDescriptionSchema = { - type: 'string', - description: 'Some % character' -} as const; - -export const ModelWithNullableObjectSchema = { - type: 'object', - properties: { - data: { - '$ref': '#/components/schemas/NullableObject' - } - } -} as const; - -export const ModelWithOneOfEnumSchema = { - oneOf: [ - { - type: 'object', - required: ['foo'], - properties: { - foo: { - type: 'string', - enum: ['Bar'] - } - } - }, - { - type: 'object', - required: ['foo'], - properties: { - foo: { - type: 'string', - enum: ['Baz'] - } - } - }, - { - type: 'object', - required: ['foo'], - properties: { - foo: { - type: 'string', - enum: ['Qux'] - } - } - }, - { - type: 'object', - required: ['content', 'foo'], - properties: { - content: { - type: 'string', - format: 'date-time' - }, - foo: { - type: 'string', - enum: ['Quux'] - } - } - }, - { - type: 'object', - required: ['content', 'foo'], - properties: { - content: { - type: 'array', - items: { - type: 'string', - format: 'date-time' - }, - maxItems: 2, - minItems: 2 - }, - foo: { - type: 'string', - enum: ['Corge'] - } - } - } - ] -} as const; - -export const ModelWithNestedArrayEnumsDataFooSchema = { - enum: ['foo', 'bar'], - type: 'string' -} as const; - -export const ModelWithNestedArrayEnumsDataBarSchema = { - enum: ['baz', 'qux'], - type: 'string' -} as const; - -export const ModelWithNestedArrayEnumsDataSchema = { - type: 'object', - properties: { - foo: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' - } - }, - bar: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataBar' - } - } - } -} as const; - -export const ModelWithNestedArrayEnumsSchema = { - type: 'object', - properties: { - array_strings: { - type: 'array', - items: { - type: 'string' - } - }, - data: { - allOf: [ - { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsData' - } - ] - } - } -} as const; - -export const ModelWithNestedCompositionEnumsSchema = { - type: 'object', - properties: { - foo: { - allOf: [ - { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' - } - ] - } - } -} as const; - -export const ModelWithReadOnlyAndWriteOnlySchema = { - type: 'object', - required: ['foo', 'bar', 'baz'], - properties: { - foo: { - type: 'string' - }, - bar: { - readOnly: true, - type: 'string' - }, - baz: { - type: 'string', - writeOnly: true - } - } -} as const; - -export const ModelWithConstantSizeArraySchema = { - type: 'array', - items: { - type: 'number' - }, - minItems: 2, - maxItems: 2 -} as const; - -export const ModelWithAnyOfConstantSizeArraySchema = { - type: 'array', - items: { - oneOf: [ - { - type: 'number' - }, - { - type: 'string' - } - ] - }, - minItems: 3, - maxItems: 3 -} as const; - -export const ModelWithPrefixItemsConstantSizeArraySchema = { - type: 'array', - items: { - oneOf: [ - { - '$ref': '#/components/schemas/ModelWithInteger' - }, - { - type: 'number' - }, - { - type: 'string' - } - ] - } -} as const; - -export const ModelWithAnyOfConstantSizeArrayNullableSchema = { - type: 'array', - items: { - oneOf: [ - { - type: 'number', - nullable: true - }, - { - type: 'string' - } - ] - }, - minItems: 3, - maxItems: 3 -} as const; - -export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsSchema = { - type: 'array', - items: { - oneOf: [ - { - type: 'number' - }, - { - '$ref': '#/components/schemas/import' - } - ] - }, - minItems: 2, - maxItems: 2 -} as const; - -export const ModelWithAnyOfConstantSizeArrayAndIntersectSchema = { - type: 'array', - items: { - allOf: [ - { - type: 'number' - }, - { - type: 'string' - } - ] - }, - minItems: 2, - maxItems: 2 -} as const; - -export const ModelWithNumericEnumUnionSchema = { - type: 'object', - properties: { - value: { - type: 'number', - description: 'Период', - enum: [-10, -1, 0, 1, 3, 6, 12] - } - } -} as const; - -export const ModelWithBackticksInDescriptionSchema = { - description: 'Some description with `back ticks`', - type: 'object', - properties: { - template: { - type: 'string', - description: `The template \`that\` should be used for parsing and importing the contents of the CSV file. - -

There is one placeholder currently supported:

  • \${x} - refers to the n-th column in the CSV file, e.g. \${1}, \${2}, ...)

Example of a correct JSON template:

-
-[
-  {
-    "resourceType": "Asset",
-    "identifier": {
-      "name": "\${1}",
-      "domain": {
-        "name": "\${2}",
-        "community": {
-          "name": "Some Community"
-        }
-      }
-    },
-    "attributes" : {
-      "00000000-0000-0000-0000-000000003115" : [ {
-        "value" : "\${3}" 
-      } ],
-      "00000000-0000-0000-0000-000000000222" : [ {
-        "value" : "\${4}"
-      } ]
-    }
-  }
-]
-
` - } - } -} as const; - -export const ModelWithOneOfAndPropertiesSchema = { - type: 'object', - oneOf: [ - { - '$ref': '#/components/parameters/SimpleParameter' - }, - { - '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' - } - ], - required: ['baz', 'qux'], - properties: { - baz: { - type: 'integer', - format: 'uint16', - minimum: 0, - nullable: true - }, - qux: { - type: 'integer', - format: 'uint8', - minimum: 0 - } - } -} as const; - -export const ParameterSimpleParameterUnusedSchema = { - description: 'Model used to test deduplication strategy (unused)', - type: 'string' -} as const; - -export const PostServiceWithEmptyTagResponseSchema = { - description: 'Model used to test deduplication strategy', - type: 'string' -} as const; - -export const PostServiceWithEmptyTagResponse2Schema = { - description: 'Model used to test deduplication strategy', - type: 'string' -} as const; - -export const DeleteFooDataSchema = { - description: 'Model used to test deduplication strategy', - type: 'string' -} as const; - -export const DeleteFooData2Schema = { - description: 'Model used to test deduplication strategy', - type: 'string' -} as const; - -export const importSchema = { - description: 'Model with restricted keyword name', - type: 'string' -} as const; - -export const SchemaWithFormRestrictedKeysSchema = { - properties: { - description: { - type: 'string' - }, - 'x-enum-descriptions': { - type: 'string' - }, - 'x-enum-varnames': { - type: 'string' - }, - 'x-enumNames': { - type: 'string' - }, - title: { - type: 'string' - }, - object: { - type: 'object', - properties: { - description: { - type: 'string' - }, - 'x-enum-descriptions': { - type: 'string' - }, - 'x-enum-varnames': { - type: 'string' - }, - 'x-enumNames': { - type: 'string' - }, - title: { - type: 'string' - } - } - }, - array: { - type: 'array', - items: { - type: 'object', - properties: { - description: { - type: 'string' - }, - 'x-enum-descriptions': { - type: 'string' - }, - 'x-enum-varnames': { - type: 'string' - }, - 'x-enumNames': { - type: 'string' - }, - title: { - type: 'string' - } - } - } - } - } -} as const; - -export const io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptionsSchema = { - description: 'This schema was giving PascalCase transformations a hard time', - properties: { - preconditions: { - allOf: [ - { - '$ref': '#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions' - } - ], - description: 'Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.' - } - }, - type: 'object' -} as const; - -export const io_k8s_apimachinery_pkg_apis_meta_v1_PreconditionsSchema = { - description: 'This schema was giving PascalCase transformations a hard time', - properties: { - resourceVersion: { - description: 'Specifies the target ResourceVersion', - type: 'string' - }, - uid: { - description: 'Specifies the target UID.', - type: 'string' - } - }, - type: 'object' -} as const; - -export const AdditionalPropertiesUnknownIssueSchema = { - type: 'object', - properties: {}, - additionalProperties: { - anyOf: [ - { - type: 'string' - }, - { - type: 'number' - } - ] - } -} as const; - -export const AdditionalPropertiesUnknownIssue2Schema = { - type: 'object', - additionalProperties: { - anyOf: [ - { - type: 'string' - }, - { - type: 'number' - } - ] - } -} as const; - -export const AdditionalPropertiesUnknownIssue3Schema = { - type: 'object', - allOf: [ - { - type: 'string' - }, - { - type: 'object', - required: ['entries'], - properties: { - entries: { - type: 'object', - additionalProperties: { - '$ref': '#/components/schemas/AdditionalPropertiesUnknownIssue' - } - } - } - } - ] -} as const; - -export const AdditionalPropertiesIntegerIssueSchema = { - type: 'object', - required: ['value'], - properties: { - value: { - type: 'integer' - } - }, - additionalProperties: { - type: 'integer' - } -} as const; - -export const OneOfAllOfIssueSchema = { - oneOf: [ - { - allOf: [ - { - oneOf: [ - { - '$ref': '#/components/schemas/ConstValue' - }, - { - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]' - } - ] - }, - { - '$ref': '#/components/schemas/3e-num_1Период' - } - ] - }, - { - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]' - } - ] -} as const; - -export const Generic_Schema_Duplicate_Issue_1_System_Boolean_Schema = { - type: 'object', - properties: { - item: { - type: 'boolean' - }, - error: { - type: 'string', - nullable: true - }, - hasError: { - type: 'boolean', - readOnly: true - }, - data: { - type: 'object', - properties: {}, - additionalProperties: false - } - }, - additionalProperties: false -} as const; - -export const Generic_Schema_Duplicate_Issue_1_System_String_Schema = { - type: 'object', - properties: { - item: { - type: 'string', - nullable: true - }, - error: { - type: 'string', - nullable: true - }, - hasError: { - type: 'boolean', - readOnly: true - } - }, - additionalProperties: false -} as const; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/sdk.gen.ts deleted file mode 100644 index 7f932711f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/types.gen.ts deleted file mode 100644 index 8d98b563e..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/default/types.gen.ts +++ /dev/null @@ -1,2023 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: unknown; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = Array; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -export type SimpleRequestBody = ModelWithString; - -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts deleted file mode 100644 index caa002cde..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base', - throwOnError: true -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts deleted file mode 100644 index 4300b2379..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts deleted file mode 100644 index 8d98b563e..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts +++ /dev/null @@ -1,2023 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: unknown; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = Array; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -export type SimpleRequestBody = ModelWithString; - -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts deleted file mode 100644 index b3e776847..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { PostFooData, PostFooResponse } from './types.gen'; -import { postFooResponseTransformer } from './transformers.gen'; -import { zPostFooResponse } from './zod.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const postFoo = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - responseTransformer: postFooResponseTransformer, - responseValidator: async (data) => { - return await zPostFooResponse.parseAsync(data); - }, - url: '/foo', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts deleted file mode 100644 index 419690a91..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { PostFooResponse } from './types.gen'; - -const fooSchemaResponseTransformer = (data: any) => { - data.foo = BigInt(data.foo.toString()); - return data; -}; - -export const postFooResponseTransformer = async (data: any): Promise => { - data = fooSchemaResponseTransformer(data); - return data; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/types.gen.ts deleted file mode 100644 index a796d8382..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/types.gen.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - bar?: number; - foo: bigint; - id: string; -}; - -export type Bar = { - foo: number; - [key: string]: number; -}; - -export type PostFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type PostFooResponses = { - /** - * OK - */ - 200: Foo; -}; - -export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/zod.gen.ts deleted file mode 100644 index 328fe6811..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/transformers/type-format/zod.gen.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { z } from 'zod'; - -export const zFoo = z.object({ - bar: z.number().int().optional(), - foo: z.coerce.bigint(), - id: z.string() -}); - -export const zBar = z.object({ - foo: z.number().int() -}); - -export const zPostFooResponse = zFoo; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts deleted file mode 100644 index 8ef32fabb..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts +++ /dev/null @@ -1,87 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type ReadableFooReadWrite = ReadableBarRead; - -export type WritableFooReadWrite = WritableBarRead & { - foo?: string; -}; - -export type ReadableFooRead = ReadableBarRead & { - readonly foo?: string; -}; - -export type WritableFooRead = WritableBarRead; - -export type ReadableFooWrite = ReadableBarWrite; - -export type WritableFooWrite = WritableBarWrite & { - foo?: string; -}; - -export type ReadableBarRead = Baz | { - readonly bar?: string; -}; - -export type WritableBarRead = Baz; - -export type ReadableBarWrite = Baz; - -export type WritableBarWrite = Baz | { - bar?: string; -}; - -export type Baz = { - baz?: string; -}; - -export type PostFooReadWriteData = { - body: WritableFooReadWrite; - path?: never; - query?: never; - url: '/foo-read-write'; -}; - -export type PostFooReadWriteResponses = { - /** - * OK - */ - 200: ReadableFooReadWrite; -}; - -export type PostFooReadWriteResponse = PostFooReadWriteResponses[keyof PostFooReadWriteResponses]; - -export type PostFooReadData = { - body: WritableFooRead; - path?: never; - query?: never; - url: '/foo-read'; -}; - -export type PostFooReadResponses = { - /** - * OK - */ - 200: ReadableFooRead; -}; - -export type PostFooReadResponse = PostFooReadResponses[keyof PostFooReadResponses]; - -export type PostFooWriteData = { - body: WritableFooWrite; - path?: never; - query?: never; - url: '/foo-write'; -}; - -export type PostFooWriteResponses = { - /** - * OK - */ - 200: ReadableFooWrite; -}; - -export type PostFooWriteResponse = PostFooWriteResponses[keyof PostFooWriteResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts deleted file mode 100644 index 3035bdbfd..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts +++ /dev/null @@ -1,77 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type FooReadWrite = BarRead & { - foo?: string; -}; - -export type FooRead = BarRead & { - readonly foo?: string; -}; - -export type FooWrite = BarWrite & { - foo?: string; -}; - -export type BarRead = Baz | { - readonly bar?: string; -}; - -export type BarWrite = Baz | { - bar?: string; -}; - -export type Baz = { - baz?: string; -}; - -export type PostFooReadWriteData = { - body: FooReadWrite; - path?: never; - query?: never; - url: '/foo-read-write'; -}; - -export type PostFooReadWriteResponses = { - /** - * OK - */ - 200: FooReadWrite; -}; - -export type PostFooReadWriteResponse = PostFooReadWriteResponses[keyof PostFooReadWriteResponses]; - -export type PostFooReadData = { - body: FooRead; - path?: never; - query?: never; - url: '/foo-read'; -}; - -export type PostFooReadResponses = { - /** - * OK - */ - 200: FooRead; -}; - -export type PostFooReadResponse = PostFooReadResponses[keyof PostFooReadResponses]; - -export type PostFooWriteData = { - body: FooWrite; - path?: never; - query?: never; - url: '/foo-write'; -}; - -export type PostFooWriteResponses = { - /** - * OK - */ - 200: FooWrite; -}; - -export type PostFooWriteResponse = PostFooWriteResponses[keyof PostFooWriteResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts deleted file mode 100644 index 33e101093..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts +++ /dev/null @@ -1,1128 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, DefaultService, SimpleService, ParametersService, DescriptionsService, DeprecatedService, RequestBodyService, FormDataService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, UploadService, FileResponseService, ComplexService, MultipartService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/angular-query-experimental'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.export({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.import({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.import({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DeprecatedService.deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DeprecatedService.deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await FormDataService.postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await FormDataService.postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NoContentService.callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await CollectionFormatService.collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await TypesService.types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await UploadService.uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await UploadService.uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await FileResponseService.fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ComplexService.complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipartService.multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipartService.multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await MultipartService.multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ComplexService.complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts deleted file mode 100644 index e94d5103c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts +++ /dev/null @@ -1,506 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export class DefaultService { - public static export(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static patchApiVbyApiVersionNoTag(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static import(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static fooWow(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static getApiVbyApiVersionSimpleOperation(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); - } - -} - -export class SimpleService { - public static apiVVersionODataControllerCount(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); - } - - public static deleteCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static getCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static headCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static optionsCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static patchCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static postCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static putCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); - } - -} - -export class ParametersService { - public static deleteFoo(options: Options) { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); - } - - public static callWithParameters(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static callWithWeirdParameterNames(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static getCallWithOptionalParam(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static postCallWithOptionalParam(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class DescriptionsService { - public static callWithDescriptions(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); - } - -} - -export class DeprecatedService { - /** - * @deprecated - */ - public static deprecatedCall(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); - } - -} - -export class RequestBodyService { - public static postApiVbyApiVersionRequestBody(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class FormDataService { - public static postApiVbyApiVersionFormData(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); - } - -} - -export class DefaultsService { - public static callWithDefaultParameters(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callWithDefaultOptionalParameters(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callToTestOrderOfParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - -} - -export class DuplicateService { - public static duplicateName(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName2(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName3(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName4(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - -} - -export class NoContentService { - public static callWithNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); - } - - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - -} - -export class ResponseService { - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - - public static callWithResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithDuplicateResponses(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithResponses(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); - } - -} - -export class MultipleTags1Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags2Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags3Service { - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class CollectionFormatService { - public static collectionFormat(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); - } - -} - -export class TypesService { - public static types(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); - } - -} - -export class UploadService { - public static uploadFile(options: Options) { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); - } - -} - -export class FileResponseService { - public static fileResponse(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); - } - -} - -export class ComplexService { - public static complexTypes(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); - } - - public static complexParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); - } - -} - -export class MultipartService { - public static multipartResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); - } - - public static multipartRequest(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); - } - -} - -export class HeaderService { - public static callWithResultFromHeader(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); - } - -} - -export class ErrorService { - public static testErrorCode(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); - } - - /** - * Login User - */ - public static putWithFormUrlEncoded(options: Options) { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts deleted file mode 100644 index 8d98b563e..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts +++ /dev/null @@ -1,2023 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: unknown; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = Array; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -export type SimpleRequestBody = ModelWithString; - -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts deleted file mode 100644 index 6c51e6e80..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts +++ /dev/null @@ -1,1129 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/angular-query-experimental'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import type { AxiosError } from 'axios'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await export_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await import_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await import_({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts deleted file mode 100644 index 1d97df8bc..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts deleted file mode 100644 index 9e76f2fd8..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts +++ /dev/null @@ -1,410 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - responseType: 'blob', - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts deleted file mode 100644 index b970b0cd9..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts +++ /dev/null @@ -1,2023 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: unknown; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = Array; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -export type SimpleRequestBody = ModelWithString; - -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts deleted file mode 100644 index 8b834b887..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts +++ /dev/null @@ -1,1128 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/angular-query-experimental'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await export_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await import_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await import_({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts deleted file mode 100644 index 7f932711f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts deleted file mode 100644 index 8d98b563e..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts +++ /dev/null @@ -1,2023 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: unknown; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = Array; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -export type SimpleRequestBody = ModelWithString; - -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts deleted file mode 100644 index 05426b6bd..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts +++ /dev/null @@ -1,1128 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, DefaultService, SimpleService, ParametersService, DescriptionsService, DeprecatedService, RequestBodyService, FormDataService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, UploadService, FileResponseService, ComplexService, MultipartService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; -import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/react-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.export({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.import({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.import({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DeprecatedService.deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DeprecatedService.deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await FormDataService.postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await FormDataService.postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NoContentService.callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await CollectionFormatService.collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await TypesService.types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await UploadService.uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await UploadService.uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await FileResponseService.fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ComplexService.complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipartService.multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipartService.multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await MultipartService.multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ComplexService.complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts deleted file mode 100644 index e94d5103c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts +++ /dev/null @@ -1,506 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export class DefaultService { - public static export(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static patchApiVbyApiVersionNoTag(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static import(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static fooWow(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static getApiVbyApiVersionSimpleOperation(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); - } - -} - -export class SimpleService { - public static apiVVersionODataControllerCount(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); - } - - public static deleteCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static getCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static headCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static optionsCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static patchCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static postCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static putCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); - } - -} - -export class ParametersService { - public static deleteFoo(options: Options) { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); - } - - public static callWithParameters(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static callWithWeirdParameterNames(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static getCallWithOptionalParam(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static postCallWithOptionalParam(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class DescriptionsService { - public static callWithDescriptions(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); - } - -} - -export class DeprecatedService { - /** - * @deprecated - */ - public static deprecatedCall(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); - } - -} - -export class RequestBodyService { - public static postApiVbyApiVersionRequestBody(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class FormDataService { - public static postApiVbyApiVersionFormData(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); - } - -} - -export class DefaultsService { - public static callWithDefaultParameters(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callWithDefaultOptionalParameters(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callToTestOrderOfParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - -} - -export class DuplicateService { - public static duplicateName(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName2(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName3(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName4(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - -} - -export class NoContentService { - public static callWithNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); - } - - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - -} - -export class ResponseService { - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - - public static callWithResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithDuplicateResponses(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithResponses(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); - } - -} - -export class MultipleTags1Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags2Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags3Service { - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class CollectionFormatService { - public static collectionFormat(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); - } - -} - -export class TypesService { - public static types(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); - } - -} - -export class UploadService { - public static uploadFile(options: Options) { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); - } - -} - -export class FileResponseService { - public static fileResponse(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); - } - -} - -export class ComplexService { - public static complexTypes(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); - } - - public static complexParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); - } - -} - -export class MultipartService { - public static multipartResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); - } - - public static multipartRequest(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); - } - -} - -export class HeaderService { - public static callWithResultFromHeader(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); - } - -} - -export class ErrorService { - public static testErrorCode(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); - } - - /** - * Login User - */ - public static putWithFormUrlEncoded(options: Options) { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/types.gen.ts deleted file mode 100644 index 8d98b563e..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/asClass/types.gen.ts +++ /dev/null @@ -1,2023 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: unknown; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = Array; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -export type SimpleRequestBody = ModelWithString; - -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts deleted file mode 100644 index 43c7a6a12..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts +++ /dev/null @@ -1,1129 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; -import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/react-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import type { AxiosError } from 'axios'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await export_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await import_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await import_({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/client.gen.ts deleted file mode 100644 index 1d97df8bc..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/sdk.gen.ts deleted file mode 100644 index 9e76f2fd8..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/sdk.gen.ts +++ /dev/null @@ -1,410 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - responseType: 'blob', - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/types.gen.ts deleted file mode 100644 index b970b0cd9..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/axios/types.gen.ts +++ /dev/null @@ -1,2023 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: unknown; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = Array; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -export type SimpleRequestBody = ModelWithString; - -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts deleted file mode 100644 index 0cd713c64..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts +++ /dev/null @@ -1,1128 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; -import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/react-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await export_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await import_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await import_({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts deleted file mode 100644 index 7f932711f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/types.gen.ts deleted file mode 100644 index 8d98b563e..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/react-query/fetch/types.gen.ts +++ /dev/null @@ -1,2023 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: unknown; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = Array; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -export type SimpleRequestBody = ModelWithString; - -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts deleted file mode 100644 index ba5915d9f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts +++ /dev/null @@ -1,1128 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, DefaultService, SimpleService, ParametersService, DescriptionsService, DeprecatedService, RequestBodyService, FormDataService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, UploadService, FileResponseService, ComplexService, MultipartService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/solid-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.export({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.import({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.import({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DeprecatedService.deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DeprecatedService.deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await FormDataService.postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await FormDataService.postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NoContentService.callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await CollectionFormatService.collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await TypesService.types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await UploadService.uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await UploadService.uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await FileResponseService.fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ComplexService.complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipartService.multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipartService.multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await MultipartService.multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ComplexService.complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts deleted file mode 100644 index e94d5103c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts +++ /dev/null @@ -1,506 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export class DefaultService { - public static export(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static patchApiVbyApiVersionNoTag(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static import(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static fooWow(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static getApiVbyApiVersionSimpleOperation(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); - } - -} - -export class SimpleService { - public static apiVVersionODataControllerCount(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); - } - - public static deleteCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static getCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static headCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static optionsCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static patchCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static postCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static putCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); - } - -} - -export class ParametersService { - public static deleteFoo(options: Options) { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); - } - - public static callWithParameters(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static callWithWeirdParameterNames(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static getCallWithOptionalParam(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static postCallWithOptionalParam(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class DescriptionsService { - public static callWithDescriptions(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); - } - -} - -export class DeprecatedService { - /** - * @deprecated - */ - public static deprecatedCall(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); - } - -} - -export class RequestBodyService { - public static postApiVbyApiVersionRequestBody(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class FormDataService { - public static postApiVbyApiVersionFormData(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); - } - -} - -export class DefaultsService { - public static callWithDefaultParameters(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callWithDefaultOptionalParameters(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callToTestOrderOfParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - -} - -export class DuplicateService { - public static duplicateName(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName2(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName3(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName4(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - -} - -export class NoContentService { - public static callWithNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); - } - - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - -} - -export class ResponseService { - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - - public static callWithResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithDuplicateResponses(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithResponses(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); - } - -} - -export class MultipleTags1Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags2Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags3Service { - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class CollectionFormatService { - public static collectionFormat(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); - } - -} - -export class TypesService { - public static types(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); - } - -} - -export class UploadService { - public static uploadFile(options: Options) { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); - } - -} - -export class FileResponseService { - public static fileResponse(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); - } - -} - -export class ComplexService { - public static complexTypes(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); - } - - public static complexParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); - } - -} - -export class MultipartService { - public static multipartResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); - } - - public static multipartRequest(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); - } - -} - -export class HeaderService { - public static callWithResultFromHeader(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); - } - -} - -export class ErrorService { - public static testErrorCode(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); - } - - /** - * Login User - */ - public static putWithFormUrlEncoded(options: Options) { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/types.gen.ts deleted file mode 100644 index 8d98b563e..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/asClass/types.gen.ts +++ /dev/null @@ -1,2023 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: unknown; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = Array; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -export type SimpleRequestBody = ModelWithString; - -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts deleted file mode 100644 index 0855483e8..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts +++ /dev/null @@ -1,1129 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/solid-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import type { AxiosError } from 'axios'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await export_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await import_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await import_({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts deleted file mode 100644 index 1d97df8bc..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts deleted file mode 100644 index 9e76f2fd8..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts +++ /dev/null @@ -1,410 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - responseType: 'blob', - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/types.gen.ts deleted file mode 100644 index b970b0cd9..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/axios/types.gen.ts +++ /dev/null @@ -1,2023 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: unknown; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = Array; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -export type SimpleRequestBody = ModelWithString; - -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts deleted file mode 100644 index 51709ca90..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts +++ /dev/null @@ -1,1128 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/solid-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await export_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await import_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await import_({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts deleted file mode 100644 index 7f932711f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/types.gen.ts deleted file mode 100644 index 8d98b563e..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/solid-query/fetch/types.gen.ts +++ /dev/null @@ -1,2023 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: unknown; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = Array; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -export type SimpleRequestBody = ModelWithString; - -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts deleted file mode 100644 index cae8ef1f5..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts +++ /dev/null @@ -1,1128 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, DefaultService, SimpleService, ParametersService, DescriptionsService, DeprecatedService, RequestBodyService, FormDataService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, UploadService, FileResponseService, ComplexService, MultipartService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/svelte-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.export({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.import({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.import({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DeprecatedService.deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DeprecatedService.deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await FormDataService.postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await FormDataService.postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NoContentService.callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await CollectionFormatService.collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await TypesService.types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await UploadService.uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await UploadService.uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await FileResponseService.fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ComplexService.complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipartService.multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipartService.multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await MultipartService.multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ComplexService.complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts deleted file mode 100644 index e94d5103c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts +++ /dev/null @@ -1,506 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export class DefaultService { - public static export(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static patchApiVbyApiVersionNoTag(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static import(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static fooWow(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static getApiVbyApiVersionSimpleOperation(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); - } - -} - -export class SimpleService { - public static apiVVersionODataControllerCount(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); - } - - public static deleteCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static getCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static headCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static optionsCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static patchCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static postCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static putCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); - } - -} - -export class ParametersService { - public static deleteFoo(options: Options) { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); - } - - public static callWithParameters(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static callWithWeirdParameterNames(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static getCallWithOptionalParam(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static postCallWithOptionalParam(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class DescriptionsService { - public static callWithDescriptions(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); - } - -} - -export class DeprecatedService { - /** - * @deprecated - */ - public static deprecatedCall(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); - } - -} - -export class RequestBodyService { - public static postApiVbyApiVersionRequestBody(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class FormDataService { - public static postApiVbyApiVersionFormData(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); - } - -} - -export class DefaultsService { - public static callWithDefaultParameters(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callWithDefaultOptionalParameters(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callToTestOrderOfParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - -} - -export class DuplicateService { - public static duplicateName(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName2(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName3(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName4(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - -} - -export class NoContentService { - public static callWithNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); - } - - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - -} - -export class ResponseService { - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - - public static callWithResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithDuplicateResponses(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithResponses(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); - } - -} - -export class MultipleTags1Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags2Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags3Service { - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class CollectionFormatService { - public static collectionFormat(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); - } - -} - -export class TypesService { - public static types(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); - } - -} - -export class UploadService { - public static uploadFile(options: Options) { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); - } - -} - -export class FileResponseService { - public static fileResponse(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); - } - -} - -export class ComplexService { - public static complexTypes(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); - } - - public static complexParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); - } - -} - -export class MultipartService { - public static multipartResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); - } - - public static multipartRequest(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); - } - -} - -export class HeaderService { - public static callWithResultFromHeader(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); - } - -} - -export class ErrorService { - public static testErrorCode(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); - } - - /** - * Login User - */ - public static putWithFormUrlEncoded(options: Options) { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts deleted file mode 100644 index 8d98b563e..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts +++ /dev/null @@ -1,2023 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: unknown; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = Array; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -export type SimpleRequestBody = ModelWithString; - -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts deleted file mode 100644 index 9ba592ed0..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts +++ /dev/null @@ -1,1129 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/svelte-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import type { AxiosError } from 'axios'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await export_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await import_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await import_({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts deleted file mode 100644 index 1d97df8bc..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts deleted file mode 100644 index 9e76f2fd8..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts +++ /dev/null @@ -1,410 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - responseType: 'blob', - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/types.gen.ts deleted file mode 100644 index b970b0cd9..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/axios/types.gen.ts +++ /dev/null @@ -1,2023 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: unknown; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = Array; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -export type SimpleRequestBody = ModelWithString; - -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts deleted file mode 100644 index 7527d5f7d..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts +++ /dev/null @@ -1,1128 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/svelte-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await export_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await import_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await import_({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts deleted file mode 100644 index 7f932711f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts deleted file mode 100644 index 8d98b563e..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts +++ /dev/null @@ -1,2023 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: unknown; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = Array; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -export type SimpleRequestBody = ModelWithString; - -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts deleted file mode 100644 index cf95804c4..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts +++ /dev/null @@ -1,1128 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, DefaultService, SimpleService, ParametersService, DescriptionsService, DeprecatedService, RequestBodyService, FormDataService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, UploadService, FileResponseService, ComplexService, MultipartService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; -import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/vue-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.export({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.import({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.import({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DeprecatedService.deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DeprecatedService.deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await FormDataService.postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await FormDataService.postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NoContentService.callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await CollectionFormatService.collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await TypesService.types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await UploadService.uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await UploadService.uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await FileResponseService.fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ComplexService.complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipartService.multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipartService.multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await MultipartService.multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ComplexService.complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts deleted file mode 100644 index e94d5103c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts +++ /dev/null @@ -1,506 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export class DefaultService { - public static export(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static patchApiVbyApiVersionNoTag(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static import(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static fooWow(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static getApiVbyApiVersionSimpleOperation(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); - } - -} - -export class SimpleService { - public static apiVVersionODataControllerCount(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); - } - - public static deleteCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static getCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static headCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static optionsCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static patchCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static postCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static putCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); - } - -} - -export class ParametersService { - public static deleteFoo(options: Options) { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); - } - - public static callWithParameters(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static callWithWeirdParameterNames(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static getCallWithOptionalParam(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static postCallWithOptionalParam(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class DescriptionsService { - public static callWithDescriptions(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); - } - -} - -export class DeprecatedService { - /** - * @deprecated - */ - public static deprecatedCall(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); - } - -} - -export class RequestBodyService { - public static postApiVbyApiVersionRequestBody(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class FormDataService { - public static postApiVbyApiVersionFormData(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); - } - -} - -export class DefaultsService { - public static callWithDefaultParameters(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callWithDefaultOptionalParameters(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callToTestOrderOfParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - -} - -export class DuplicateService { - public static duplicateName(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName2(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName3(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName4(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - -} - -export class NoContentService { - public static callWithNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); - } - - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - -} - -export class ResponseService { - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - - public static callWithResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithDuplicateResponses(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithResponses(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); - } - -} - -export class MultipleTags1Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags2Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags3Service { - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class CollectionFormatService { - public static collectionFormat(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); - } - -} - -export class TypesService { - public static types(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); - } - -} - -export class UploadService { - public static uploadFile(options: Options) { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); - } - -} - -export class FileResponseService { - public static fileResponse(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); - } - -} - -export class ComplexService { - public static complexTypes(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); - } - - public static complexParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); - } - -} - -export class MultipartService { - public static multipartResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); - } - - public static multipartRequest(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); - } - -} - -export class HeaderService { - public static callWithResultFromHeader(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); - } - -} - -export class ErrorService { - public static testErrorCode(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); - } - - /** - * Login User - */ - public static putWithFormUrlEncoded(options: Options) { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/types.gen.ts deleted file mode 100644 index 8d98b563e..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/asClass/types.gen.ts +++ /dev/null @@ -1,2023 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: unknown; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = Array; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -export type SimpleRequestBody = ModelWithString; - -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts deleted file mode 100644 index 12019c68f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts +++ /dev/null @@ -1,1129 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; -import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/vue-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import type { AxiosError } from 'axios'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await export_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await import_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await import_({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts deleted file mode 100644 index 1d97df8bc..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts deleted file mode 100644 index 9e76f2fd8..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts +++ /dev/null @@ -1,410 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - responseType: 'blob', - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/types.gen.ts deleted file mode 100644 index b970b0cd9..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/axios/types.gen.ts +++ /dev/null @@ -1,2023 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: unknown; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = Array; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -export type SimpleRequestBody = ModelWithString; - -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts deleted file mode 100644 index 70669eb30..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts +++ /dev/null @@ -1,1128 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; -import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/vue-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await export_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await import_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await import_({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts deleted file mode 100644 index 7f932711f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/types.gen.ts deleted file mode 100644 index 8d98b563e..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/@tanstack/vue-query/fetch/types.gen.ts +++ /dev/null @@ -1,2023 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: unknown; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = Array; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -export type SimpleRequestBody = ModelWithString; - -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/fastify.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/fastify.gen.ts deleted file mode 100644 index 03f6f3f43..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/fastify.gen.ts +++ /dev/null @@ -1,130 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ImportData, ImportResponses, ApiVVersionODataControllerCountResponses, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponses, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponses, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, CallWithNoContentResponseResponses, CallWithResponseAndNoContentResponseResponses, DummyAResponses, DummyBResponses, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponses, CallWithResponsesErrors, CallWithResponsesResponses, CollectionFormatData, TypesData, TypesResponses, UploadFileData, UploadFileResponses, FileResponseData, FileResponseResponses, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponses, MultipartResponseResponses, MultipartRequestData, ComplexParamsData, ComplexParamsResponses, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Responses, PutWithFormUrlEncodedData } from './types.gen'; -import type { RouteHandler } from 'fastify'; - -export type RouteHandlers = { - import: RouteHandler<{ - Body: ImportData['body']; - Reply: Omit; - }>; - apiVVersionODataControllerCount: RouteHandler<{ - Reply: ApiVVersionODataControllerCountResponses; - }>; - getApiVbyApiVersionSimpleOperation: RouteHandler<{ - Params: GetApiVbyApiVersionSimpleOperationData['path']; - Reply: GetApiVbyApiVersionSimpleOperationResponses; - }>; - deleteFoo: RouteHandler<{ - Headers: DeleteFooData3['headers']; - Params: DeleteFooData3['path']; - }>; - callWithDescriptions: RouteHandler<{ - Querystring?: CallWithDescriptionsData['query']; - }>; - deprecatedCall: RouteHandler<{ - Headers: DeprecatedCallData['headers']; - }>; - callWithParameters: RouteHandler<{ - Body: CallWithParametersData['body']; - Headers: CallWithParametersData['headers']; - Params: CallWithParametersData['path']; - Querystring: CallWithParametersData['query']; - }>; - callWithWeirdParameterNames: RouteHandler<{ - Body: CallWithWeirdParameterNamesData['body']; - Headers: CallWithWeirdParameterNamesData['headers']; - Params: CallWithWeirdParameterNamesData['path']; - Querystring: CallWithWeirdParameterNamesData['query']; - }>; - getCallWithOptionalParam: RouteHandler<{ - Body: GetCallWithOptionalParamData['body']; - Querystring?: GetCallWithOptionalParamData['query']; - }>; - postCallWithOptionalParam: RouteHandler<{ - Body: PostCallWithOptionalParamData['body']; - Querystring: PostCallWithOptionalParamData['query']; - Reply: PostCallWithOptionalParamResponses; - }>; - postApiVbyApiVersionRequestBody: RouteHandler<{ - Body: PostApiVbyApiVersionRequestBodyData['body']; - Querystring?: PostApiVbyApiVersionRequestBodyData['query']; - }>; - postApiVbyApiVersionFormData: RouteHandler<{ - Body: PostApiVbyApiVersionFormDataData['body']; - Querystring?: PostApiVbyApiVersionFormDataData['query']; - }>; - callWithDefaultParameters: RouteHandler<{ - Querystring?: CallWithDefaultParametersData['query']; - }>; - callWithDefaultOptionalParameters: RouteHandler<{ - Querystring?: CallWithDefaultOptionalParametersData['query']; - }>; - callToTestOrderOfParams: RouteHandler<{ - Querystring: CallToTestOrderOfParamsData['query']; - }>; - callWithNoContentResponse: RouteHandler<{ - Reply: CallWithNoContentResponseResponses; - }>; - callWithResponseAndNoContentResponse: RouteHandler<{ - Reply: CallWithResponseAndNoContentResponseResponses; - }>; - dummyA: RouteHandler<{ - Reply: DummyAResponses; - }>; - dummyB: RouteHandler<{ - Reply: DummyBResponses; - }>; - callWithDuplicateResponses: RouteHandler<{ - Reply: Omit & CallWithDuplicateResponsesResponses; - }>; - callWithResponses: RouteHandler<{ - Reply: Omit & CallWithResponsesResponses; - }>; - collectionFormat: RouteHandler<{ - Querystring: CollectionFormatData['query']; - }>; - types: RouteHandler<{ - Params?: TypesData['path']; - Querystring: TypesData['query']; - Reply: TypesResponses; - }>; - uploadFile: RouteHandler<{ - Body: UploadFileData['body']; - Params: UploadFileData['path']; - Reply: UploadFileResponses; - }>; - fileResponse: RouteHandler<{ - Params: FileResponseData['path']; - Reply: FileResponseResponses; - }>; - complexTypes: RouteHandler<{ - Querystring: ComplexTypesData['query']; - Reply: ComplexTypesErrors & ComplexTypesResponses; - }>; - multipartResponse: RouteHandler<{ - Reply: MultipartResponseResponses; - }>; - multipartRequest: RouteHandler<{ - Body: MultipartRequestData['body']; - }>; - complexParams: RouteHandler<{ - Body: ComplexParamsData['body']; - Params: ComplexParamsData['path']; - Reply: ComplexParamsResponses; - }>; - callWithResultFromHeader: RouteHandler<{ - Reply: CallWithResultFromHeaderErrors & CallWithResultFromHeaderResponses; - }>; - testErrorCode: RouteHandler<{ - Querystring: TestErrorCodeData['query']; - Reply: TestErrorCodeErrors & TestErrorCodeResponses; - }>; - nonAsciiæøåÆøÅöôêÊ字符串: RouteHandler<{ - Querystring: NonAsciiæøåÆøÅöôêÊ字符串Data['query']; - Reply: NonAsciiæøåÆøÅöôêÊ字符串Responses; - }>; - putWithFormUrlEncoded: RouteHandler<{ - Body: PutWithFormUrlEncodedData['body']; - }>; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/types.gen.ts deleted file mode 100644 index 8d98b563e..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/fastify/default/types.gen.ts +++ /dev/null @@ -1,2023 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: unknown; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = Array; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -export type SimpleRequestBody = ModelWithString; - -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/my-plugin/default/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/zod/default/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/plugins/zod/default/zod.gen.ts deleted file mode 100644 index de7def82c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/plugins/zod/default/zod.gen.ts +++ /dev/null @@ -1,763 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { z } from 'zod'; - -export const z400 = z.string(); - -export const zCamelCaseCommentWithBreaks = z.number().int(); - -export const zCommentWithBreaks = z.number().int(); - -export const zCommentWithBackticks = z.number().int(); - -export const zCommentWithBackticksAndQuotes = z.number().int(); - -export const zCommentWithSlashes = z.number().int(); - -export const zCommentWithExpressionPlaceholders = z.number().int(); - -export const zCommentWithQuotes = z.number().int(); - -export const zCommentWithReservedCharacters = z.number().int(); - -export const zSimpleInteger = z.number().int(); - -export const zSimpleBoolean = z.boolean(); - -export const zSimpleString = z.string(); - -export const zNonAsciiStringæøåÆøÅöôêÊ字符串 = z.string(); - -export const zSimpleFile = z.string(); - -export const zModelWithString = z.object({ - prop: z.string().optional() -}); - -export const zSimpleReference = zModelWithString; - -export const zSimpleStringWithPattern = z.union([ - z.string().max(64).regex(/^[a-zA-Z0-9_]*$/), - z.null() -]); - -export const zEnumWithStrings = z.enum([ - 'Success', - 'Warning', - 'Error', - "'Single Quote'", - '"Double Quotes"', - 'Non-ascii: øæåôöØÆÅÔÖ字符串' -]); - -export const zEnumWithReplacedCharacters = z.enum([ - "'Single Quote'", - '"Double Quotes"', - 'øæåôöØÆÅÔÖ字符串', - '' -]); - -export const zEnumWithNumbers = z.unknown(); - -export const zEnumFromDescription = z.number(); - -export const zEnumWithExtensions = z.unknown(); - -export const zEnumWithXEnumNames = z.unknown(); - -export const zArrayWithNumbers = z.array(z.number().int()); - -export const zArrayWithBooleans = z.array(z.boolean()); - -export const zArrayWithStrings = z.array(z.string()).default(['test']); - -export const zArrayWithReferences = z.array(zModelWithString); - -export const zArrayWithArray = z.array(z.array(zModelWithString)); - -export const zArrayWithProperties = z.array(z.object({ - '16x16': zCamelCaseCommentWithBreaks.optional(), - bar: z.string().optional() -})); - -export const zArrayWithAnyOfProperties = z.array(z.unknown()); - -export const zAnyOfAnyAndNull = z.object({ - data: z.unknown().optional() -}); - -export const zAnyOfArrays = z.object({ - results: z.array(z.unknown()).optional() -}); - -export const zDictionaryWithString = z.object({}); - -export const zDictionaryWithPropertiesAndAdditionalProperties = z.object({ - foo: z.number().optional(), - bar: z.boolean().optional() -}); - -export const zDictionaryWithReference = z.object({}); - -export const zDictionaryWithArray = z.object({}); - -export const zDictionaryWithDictionary = z.object({}); - -export const zDictionaryWithProperties = z.object({}); - -export const zModelWithInteger = z.object({ - prop: z.number().int().optional() -}); - -export const zModelWithBoolean = z.object({ - prop: z.boolean().optional() -}); - -export const zModelWithStringError = z.object({ - prop: z.string().optional() -}); - -export const zModelFromZendesk = z.string(); - -export const zModelWithNullableString = z.object({ - nullableProp1: z.union([ - z.string(), - z.null() - ]).optional(), - nullableRequiredProp1: z.union([ - z.string(), - z.null() - ]), - nullableProp2: z.union([ - z.string(), - z.null() - ]).optional(), - nullableRequiredProp2: z.union([ - z.string(), - z.null() - ]), - 'foo_bar-enum': z.enum([ - 'Success', - 'Warning', - 'Error', - 'ØÆÅ字符串' - ]).optional() -}); - -export const zModelWithEnum = z.object({ - 'foo_bar-enum': z.enum([ - 'Success', - 'Warning', - 'Error', - 'ØÆÅ字符串' - ]).optional(), - statusCode: z.enum([ - '100', - '200 FOO', - '300 FOO_BAR', - '400 foo-bar', - '500 foo.bar', - '600 foo&bar' - ]).optional(), - bool: z.unknown().optional() -}); - -export const zModelWithEnumWithHyphen = z.object({ - 'foo-bar-baz-qux': z.enum([ - '3.0' - ]).optional() -}); - -export const zModelWithEnumFromDescription = z.object({ - test: z.number().int().optional() -}); - -export const zModelWithNestedEnums = z.object({ - dictionaryWithEnum: z.object({}).optional(), - dictionaryWithEnumFromDescription: z.object({}).optional(), - arrayWithEnum: z.array(z.enum([ - 'Success', - 'Warning', - 'Error' - ])).optional(), - arrayWithDescription: z.array(z.number().int()).optional(), - 'foo_bar-enum': z.enum([ - 'Success', - 'Warning', - 'Error', - 'ØÆÅ字符串' - ]).optional() -}); - -export const zModelWithProperties = z.object({ - required: z.string(), - requiredAndReadOnly: z.string().readonly(), - requiredAndNullable: z.union([ - z.string(), - z.null() - ]), - string: z.string().optional(), - number: z.number().optional(), - boolean: z.boolean().optional(), - reference: zModelWithString.optional(), - 'property with space': z.string().optional(), - default: z.string().optional(), - try: z.string().optional(), - '@namespace.string': z.string().readonly().optional(), - '@namespace.integer': z.number().int().readonly().optional() -}); - -export const zModelWithReference = z.object({ - prop: zModelWithProperties.optional() -}); - -export const zModelWithReadOnlyAndWriteOnly = z.object({ - foo: z.string(), - bar: z.string().readonly(), - baz: z.string() -}); - -export const zModelWithArrayReadOnlyAndWriteOnly = z.object({ - prop: z.array(zModelWithReadOnlyAndWriteOnly).optional(), - propWithFile: z.array(z.string()).optional(), - propWithNumber: z.array(z.number()).optional() -}); - -export const zModelWithArray = z.object({ - prop: z.array(zModelWithString).optional(), - propWithFile: z.array(z.string()).optional(), - propWithNumber: z.array(z.number()).optional() -}); - -export const zModelWithDictionary = z.object({ - prop: z.object({}).optional() -}); - -export const zDeprecatedModel = z.object({ - prop: z.string().optional() -}); - -export const zModelWithCircularReference: z.AnyZodObject = z.object({ - prop: z.lazy(() => { - return zModelWithCircularReference; - }).optional() -}); - -export const zCompositionWithOneOf = z.object({ - propA: z.union([ - zModelWithString, - zModelWithEnum, - zModelWithArray, - zModelWithDictionary - ]).optional() -}); - -export const zCompositionWithOneOfAnonymous = z.object({ - propA: z.union([ - z.object({ - propA: z.string().optional() - }), - z.string(), - z.number().int() - ]).optional() -}); - -export const zModelCircle = z.object({ - kind: z.string(), - radius: z.number().optional() -}); - -export const zModelSquare = z.object({ - kind: z.string(), - sideLength: z.number().optional() -}); - -export const zCompositionWithOneOfDiscriminator = z.union([ - z.object({ - kind: z.literal('circle').optional() - }).merge(zModelCircle), - z.object({ - kind: z.literal('square').optional() - }).merge(zModelSquare) -]); - -export const zCompositionWithAnyOf = z.object({ - propA: z.union([ - zModelWithString, - zModelWithEnum, - zModelWithArray, - zModelWithDictionary - ]).optional() -}); - -export const zCompositionWithAnyOfAnonymous = z.object({ - propA: z.union([ - z.object({ - propA: z.string().optional() - }), - z.string(), - z.number().int() - ]).optional() -}); - -export const zCompositionWithNestedAnyAndTypeNull = z.object({ - propA: z.union([ - z.array(z.union([ - zModelWithDictionary, - z.null() - ])), - z.array(z.union([ - zModelWithArray, - z.null() - ])) - ]).optional() -}); - -export const z3eNum1Период = z.enum([ - 'Bird', - 'Dog' -]); - -export const zConstValue = z.enum([ - 'ConstValue' -]); - -export const zCompositionWithNestedAnyOfAndNull = z.object({ - propA: z.union([ - z.array(z.unknown()), - z.null() - ]).optional() -}); - -export const zCompositionWithOneOfAndNullable = z.object({ - propA: z.union([ - z.object({ - boolean: z.boolean().optional() - }), - zModelWithEnum, - zModelWithArray, - zModelWithDictionary, - z.null() - ]).optional() -}); - -export const zCompositionWithOneOfAndSimpleDictionary = z.object({ - propA: z.union([ - z.boolean(), - z.object({}) - ]).optional() -}); - -export const zCompositionWithOneOfAndSimpleArrayDictionary = z.object({ - propA: z.union([ - z.boolean(), - z.object({}) - ]).optional() -}); - -export const zCompositionWithOneOfAndComplexArrayDictionary = z.object({ - propA: z.union([ - z.boolean(), - z.object({}) - ]).optional() -}); - -export const zCompositionWithAllOfAndNullable = z.object({ - propA: z.union([ - z.object({ - boolean: z.boolean().optional() - }).merge(zModelWithEnum).merge(zModelWithArray).merge(zModelWithDictionary), - z.null() - ]).optional() -}); - -export const zCompositionWithAnyOfAndNullable = z.object({ - propA: z.union([ - z.object({ - boolean: z.boolean().optional() - }), - zModelWithEnum, - zModelWithArray, - zModelWithDictionary, - z.null() - ]).optional() -}); - -export const zCompositionBaseModel = z.object({ - firstName: z.string().optional(), - lastname: z.string().optional() -}); - -export const zCompositionExtendedModel = zCompositionBaseModel.merge(z.object({ - age: z.number(), - firstName: z.string(), - lastname: z.string() -})); - -export const zModelWithNestedProperties = z.object({ - first: z.union([ - z.object({ - second: z.union([ - z.object({ - third: z.union([ - z.string().readonly(), - z.null() - ]).readonly() - }).readonly(), - z.null() - ]).readonly() - }).readonly(), - z.null() - ]).readonly() -}); - -export const zModelWithDuplicateProperties = z.object({ - prop: zModelWithString.optional() -}); - -export const zModelWithOrderedProperties = z.object({ - zebra: z.string().optional(), - apple: z.string().optional(), - hawaii: z.string().optional() -}); - -export const zModelWithDuplicateImports = z.object({ - propA: zModelWithString.optional(), - propB: zModelWithString.optional(), - propC: zModelWithString.optional() -}); - -export const zModelThatExtends = zModelWithString.merge(z.object({ - propExtendsA: z.string().optional(), - propExtendsB: zModelWithString.optional() -})); - -export const zModelThatExtendsExtends = zModelWithString.merge(zModelThatExtends).merge(z.object({ - propExtendsC: z.string().optional(), - propExtendsD: zModelWithString.optional() -})); - -export const zModelWithPattern = z.object({ - key: z.string().max(64).regex(/^[a-zA-Z0-9_]*$/), - name: z.string().max(255), - enabled: z.boolean().readonly().optional(), - modified: z.string().datetime().readonly().optional(), - id: z.string().regex(/^\d{2}-\d{3}-\d{4}$/).optional(), - text: z.string().regex(/^\w+$/).optional(), - patternWithSingleQuotes: z.string().regex(/^[a-zA-Z0-9']*$/).optional(), - patternWithNewline: z.string().regex(/aaa\nbbb/).optional(), - patternWithBacktick: z.string().regex(/aaa`bbb/).optional() -}); - -export const zFile = z.object({ - id: z.string().min(1).readonly().optional(), - updated_at: z.string().datetime().readonly().optional(), - created_at: z.string().datetime().readonly().optional(), - mime: z.string().min(1).max(24), - file: z.string().url().readonly().optional() -}); - -export const zDefault = z.object({ - name: z.string().optional() -}); - -export const zPageable = z.object({ - page: z.number().int().gte(0).optional().default(0), - size: z.number().int().gte(1).optional(), - sort: z.array(z.string()).optional() -}); - -export const zFreeFormObjectWithoutAdditionalProperties = z.object({}); - -export const zFreeFormObjectWithAdditionalPropertiesEqTrue = z.object({}); - -export const zFreeFormObjectWithAdditionalPropertiesEqEmptyObject = z.object({}); - -export const zModelWithConst = z.object({ - String: z.enum([ - 'String' - ]).optional(), - number: z.unknown().optional(), - null: z.unknown().optional(), - withType: z.enum([ - 'Some string' - ]).optional() -}); - -export const zModelWithAdditionalPropertiesEqTrue = z.object({ - prop: z.string().optional() -}); - -export const zNestedAnyOfArraysNullable = z.object({ - nullableArray: z.union([ - z.array(z.unknown()), - z.null() - ]).optional() -}); - -export const zSimpleParameter = z.unknown(); - -export const zCompositionWithOneOfAndProperties = z.intersection(z.union([ - z.object({ - foo: zSimpleParameter - }), - z.object({ - bar: zNonAsciiStringæøåÆøÅöôêÊ字符串 - }) -]), z.object({ - baz: z.union([ - z.number().int().gte(0), - z.null() - ]), - qux: z.number().int().gte(0) -})); - -export const zNullableObject = z.union([ - z.object({ - foo: z.string().optional() - }), - z.null() -]).default(null); - -export const zCharactersInDescription = z.string(); - -export const zModelWithNullableObject = z.object({ - data: zNullableObject.optional() -}); - -export const zModelWithOneOfEnum = z.union([ - z.object({ - foo: z.enum([ - 'Bar' - ]) - }), - z.object({ - foo: z.enum([ - 'Baz' - ]) - }), - z.object({ - foo: z.enum([ - 'Qux' - ]) - }), - z.object({ - content: z.string().datetime(), - foo: z.enum([ - 'Quux' - ]) - }), - z.object({ - content: z.unknown(), - foo: z.enum([ - 'Corge' - ]) - }) -]); - -export const zModelWithNestedArrayEnumsDataFoo = z.enum([ - 'foo', - 'bar' -]); - -export const zModelWithNestedArrayEnumsDataBar = z.enum([ - 'baz', - 'qux' -]); - -export const zModelWithNestedArrayEnumsData = z.object({ - foo: z.array(zModelWithNestedArrayEnumsDataFoo).optional(), - bar: z.array(zModelWithNestedArrayEnumsDataBar).optional() -}); - -export const zModelWithNestedArrayEnums = z.object({ - array_strings: z.array(z.string()).optional(), - data: zModelWithNestedArrayEnumsData.optional() -}); - -export const zModelWithNestedCompositionEnums = z.object({ - foo: zModelWithNestedArrayEnumsDataFoo.optional() -}); - -export const zModelWithConstantSizeArray = z.unknown(); - -export const zModelWithAnyOfConstantSizeArray = z.unknown(); - -export const zModelWithPrefixItemsConstantSizeArray = z.array(z.unknown()); - -export const zModelWithAnyOfConstantSizeArrayNullable = z.unknown(); - -export const zModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = z.unknown(); - -export const zModelWithAnyOfConstantSizeArrayAndIntersect = z.unknown(); - -export const zModelWithNumericEnumUnion = z.object({ - value: z.unknown().optional() -}); - -export const zModelWithBackticksInDescription = z.object({ - template: z.string().optional() -}); - -export const zModelWithOneOfAndProperties = z.intersection(z.union([ - zSimpleParameter, - zNonAsciiStringæøåÆøÅöôêÊ字符串 -]), z.object({ - baz: z.union([ - z.number().int().gte(0), - z.null() - ]), - qux: z.number().int().gte(0) -})); - -export const zParameterSimpleParameterUnused = z.string(); - -export const zPostServiceWithEmptyTagResponse = z.string(); - -export const zPostServiceWithEmptyTagResponse2 = z.string(); - -export const zDeleteFooData = z.string(); - -export const zDeleteFooData2 = z.string(); - -export const zImport = z.string(); - -export const zSchemaWithFormRestrictedKeys = z.object({ - description: z.string().optional(), - 'x-enum-descriptions': z.string().optional(), - 'x-enum-varnames': z.string().optional(), - 'x-enumNames': z.string().optional(), - title: z.string().optional(), - object: z.object({ - description: z.string().optional(), - 'x-enum-descriptions': z.string().optional(), - 'x-enum-varnames': z.string().optional(), - 'x-enumNames': z.string().optional(), - title: z.string().optional() - }).optional(), - array: z.array(z.object({ - description: z.string().optional(), - 'x-enum-descriptions': z.string().optional(), - 'x-enum-varnames': z.string().optional(), - 'x-enumNames': z.string().optional(), - title: z.string().optional() - })).optional() -}); - -export const zIoK8sApimachineryPkgApisMetaV1Preconditions = z.object({ - resourceVersion: z.string().optional(), - uid: z.string().optional() -}); - -export const zIoK8sApimachineryPkgApisMetaV1DeleteOptions = z.object({ - preconditions: zIoK8sApimachineryPkgApisMetaV1Preconditions.optional() -}); - -export const zAdditionalPropertiesUnknownIssue = z.object({}); - -export const zAdditionalPropertiesUnknownIssue2 = z.object({}); - -export const zAdditionalPropertiesUnknownIssue3 = z.intersection(z.string(), z.object({ - entries: z.object({}) -})); - -export const zAdditionalPropertiesIntegerIssue = z.object({ - value: z.number().int() -}); - -export const zGenericSchemaDuplicateIssue1SystemBoolean = z.object({ - item: z.boolean().optional(), - error: z.union([ - z.string(), - z.null() - ]).optional(), - hasError: z.boolean().readonly().optional(), - data: z.object({}).optional() -}); - -export const zGenericSchemaDuplicateIssue1SystemString = z.object({ - item: z.union([ - z.string(), - z.null() - ]).optional(), - error: z.union([ - z.string(), - z.null() - ]).optional(), - hasError: z.boolean().readonly().optional() -}); - -export const zOneOfAllOfIssue = z.union([ - z.intersection(z.union([ - zConstValue, - zGenericSchemaDuplicateIssue1SystemBoolean - ]), z3eNum1Период), - zGenericSchemaDuplicateIssue1SystemString -]); - -export const zImportResponse = z.union([ - zModelFromZendesk, - zModelWithReadOnlyAndWriteOnly -]); - -export const zApiVVersionODataControllerCountResponse = zModelFromZendesk; - -export const zGetApiVbyApiVersionSimpleOperationResponse = z.number(); - -export const zPostCallWithOptionalParamResponse = z.union([ - z.number(), - z.void() -]); - -export const zCallWithNoContentResponseResponse = z.void(); - -export const zCallWithResponseAndNoContentResponseResponse = z.union([ - z.number(), - z.void() -]); - -export const zDummyAResponse = z400; - -export const zDummyBResponse = z.void(); - -export const zCallWithResponseResponse = zImport; - -export const zCallWithDuplicateResponsesResponse = z.union([ - zModelWithBoolean.merge(zModelWithInteger), - zModelWithString -]); - -export const zCallWithResponsesResponse = z.union([ - z.object({ - '@namespace.string': z.string().readonly().optional(), - '@namespace.integer': z.number().int().readonly().optional(), - value: z.array(zModelWithString).readonly().optional() - }), - zModelThatExtends, - zModelThatExtendsExtends -]); - -export const zTypesResponse = z.union([ - z.number(), - z.string(), - z.boolean(), - z.object({}) -]); - -export const zUploadFileResponse = z.boolean(); - -export const zFileResponseResponse = z.string(); - -export const zComplexTypesResponse = z.array(zModelWithString); - -export const zMultipartResponseResponse = z.object({ - file: z.string().optional(), - metadata: z.object({ - foo: z.string().optional(), - bar: z.string().optional() - }).optional() -}); - -export const zComplexParamsResponse = zModelWithString; - -export const zNonAsciiæøåÆøÅöôêÊ字符串Response = z.array(zNonAsciiStringæøåÆøÅöôêÊ字符串); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/types.gen.ts deleted file mode 100644 index 4858fe0d7..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/read-write-only/types.gen.ts +++ /dev/null @@ -1,87 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type FooReadWriteReadable = BarReadReadable; - -export type FooReadWriteWritable = BarReadWritable & { - foo?: string; -}; - -export type FooReadReadable = BarReadReadable & { - readonly foo?: string; -}; - -export type FooReadWritable = BarReadWritable; - -export type FooWriteReadable = BarWriteReadable; - -export type FooWriteWritable = BarWriteWritable & { - foo?: string; -}; - -export type BarReadReadable = Baz | { - readonly bar?: string; -}; - -export type BarReadWritable = Baz; - -export type BarWriteReadable = Baz; - -export type BarWriteWritable = Baz | { - bar?: string; -}; - -export type Baz = { - baz?: string; -}; - -export type PostFooReadWriteData = { - body: FooReadWriteWritable; - path?: never; - query?: never; - url: '/foo-read-write'; -}; - -export type PostFooReadWriteResponses = { - /** - * OK - */ - 200: FooReadWriteReadable; -}; - -export type PostFooReadWriteResponse = PostFooReadWriteResponses[keyof PostFooReadWriteResponses]; - -export type PostFooReadData = { - body: FooReadWritable; - path?: never; - query?: never; - url: '/foo-read'; -}; - -export type PostFooReadResponses = { - /** - * OK - */ - 200: FooReadReadable; -}; - -export type PostFooReadResponse = PostFooReadResponses[keyof PostFooReadResponses]; - -export type PostFooWriteData = { - body: FooWriteWritable; - path?: never; - query?: never; - url: '/foo-write'; -}; - -export type PostFooWriteResponses = { - /** - * OK - */ - 200: FooWriteReadable; -}; - -export type PostFooWriteResponse = PostFooWriteResponses[keyof PostFooWriteResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/sdk.gen.ts deleted file mode 100644 index 033f5c32d..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/sdk.gen.ts +++ /dev/null @@ -1,47 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { GetFooData, GetBarData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const getFoo = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - security: [ - { - in: 'query', - name: 'foo', - type: 'apiKey' - } - ], - url: '/foo', - ...options - }); -}; - -export const getBar = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - security: [ - { - in: 'cookie', - name: 'bar', - type: 'apiKey' - } - ], - url: '/bar', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/types.gen.ts deleted file mode 100644 index a641918b4..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/security-api-key/types.gen.ts +++ /dev/null @@ -1,33 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type GetBarData = { - body?: never; - path?: never; - query?: never; - url: '/bar'; -}; - -export type GetBarResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-false/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-false/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/security-false/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-false/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-false/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/security-false/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-false/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-false/sdk.gen.ts deleted file mode 100644 index 14ebd7036..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/security-false/sdk.gen.ts +++ /dev/null @@ -1,26 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { GetFooData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const getFoo = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/foo', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-false/types.gen.ts deleted file mode 100644 index 884795c3f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/security-false/types.gen.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/sdk.gen.ts deleted file mode 100644 index bcb05a226..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/sdk.gen.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { GetFooData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const getFoo = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - security: [ - { - scheme: 'bearer', - type: 'http' - } - ], - url: '/foo', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/types.gen.ts deleted file mode 100644 index 884795c3f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/security-http-bearer/types.gen.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/sdk.gen.ts deleted file mode 100644 index bcb05a226..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/sdk.gen.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { GetFooData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const getFoo = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - security: [ - { - scheme: 'bearer', - type: 'http' - } - ], - url: '/foo', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/types.gen.ts deleted file mode 100644 index 884795c3f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/security-oauth2/types.gen.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/sdk.gen.ts deleted file mode 100644 index bcb05a226..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/sdk.gen.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { GetFooData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const getFoo = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - security: [ - { - scheme: 'bearer', - type: 'http' - } - ], - url: '/foo', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/types.gen.ts deleted file mode 100644 index 884795c3f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/security-open-id-connect/types.gen.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/servers/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/servers/client.gen.ts deleted file mode 100644 index 89e76c00f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/servers/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'https://foo.com/v1' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/servers/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/servers/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/servers/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/servers/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/servers/types.gen.ts deleted file mode 100644 index fa745dd45..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/servers/types.gen.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: string; -}; - -export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; - -export type ClientOptions = { - baseUrl: 'https://foo.com/v1' | `${string}://${string}/v1` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/transformers.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/transformers.gen.ts deleted file mode 100644 index 0b520225d..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/transformers.gen.ts +++ /dev/null @@ -1,35 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { GetFooResponse } from './types.gen'; - -const quxSchemaResponseTransformer = (data: any) => { - if (data.baz) { - data.baz = new Date(data.baz); - } - return data; -}; - -const bazSchemaResponseTransformer = (data: any) => { - data = quxSchemaResponseTransformer(data); - data.bar = new Date(data.bar); - return data; -}; - -const barSchemaResponseTransformer = (data: any) => { - data.foo = data.foo.map((item: any) => { - return bazSchemaResponseTransformer(item); - }); - return data; -}; - -const fooSchemaResponseTransformer = (data: any) => { - data.foo = data.foo.map((item: any) => { - return barSchemaResponseTransformer(item); - }); - return data; -}; - -export const getFooResponseTransformer = async (data: any): Promise => { - data = fooSchemaResponseTransformer(data); - return data; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/types.gen.ts deleted file mode 100644 index 25ae9771c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-all-of/types.gen.ts +++ /dev/null @@ -1,46 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - foo: Array; -}; - -export type Bar = { - foo: Array; - bar: 'foo' | 'bar' | 'baz'; -}; - -export type Baz = Qux & { - id: 'Baz'; -} & { - foo: number; - bar: Date; - baz: 'foo' | 'bar' | 'baz'; - qux: number; -}; - -export type Qux = { - foo: number; - bar: number; - baz?: Date; - id: string; -}; - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: Foo; -}; - -export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/transformers.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/transformers.gen.ts deleted file mode 100644 index 0f3a28be1..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/transformers.gen.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { GetFooResponse } from './types.gen'; - -const fooSchemaResponseTransformer = (data: any) => { - if (data.foo) { - data.foo = new Date(data.foo); - } - if (data.bar) { - data.bar = new Date(data.bar); - } - if (data.requiredBaz) { - data.requiredBaz = new Date(data.requiredBaz); - } - return data; -}; - -export const getFooResponseTransformer = async (data: any): Promise => { - data = data.map((item: any) => { - return fooSchemaResponseTransformer(item); - }); - return data; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/types.gen.ts deleted file mode 100644 index 86e86d778..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-any-of-null/types.gen.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - foo?: Date; - bar?: Date | null; - requiredBaz: Date | null; -}; - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: Array; -}; - -export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/transformers.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/transformers.gen.ts deleted file mode 100644 index 5ad0b923d..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/transformers.gen.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { GetFooResponse } from './types.gen'; - -export const getFooResponseTransformer = async (data: any): Promise => { - data.foo = data.foo.map((item: any) => { - item.baz = new Date(item.baz); - return item; - }); - return data; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/types.gen.ts deleted file mode 100644 index 6820b0d90..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/transformers-array/types.gen.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: { - foo: Array<{ - baz: Date; - }>; - }; -}; - -export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/type-invalid/index.ts b/packages/openapi-ts-tests/test/generated/3.0.x/type-invalid/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/type-invalid/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/type-invalid/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/type-invalid/types.gen.ts deleted file mode 100644 index 2589e80df..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/type-invalid/types.gen.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = unknown; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.0.x/validators/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.0.x/validators/zod.gen.ts deleted file mode 100644 index 6ac6de592..000000000 --- a/packages/openapi-ts-tests/test/generated/3.0.x/validators/zod.gen.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { z } from 'zod'; - -export const zBar: z.AnyZodObject = z.object({ - foo: z.lazy(() => { - return zFoo; - }).optional() -}); - -export const zFoo: z.ZodTypeAny = z.union([ - z.object({ - foo: z.string().regex(/^\d{3}-\d{2}-\d{4}$/).optional(), - bar: zBar.optional(), - baz: z.array(z.lazy(() => { - return zFoo; - })).optional(), - qux: z.number().optional().default(0) - }), - z.null() -]).default(null); - -export const zBaz = z.string().regex(/foo\nbar/).readonly().default('baz'); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-false/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-false/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-false/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-false/types.gen.ts deleted file mode 100644 index 6b84c8ade..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-false/types.gen.ts +++ /dev/null @@ -1,17 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - foo: string; -}; - -export type Bar = Foo & { - [key: string]: never; -}; - -export type Baz = Foo & { - bar: string; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-true/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-true/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-true/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-true/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-true/types.gen.ts deleted file mode 100644 index 83d16749a..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-true/types.gen.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - foo: string; - [key: string]: unknown | string; -}; - -export type Bar = Foo & { - [key: string]: unknown; -}; - -export type Baz = Foo & { - bar: string; - [key: string]: unknown | string; -}; - -export type Qux = {}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-undefined/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-undefined/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-undefined/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-undefined/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-undefined/types.gen.ts deleted file mode 100644 index cb1ed0592..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/additional-properties-undefined/types.gen.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - foo: { - [key: string]: unknown; - }; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/array-items-one-of-length-1/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/array-items-one-of-length-1/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/array-items-one-of-length-1/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/array-items-one-of-length-1/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/array-items-one-of-length-1/types.gen.ts deleted file mode 100644 index b133cfb1a..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/array-items-one-of-length-1/types.gen.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - foo?: Array; -}; - -export type Bar = string; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/sdk.gen.ts deleted file mode 100644 index d305a220c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/sdk.gen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { PostFooData, PostFooResponse } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const postFoo = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - bodySerializer: null, - url: '/foo', - ...options, - headers: { - 'Content-Type': 'text/plain', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/types.gen.ts deleted file mode 100644 index ff0becc55..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/body-response-text-plain/types.gen.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type PostFooData = { - body: string; - path?: never; - query?: never; - url: '/foo'; -}; - -export type PostFooResponses = { - /** - * OK - */ - 200: string; -}; - -export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/case-PascalCase/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/case-PascalCase/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/case-PascalCase/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/case-PascalCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/case-PascalCase/types.gen.ts deleted file mode 100644 index 45f3cd481..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/case-PascalCase/types.gen.ts +++ /dev/null @@ -1,89 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * original name: 201 - */ -export type _201 = number; - -/** - * original name: Foo - */ -export type Foo = { - /** - * original name: fooBar - */ - fooBar: FooBar; - /** - * original name: BarBaz - */ - BarBaz: Foo; - /** - * original name: qux_quux - */ - qux_quux: { - /** - * original name: fooBar - */ - fooBar: FooBar2; - /** - * original name: BarBaz - */ - BarBaz: FooBar3; - /** - * original name: qux_quux - */ - qux_quux: boolean; - }; -}; - -/** - * original name: foo_bar - */ -export type FooBar = boolean; - -/** - * original name: fooBar - */ -export type FooBar2 = number; - -/** - * original name: FooBar - */ -export type FooBar3 = string; - -export type GetFooData = { - body: Foo; - path?: never; - query: { - /** - * original name: fooBar - */ - fooBar: string; - /** - * original name: BarBaz - */ - BarBaz: string; - /** - * original name: qux_quux - */ - qux_quux: string; - }; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: Foo; - /** - * OK - */ - 201: _201; -}; - -export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/case-camelCase/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/case-camelCase/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/case-camelCase/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/case-camelCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/case-camelCase/types.gen.ts deleted file mode 100644 index 2b4016129..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/case-camelCase/types.gen.ts +++ /dev/null @@ -1,89 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * original name: 201 - */ -export type _201 = number; - -/** - * original name: Foo - */ -export type foo = { - /** - * original name: fooBar - */ - fooBar: fooBar; - /** - * original name: BarBaz - */ - BarBaz: foo; - /** - * original name: qux_quux - */ - qux_quux: { - /** - * original name: fooBar - */ - fooBar: fooBar2; - /** - * original name: BarBaz - */ - BarBaz: fooBar3; - /** - * original name: qux_quux - */ - qux_quux: boolean; - }; -}; - -/** - * original name: foo_bar - */ -export type fooBar = boolean; - -/** - * original name: fooBar - */ -export type fooBar2 = number; - -/** - * original name: FooBar - */ -export type fooBar3 = string; - -export type getFooData = { - body: foo; - path?: never; - query: { - /** - * original name: fooBar - */ - fooBar: string; - /** - * original name: BarBaz - */ - BarBaz: string; - /** - * original name: qux_quux - */ - qux_quux: string; - }; - url: '/foo'; -}; - -export type getFooResponses = { - /** - * OK - */ - 200: foo; - /** - * OK - */ - 201: _201; -}; - -export type getFooResponse = getFooResponses[keyof getFooResponses]; - -export type clientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/case-snake_case/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/case-snake_case/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/case-snake_case/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/case-snake_case/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/case-snake_case/types.gen.ts deleted file mode 100644 index 0e7c47f83..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/case-snake_case/types.gen.ts +++ /dev/null @@ -1,89 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * original name: 201 - */ -export type _201 = number; - -/** - * original name: Foo - */ -export type foo = { - /** - * original name: fooBar - */ - fooBar: foo_bar; - /** - * original name: BarBaz - */ - BarBaz: foo; - /** - * original name: qux_quux - */ - qux_quux: { - /** - * original name: fooBar - */ - fooBar: foo_bar2; - /** - * original name: BarBaz - */ - BarBaz: foo_bar3; - /** - * original name: qux_quux - */ - qux_quux: boolean; - }; -}; - -/** - * original name: foo_bar - */ -export type foo_bar = boolean; - -/** - * original name: fooBar - */ -export type foo_bar2 = number; - -/** - * original name: FooBar - */ -export type foo_bar3 = string; - -export type get_foo_data = { - body: foo; - path?: never; - query: { - /** - * original name: fooBar - */ - fooBar: string; - /** - * original name: BarBaz - */ - BarBaz: string; - /** - * original name: qux_quux - */ - qux_quux: string; - }; - url: '/foo'; -}; - -export type get_foo_responses = { - /** - * OK - */ - 200: foo; - /** - * OK - */ - 201: _201; -}; - -export type get_foo_response = get_foo_responses[keyof get_foo_responses]; - -export type client_options = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/case/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/case/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/case/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/case/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/case/types.gen.ts deleted file mode 100644 index 0118c79fe..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/case/types.gen.ts +++ /dev/null @@ -1,89 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * original name: 201 - */ -export type _201 = number; - -/** - * original name: Foo - */ -export type Foo = { - /** - * original name: fooBar - */ - fooBar: foo_bar; - /** - * original name: BarBaz - */ - BarBaz: Foo; - /** - * original name: qux_quux - */ - qux_quux: { - /** - * original name: fooBar - */ - fooBar: fooBar; - /** - * original name: BarBaz - */ - BarBaz: FooBar; - /** - * original name: qux_quux - */ - qux_quux: boolean; - }; -}; - -/** - * original name: foo_bar - */ -export type foo_bar = boolean; - -/** - * original name: fooBar - */ -export type fooBar = number; - -/** - * original name: FooBar - */ -export type FooBar = string; - -export type GetFoo_Data = { - body: Foo; - path?: never; - query: { - /** - * original name: fooBar - */ - fooBar: string; - /** - * original name: BarBaz - */ - BarBaz: string; - /** - * original name: qux_quux - */ - qux_quux: string; - }; - url: '/foo'; -}; - -export type GetFoo_Responses = { - /** - * OK - */ - 200: Foo; - /** - * OK - */ - 201: _201; -}; - -export type GetFoo_Response = GetFoo_Responses[keyof GetFoo_Responses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/client.gen.ts deleted file mode 100644 index c4dedd629..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/types.gen.ts deleted file mode 100644 index 9cb3fcf99..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-false/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/client.gen.ts deleted file mode 100644 index 1d97df8bc..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/types.gen.ts deleted file mode 100644 index 9cb3fcf99..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-number/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/client.gen.ts deleted file mode 100644 index 1d97df8bc..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/types.gen.ts deleted file mode 100644 index a0d27c8ae..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-strict/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base'; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/client.gen.ts deleted file mode 100644 index 7b197288a..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'https://foo.com' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/types.gen.ts deleted file mode 100644 index 9cb3fcf99..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/base-url-string/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client.gen.ts deleted file mode 100644 index 64c0080e8..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.cjs b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.cjs deleted file mode 100644 index ef952517e..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use strict';var B=require('axios');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var B__default=/*#__PURE__*/_interopDefault(B);var w=async(t,e)=>{let r=typeof e=="function"?await e(t):e;if(r)return t.scheme==="bearer"?`Bearer ${r}`:t.scheme==="basic"?`Basic ${btoa(r)}`:r},z=(t,e,r)=>{typeof r=="string"||r instanceof Blob?t.append(e,r):t.append(e,JSON.stringify(r));},O=(t,e,r)=>{typeof r=="string"?t.append(e,r):t.append(e,JSON.stringify(r));},j={bodySerializer:t=>{let e=new FormData;return Object.entries(t).forEach(([r,i])=>{i!=null&&(Array.isArray(i)?i.forEach(a=>z(e,r,a)):z(e,r,i));}),e}},k={bodySerializer:t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString():r)},$={bodySerializer:t=>{let e=new URLSearchParams;return Object.entries(t).forEach(([r,i])=>{i!=null&&(Array.isArray(i)?i.forEach(a=>O(e,r,a)):O(e,r,i));}),e.toString()}},q=t=>{switch(t){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},v=t=>{switch(t){case "form":return ",";case "pipeDelimited":return "|";case "spaceDelimited":return "%20";default:return ","}},P=t=>{switch(t){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},h=({allowReserved:t,explode:e,name:r,style:i,value:a})=>{if(!e){let n=(t?a:a.map(s=>encodeURIComponent(s))).join(v(i));switch(i){case "label":return `.${n}`;case "matrix":return `;${r}=${n}`;case "simple":return n;default:return `${r}=${n}`}}let o=q(i),l=a.map(n=>i==="label"||i==="simple"?t?n:encodeURIComponent(n):f({allowReserved:t,name:r,value:n})).join(o);return i==="label"||i==="matrix"?o+l:l},f=({allowReserved:t,name:e,value:r})=>{if(r==null)return "";if(typeof r=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return `${e}=${t?r:encodeURIComponent(r)}`},g=({allowReserved:t,explode:e,name:r,style:i,value:a})=>{if(a instanceof Date)return `${r}=${a.toISOString()}`;if(i!=="deepObject"&&!e){let n=[];Object.entries(a).forEach(([u,d])=>{n=[...n,u,t?d:encodeURIComponent(d)];});let s=n.join(",");switch(i){case "form":return `${r}=${s}`;case "label":return `.${s}`;case "matrix":return `;${r}=${s}`;default:return s}}let o=P(i),l=Object.entries(a).map(([n,s])=>f({allowReserved:t,name:i==="deepObject"?`${r}[${n}]`:n,value:s})).join(o);return i==="label"||i==="matrix"?o+l:l};var T=/\{[^{}]+\}/g,E=({path:t,url:e})=>{let r=e,i=e.match(T);if(i)for(let a of i){let o=false,l=a.substring(1,a.length-1),n="simple";l.endsWith("*")&&(o=true,l=l.substring(0,l.length-1)),l.startsWith(".")?(l=l.substring(1),n="label"):l.startsWith(";")&&(l=l.substring(1),n="matrix");let s=t[l];if(s==null)continue;if(Array.isArray(s)){r=r.replace(a,h({explode:o,name:l,style:n,value:s}));continue}if(typeof s=="object"){r=r.replace(a,g({explode:o,name:l,style:n,value:s}));continue}if(n==="matrix"){r=r.replace(a,`;${f({name:l,value:s})}`);continue}let u=encodeURIComponent(n==="label"?`.${s}`:s);r=r.replace(a,u);}return r},U=({allowReserved:t,array:e,object:r}={})=>a=>{let o=[];if(a&&typeof a=="object")for(let l in a){let n=a[l];if(n!=null){if(Array.isArray(n)){o=[...o,h({allowReserved:t,explode:true,name:l,style:"form",value:n,...e})];continue}if(typeof n=="object"){o=[...o,g({allowReserved:t,explode:true,name:l,style:"deepObject",value:n,...r})];continue}o=[...o,f({allowReserved:t,name:l,value:n})];}}return o.join("&")},A=async({security:t,...e})=>{for(let r of t){let i=await w(r,e.auth);if(!i)continue;let a=r.name??"Authorization";switch(r.in){case "query":e.query||(e.query={}),e.query[a]=i;break;case "cookie":{let o=`${a}=${i}`;"Cookie"in e.headers&&e.headers.Cookie?e.headers.Cookie=`${e.headers.Cookie}; ${o}`:e.headers.Cookie=o;break}case "header":default:e.headers[a]=i;break}return}},b=t=>D({path:t.path,query:t.paramsSerializer?void 0:t.query,querySerializer:typeof t.querySerializer=="function"?t.querySerializer:U(t.querySerializer),url:t.url}),D=({path:t,query:e,querySerializer:r,url:i})=>{let o=i.startsWith("/")?i:`/${i}`;t&&(o=E({path:t,url:o}));let l=e?r(e):"";return l.startsWith("?")&&(l=l.substring(1)),l&&(o+=`?${l}`),o},C=(t,e)=>{let r={...t,...e};return r.headers=y(t.headers,e.headers),r},H=["common","delete","get","head","patch","post","put"],y=(...t)=>{let e={};for(let r of t){if(!r||typeof r!="object")continue;let i=Object.entries(r);for(let[a,o]of i)if(H.includes(a)&&typeof o=="object")e[a]={...e[a],...o};else if(o===null)delete e[a];else if(Array.isArray(o))for(let l of o)e[a]=[...e[a]??[],l];else o!==void 0&&(e[a]=typeof o=="object"?JSON.stringify(o):o);}return e},S=(t={})=>({...t});var I=(t={})=>{let e=C(S(),t),{auth:r,...i}=e,a=B__default.default.create(i),o=()=>({...e}),l=s=>(e=C(e,s),a.defaults={...a.defaults,...e,headers:y(a.defaults.headers,e.headers)},o()),n=async s=>{let u={...e,...s,axios:s.axios??e.axios??a,headers:y(e.headers,s.headers)};u.security&&await A({...u,security:u.security}),u.body&&u.bodySerializer&&(u.body=u.bodySerializer(u.body));let d=b(u);try{let m=u.axios,{auth:c,...R}=u,x=await m({...R,baseURL:u.baseURL,data:u.body,headers:u.headers,params:u.paramsSerializer?u.query:void 0,url:d}),{data:p}=x;return u.responseType==="json"&&(u.responseValidator&&await u.responseValidator(p),u.responseTransformer&&(p=await u.responseTransformer(p))),{...x,data:p??{}}}catch(m){let c=m;if(u.throwOnError)throw c;return c.error=c.response?.data??{},c}};return {buildUrl:b,delete:s=>n({...s,method:"DELETE"}),get:s=>n({...s,method:"GET"}),getConfig:o,head:s=>n({...s,method:"HEAD"}),instance:a,options:s=>n({...s,method:"OPTIONS"}),patch:s=>n({...s,method:"PATCH"}),post:s=>n({...s,method:"POST"}),put:s=>n({...s,method:"PUT"}),request:n,setConfig:l}};exports.createClient=I;exports.createConfig=S;exports.formDataBodySerializer=j;exports.jsonBodySerializer=k;exports.urlSearchParamsBodySerializer=$;//# sourceMappingURL=index.cjs.map -//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.d.cts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.d.cts deleted file mode 100644 index 99cecdf99..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.d.cts +++ /dev/null @@ -1,207 +0,0 @@ -import { CreateAxiosDefaults, AxiosStatic, AxiosResponse, AxiosError, AxiosInstance } from 'axios'; - -type AuthToken = string | undefined; -interface Auth { - /** - * Which part of the request do we use to send the auth? - * - * @default 'header' - */ - in?: 'header' | 'query' | 'cookie'; - /** - * Header or query parameter name. - * - * @default 'Authorization' - */ - name?: string; - scheme?: 'basic' | 'bearer'; - type: 'apiKey' | 'http'; -} -interface SerializerOptions { - /** - * @default true - */ - explode: boolean; - style: T; -} -type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; -type ObjectStyle = 'form' | 'deepObject'; - -type QuerySerializer = (query: Record) => string; -type BodySerializer = (body: any) => any; -interface QuerySerializerOptions { - allowReserved?: boolean; - array?: SerializerOptions; - object?: SerializerOptions; -} -declare const formDataBodySerializer: { - bodySerializer: | Array>>(body: T) => FormData; -}; -declare const jsonBodySerializer: { - bodySerializer: (body: T) => string; -}; -declare const urlSearchParamsBodySerializer: { - bodySerializer: | Array>>(body: T) => string; -}; - -interface Client$1 { - /** - * Returns the final request URL. - */ - buildUrl: BuildUrlFn; - connect: MethodFn; - delete: MethodFn; - get: MethodFn; - getConfig: () => Config; - head: MethodFn; - options: MethodFn; - patch: MethodFn; - post: MethodFn; - put: MethodFn; - request: RequestFn; - setConfig: (config: Config) => Config; - trace: MethodFn; -} -interface Config$1 { - /** - * Auth token or a function returning auth token. The resolved value will be - * added to the request payload as defined by its `security` array. - */ - auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; - /** - * A function for serializing request body parameter. By default, - * {@link JSON.stringify()} will be used. - */ - bodySerializer?: BodySerializer | null; - /** - * An object containing any HTTP headers that you want to pre-populate your - * `Headers` object with. - * - * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} - */ - headers?: RequestInit['headers'] | Record; - /** - * The request method. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} - */ - method?: 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE'; - /** - * A function for serializing request query parameters. By default, arrays - * will be exploded in form style, objects will be exploded in deepObject - * style, and reserved characters are percent-encoded. - * - * This method will have no effect if the native `paramsSerializer()` Axios - * API function is used. - * - * {@link https://swagger.io/docs/specification/serialization/#query View examples} - */ - querySerializer?: QuerySerializer | QuerySerializerOptions; - /** - * A function transforming response data before it's returned. This is useful - * for post-processing data, e.g. converting ISO strings into Date objects. - */ - responseTransformer?: (data: unknown) => Promise; - /** - * A function validating response data. This is useful if you want to ensure - * the response conforms to the desired shape, so it can be safely passed to - * the transformers and returned to the user. - */ - responseValidator?: (data: unknown) => Promise; -} - -interface Config extends Omit, Config$1 { - /** - * Axios implementation. You can use this option to provide a custom - * Axios instance. - * - * @default axios - */ - axios?: AxiosStatic; - /** - * Base URL for all requests made by this client. - */ - baseURL?: T['baseURL']; - /** - * An object containing any HTTP headers that you want to pre-populate your - * `Headers` object with. - * - * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} - */ - headers?: CreateAxiosDefaults['headers'] | Record; - /** - * Throw an error instead of returning it in the response? - * - * @default false - */ - throwOnError?: T['throwOnError']; -} -interface RequestOptions extends Config<{ - throwOnError: ThrowOnError; -}> { - /** - * Any body that you want to add to your request. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} - */ - body?: unknown; - path?: Record; - query?: Record; - /** - * Security mechanism(s) to use for the request. - */ - security?: ReadonlyArray; - url: Url; -} -type RequestResult = ThrowOnError extends true ? Promise> : Promise<(AxiosResponse & { - error: undefined; -}) | (AxiosError & { - data: undefined; - error: TError; -})>; -interface ClientOptions { - baseURL?: string; - throwOnError?: boolean; -} -type MethodFn = (options: Omit, 'method'>) => RequestResult; -type RequestFn = (options: Omit, 'method'> & Pick>, 'method'>) => RequestResult; -type BuildUrlFn = ; - query?: Record; - url: string; -}>(options: Pick & Omit, 'axios'>) => string; -type Client = Client$1 & { - instance: AxiosInstance; -}; -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -type CreateClientConfig = (override?: Config) => Config & T>; -interface TDataShape { - body?: unknown; - headers?: unknown; - path?: unknown; - query?: unknown; - url: string; -} -type OmitKeys = Pick>; -type Options = OmitKeys, 'body' | 'path' | 'query' | 'url'> & Omit; -type OptionsLegacyParser = TData extends { - body?: any; -} ? TData extends { - headers?: any; -} ? OmitKeys, 'body' | 'headers' | 'url'> & TData : OmitKeys, 'body' | 'url'> & TData & Pick, 'headers'> : TData extends { - headers?: any; -} ? OmitKeys, 'headers' | 'url'> & TData & Pick, 'body'> : OmitKeys, 'url'> & TData; - -declare const createClient: (config?: Config) => Client; - -declare const createConfig: (override?: Config & T>) => Config & T>; - -export { type Auth, type Client, type ClientOptions, type Config, type CreateClientConfig, type Options, type OptionsLegacyParser, type QuerySerializerOptions, type RequestOptions, type RequestResult, type TDataShape, createClient, createConfig, formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer }; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.d.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.d.ts deleted file mode 100644 index 99cecdf99..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/client/index.d.ts +++ /dev/null @@ -1,207 +0,0 @@ -import { CreateAxiosDefaults, AxiosStatic, AxiosResponse, AxiosError, AxiosInstance } from 'axios'; - -type AuthToken = string | undefined; -interface Auth { - /** - * Which part of the request do we use to send the auth? - * - * @default 'header' - */ - in?: 'header' | 'query' | 'cookie'; - /** - * Header or query parameter name. - * - * @default 'Authorization' - */ - name?: string; - scheme?: 'basic' | 'bearer'; - type: 'apiKey' | 'http'; -} -interface SerializerOptions { - /** - * @default true - */ - explode: boolean; - style: T; -} -type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; -type ObjectStyle = 'form' | 'deepObject'; - -type QuerySerializer = (query: Record) => string; -type BodySerializer = (body: any) => any; -interface QuerySerializerOptions { - allowReserved?: boolean; - array?: SerializerOptions; - object?: SerializerOptions; -} -declare const formDataBodySerializer: { - bodySerializer: | Array>>(body: T) => FormData; -}; -declare const jsonBodySerializer: { - bodySerializer: (body: T) => string; -}; -declare const urlSearchParamsBodySerializer: { - bodySerializer: | Array>>(body: T) => string; -}; - -interface Client$1 { - /** - * Returns the final request URL. - */ - buildUrl: BuildUrlFn; - connect: MethodFn; - delete: MethodFn; - get: MethodFn; - getConfig: () => Config; - head: MethodFn; - options: MethodFn; - patch: MethodFn; - post: MethodFn; - put: MethodFn; - request: RequestFn; - setConfig: (config: Config) => Config; - trace: MethodFn; -} -interface Config$1 { - /** - * Auth token or a function returning auth token. The resolved value will be - * added to the request payload as defined by its `security` array. - */ - auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; - /** - * A function for serializing request body parameter. By default, - * {@link JSON.stringify()} will be used. - */ - bodySerializer?: BodySerializer | null; - /** - * An object containing any HTTP headers that you want to pre-populate your - * `Headers` object with. - * - * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} - */ - headers?: RequestInit['headers'] | Record; - /** - * The request method. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} - */ - method?: 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE'; - /** - * A function for serializing request query parameters. By default, arrays - * will be exploded in form style, objects will be exploded in deepObject - * style, and reserved characters are percent-encoded. - * - * This method will have no effect if the native `paramsSerializer()` Axios - * API function is used. - * - * {@link https://swagger.io/docs/specification/serialization/#query View examples} - */ - querySerializer?: QuerySerializer | QuerySerializerOptions; - /** - * A function transforming response data before it's returned. This is useful - * for post-processing data, e.g. converting ISO strings into Date objects. - */ - responseTransformer?: (data: unknown) => Promise; - /** - * A function validating response data. This is useful if you want to ensure - * the response conforms to the desired shape, so it can be safely passed to - * the transformers and returned to the user. - */ - responseValidator?: (data: unknown) => Promise; -} - -interface Config extends Omit, Config$1 { - /** - * Axios implementation. You can use this option to provide a custom - * Axios instance. - * - * @default axios - */ - axios?: AxiosStatic; - /** - * Base URL for all requests made by this client. - */ - baseURL?: T['baseURL']; - /** - * An object containing any HTTP headers that you want to pre-populate your - * `Headers` object with. - * - * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} - */ - headers?: CreateAxiosDefaults['headers'] | Record; - /** - * Throw an error instead of returning it in the response? - * - * @default false - */ - throwOnError?: T['throwOnError']; -} -interface RequestOptions extends Config<{ - throwOnError: ThrowOnError; -}> { - /** - * Any body that you want to add to your request. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} - */ - body?: unknown; - path?: Record; - query?: Record; - /** - * Security mechanism(s) to use for the request. - */ - security?: ReadonlyArray; - url: Url; -} -type RequestResult = ThrowOnError extends true ? Promise> : Promise<(AxiosResponse & { - error: undefined; -}) | (AxiosError & { - data: undefined; - error: TError; -})>; -interface ClientOptions { - baseURL?: string; - throwOnError?: boolean; -} -type MethodFn = (options: Omit, 'method'>) => RequestResult; -type RequestFn = (options: Omit, 'method'> & Pick>, 'method'>) => RequestResult; -type BuildUrlFn = ; - query?: Record; - url: string; -}>(options: Pick & Omit, 'axios'>) => string; -type Client = Client$1 & { - instance: AxiosInstance; -}; -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -type CreateClientConfig = (override?: Config) => Config & T>; -interface TDataShape { - body?: unknown; - headers?: unknown; - path?: unknown; - query?: unknown; - url: string; -} -type OmitKeys = Pick>; -type Options = OmitKeys, 'body' | 'path' | 'query' | 'url'> & Omit; -type OptionsLegacyParser = TData extends { - body?: any; -} ? TData extends { - headers?: any; -} ? OmitKeys, 'body' | 'headers' | 'url'> & TData : OmitKeys, 'body' | 'url'> & TData & Pick, 'headers'> : TData extends { - headers?: any; -} ? OmitKeys, 'headers' | 'url'> & TData & Pick, 'body'> : OmitKeys, 'url'> & TData; - -declare const createClient: (config?: Config) => Client; - -declare const createConfig: (override?: Config & T>) => Config & T>; - -export { type Auth, type Client, type ClientOptions, type Config, type CreateClientConfig, type Options, type OptionsLegacyParser, type QuerySerializerOptions, type RequestOptions, type RequestResult, type TDataShape, createClient, createConfig, formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer }; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/sdk.gen.ts deleted file mode 100644 index 063d2d76e..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/sdk.gen.ts +++ /dev/null @@ -1,410 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from './client'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - responseType: 'blob', - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/types.gen.ts deleted file mode 100644 index 9cb3fcf99..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/bundle/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/client.gen.ts deleted file mode 100644 index 1d97df8bc..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/sdk.gen.ts deleted file mode 100644 index 9e76f2fd8..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/sdk.gen.ts +++ /dev/null @@ -1,410 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - responseType: 'blob', - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/types.gen.ts deleted file mode 100644 index 9cb3fcf99..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/default/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/client.gen.ts deleted file mode 100644 index 1d97df8bc..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/sdk.gen.ts deleted file mode 100644 index 9e76f2fd8..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/sdk.gen.ts +++ /dev/null @@ -1,410 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - responseType: 'blob', - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/types.gen.ts deleted file mode 100644 index 9cb3fcf99..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/client.gen.ts deleted file mode 100644 index 1d97df8bc..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/sdk.gen.ts deleted file mode 100644 index 75b5630e6..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options: Options) => { - return options.client.patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options: Options) => { - return options.client.delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options: Options) => { - return options.client.head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options: Options) => { - return options.client.options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options: Options) => { - return options.client.patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return options.client.delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options: Options) => { - return options.client.post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options: Options) => { - return options.client.delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return options.client.post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return options.client.get({ - responseType: 'blob', - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options: Options) => { - return options.client.post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return options.client.put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/types.gen.ts deleted file mode 100644 index 9cb3fcf99..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-axios/sdk-client-required/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-false/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-number/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/types.gen.ts deleted file mode 100644 index c3e87ddf4..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-strict/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base'; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/client.gen.ts deleted file mode 100644 index a324bafac..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'https://foo.com' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/base-url-string/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client.gen.ts deleted file mode 100644 index 14f2d878c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.cjs b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.cjs deleted file mode 100644 index 2886023aa..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use strict';var A=async(t,r)=>{let e=typeof r=="function"?await r(t):r;if(e)return t.scheme==="bearer"?`Bearer ${e}`:t.scheme==="basic"?`Basic ${btoa(e)}`:e},z=(t,r,e)=>{typeof e=="string"||e instanceof Blob?t.append(r,e):t.append(r,JSON.stringify(e));},j=(t,r,e)=>{typeof e=="string"?t.append(r,e):t.append(r,JSON.stringify(e));},v={bodySerializer:t=>{let r=new FormData;return Object.entries(t).forEach(([e,a])=>{a!=null&&(Array.isArray(a)?a.forEach(i=>z(r,e,i)):z(r,e,a));}),r}},R={bodySerializer:t=>JSON.stringify(t,(r,e)=>typeof e=="bigint"?e.toString():e)},$={bodySerializer:t=>{let r=new URLSearchParams;return Object.entries(t).forEach(([e,a])=>{a!=null&&(Array.isArray(a)?a.forEach(i=>j(r,e,i)):j(r,e,a));}),r.toString()}},U=t=>{switch(t){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},_=t=>{switch(t){case "form":return ",";case "pipeDelimited":return "|";case "spaceDelimited":return "%20";default:return ","}},D=t=>{switch(t){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},O=({allowReserved:t,explode:r,name:e,style:a,value:i})=>{if(!r){let s=(t?i:i.map(l=>encodeURIComponent(l))).join(_(a));switch(a){case "label":return `.${s}`;case "matrix":return `;${e}=${s}`;case "simple":return s;default:return `${e}=${s}`}}let o=U(a),n=i.map(s=>a==="label"||a==="simple"?t?s:encodeURIComponent(s):y({allowReserved:t,name:e,value:s})).join(o);return a==="label"||a==="matrix"?o+n:n},y=({allowReserved:t,name:r,value:e})=>{if(e==null)return "";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return `${r}=${t?e:encodeURIComponent(e)}`},q=({allowReserved:t,explode:r,name:e,style:a,value:i})=>{if(i instanceof Date)return `${e}=${i.toISOString()}`;if(a!=="deepObject"&&!r){let s=[];Object.entries(i).forEach(([f,u])=>{s=[...s,f,t?u:encodeURIComponent(u)];});let l=s.join(",");switch(a){case "form":return `${e}=${l}`;case "label":return `.${l}`;case "matrix":return `;${e}=${l}`;default:return l}}let o=D(a),n=Object.entries(i).map(([s,l])=>y({allowReserved:t,name:a==="deepObject"?`${e}[${s}]`:s,value:l})).join(o);return a==="label"||a==="matrix"?o+n:n};var H=/\{[^{}]+\}/g,B=({path:t,url:r})=>{let e=r,a=r.match(H);if(a)for(let i of a){let o=false,n=i.substring(1,i.length-1),s="simple";n.endsWith("*")&&(o=true,n=n.substring(0,n.length-1)),n.startsWith(".")?(n=n.substring(1),s="label"):n.startsWith(";")&&(n=n.substring(1),s="matrix");let l=t[n];if(l==null)continue;if(Array.isArray(l)){e=e.replace(i,O({explode:o,name:n,style:s,value:l}));continue}if(typeof l=="object"){e=e.replace(i,q({explode:o,name:n,style:s,value:l}));continue}if(s==="matrix"){e=e.replace(i,`;${y({name:n,value:l})}`);continue}let f=encodeURIComponent(s==="label"?`.${l}`:l);e=e.replace(i,f);}return e},E=({allowReserved:t,array:r,object:e}={})=>i=>{let o=[];if(i&&typeof i=="object")for(let n in i){let s=i[n];if(s!=null){if(Array.isArray(s)){o=[...o,O({allowReserved:t,explode:true,name:n,style:"form",value:s,...r})];continue}if(typeof s=="object"){o=[...o,q({allowReserved:t,explode:true,name:n,style:"deepObject",value:s,...e})];continue}o=[...o,y({allowReserved:t,name:n,value:s})];}}return o.join("&")},P=t=>{if(!t)return "stream";let r=t.split(";")[0]?.trim();if(r){if(r.startsWith("application/json")||r.endsWith("+json"))return "json";if(r==="multipart/form-data")return "formData";if(["application/","audio/","image/","video/"].some(e=>r.startsWith(e)))return "blob";if(r.startsWith("text/"))return "text"}},I=async({security:t,...r})=>{for(let e of t){let a=await A(e,r.auth);if(!a)continue;let i=e.name??"Authorization";switch(e.in){case "query":r.query||(r.query={}),r.query[i]=a;break;case "cookie":r.headers.append("Cookie",`${i}=${a}`);break;case "header":default:r.headers.set(i,a);break}return}},S=t=>W({baseUrl:t.baseUrl,path:t.path,query:t.query,querySerializer:typeof t.querySerializer=="function"?t.querySerializer:E(t.querySerializer),url:t.url}),W=({baseUrl:t,path:r,query:e,querySerializer:a,url:i})=>{let o=i.startsWith("/")?i:`/${i}`,n=(t??"")+o;r&&(n=B({path:r,url:n}));let s=e?a(e):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(n+=`?${s}`),n},C=(t,r)=>{let e={...t,...r};return e.baseUrl?.endsWith("/")&&(e.baseUrl=e.baseUrl.substring(0,e.baseUrl.length-1)),e.headers=x(t.headers,r.headers),e},x=(...t)=>{let r=new Headers;for(let e of t){if(!e||typeof e!="object")continue;let a=e instanceof Headers?e.entries():Object.entries(e);for(let[i,o]of a)if(o===null)r.delete(i);else if(Array.isArray(o))for(let n of o)r.append(i,n);else o!==void 0&&r.set(i,typeof o=="object"?JSON.stringify(o):o);}return r},h=class{_fns;constructor(){this._fns=[];}clear(){this._fns=[];}exists(r){return this._fns.indexOf(r)!==-1}eject(r){let e=this._fns.indexOf(r);e!==-1&&(this._fns=[...this._fns.slice(0,e),...this._fns.slice(e+1)]);}use(r){this._fns=[...this._fns,r];}},T=()=>({error:new h,request:new h,response:new h}),N=E({allowReserved:false,array:{explode:true,style:"form"},object:{explode:true,style:"deepObject"}}),Q={"Content-Type":"application/json"},w=(t={})=>({...R,headers:Q,parseAs:"auto",querySerializer:N,...t});var J=(t={})=>{let r=C(w(),t),e=()=>({...r}),a=n=>(r=C(r,n),e()),i=T(),o=async n=>{let s={...r,...n,fetch:n.fetch??r.fetch??globalThis.fetch,headers:x(r.headers,n.headers)};s.security&&await I({...s,security:s.security}),s.body&&s.bodySerializer&&(s.body=s.bodySerializer(s.body)),(s.body===void 0||s.body==="")&&s.headers.delete("Content-Type");let l=S(s),f={redirect:"follow",...s},u=new Request(l,f);for(let p of i.request._fns)u=await p(u,s);let k=s.fetch,c=await k(u);for(let p of i.response._fns)c=await p(c,u,s);let m={request:u,response:c};if(c.ok){if(c.status===204||c.headers.get("Content-Length")==="0")return {data:{},...m};let p=(s.parseAs==="auto"?P(c.headers.get("Content-Type")):s.parseAs)??"json";if(p==="stream")return {data:c.body,...m};let b=await c[p]();return p==="json"&&(s.responseValidator&&await s.responseValidator(b),s.responseTransformer&&(b=await s.responseTransformer(b))),{data:b,...m}}let g=await c.text();try{g=JSON.parse(g);}catch{}let d=g;for(let p of i.error._fns)d=await p(g,c,u,s);if(d=d||{},s.throwOnError)throw d;return {error:d,...m}};return {buildUrl:S,connect:n=>o({...n,method:"CONNECT"}),delete:n=>o({...n,method:"DELETE"}),get:n=>o({...n,method:"GET"}),getConfig:e,head:n=>o({...n,method:"HEAD"}),interceptors:i,options:n=>o({...n,method:"OPTIONS"}),patch:n=>o({...n,method:"PATCH"}),post:n=>o({...n,method:"POST"}),put:n=>o({...n,method:"PUT"}),request:o,setConfig:a,trace:n=>o({...n,method:"TRACE"})}};exports.createClient=J;exports.createConfig=w;exports.formDataBodySerializer=v;exports.jsonBodySerializer=R;exports.urlSearchParamsBodySerializer=$;//# sourceMappingURL=index.cjs.map -//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.d.cts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.d.cts deleted file mode 100644 index bd13d49a2..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.d.cts +++ /dev/null @@ -1,238 +0,0 @@ -type AuthToken = string | undefined; -interface Auth { - /** - * Which part of the request do we use to send the auth? - * - * @default 'header' - */ - in?: 'header' | 'query' | 'cookie'; - /** - * Header or query parameter name. - * - * @default 'Authorization' - */ - name?: string; - scheme?: 'basic' | 'bearer'; - type: 'apiKey' | 'http'; -} -interface SerializerOptions { - /** - * @default true - */ - explode: boolean; - style: T; -} -type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; -type ObjectStyle = 'form' | 'deepObject'; - -type QuerySerializer = (query: Record) => string; -type BodySerializer = (body: any) => any; -interface QuerySerializerOptions { - allowReserved?: boolean; - array?: SerializerOptions; - object?: SerializerOptions; -} -declare const formDataBodySerializer: { - bodySerializer: | Array>>(body: T) => FormData; -}; -declare const jsonBodySerializer: { - bodySerializer: (body: T) => string; -}; -declare const urlSearchParamsBodySerializer: { - bodySerializer: | Array>>(body: T) => string; -}; - -interface Client$1 { - /** - * Returns the final request URL. - */ - buildUrl: BuildUrlFn; - connect: MethodFn; - delete: MethodFn; - get: MethodFn; - getConfig: () => Config; - head: MethodFn; - options: MethodFn; - patch: MethodFn; - post: MethodFn; - put: MethodFn; - request: RequestFn; - setConfig: (config: Config) => Config; - trace: MethodFn; -} -interface Config$1 { - /** - * Auth token or a function returning auth token. The resolved value will be - * added to the request payload as defined by its `security` array. - */ - auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; - /** - * A function for serializing request body parameter. By default, - * {@link JSON.stringify()} will be used. - */ - bodySerializer?: BodySerializer | null; - /** - * An object containing any HTTP headers that you want to pre-populate your - * `Headers` object with. - * - * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} - */ - headers?: RequestInit['headers'] | Record; - /** - * The request method. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} - */ - method?: 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE'; - /** - * A function for serializing request query parameters. By default, arrays - * will be exploded in form style, objects will be exploded in deepObject - * style, and reserved characters are percent-encoded. - * - * This method will have no effect if the native `paramsSerializer()` Axios - * API function is used. - * - * {@link https://swagger.io/docs/specification/serialization/#query View examples} - */ - querySerializer?: QuerySerializer | QuerySerializerOptions; - /** - * A function transforming response data before it's returned. This is useful - * for post-processing data, e.g. converting ISO strings into Date objects. - */ - responseTransformer?: (data: unknown) => Promise; - /** - * A function validating response data. This is useful if you want to ensure - * the response conforms to the desired shape, so it can be safely passed to - * the transformers and returned to the user. - */ - responseValidator?: (data: unknown) => Promise; -} - -type ErrInterceptor = (error: Err, response: Res, request: Req, options: Options) => Err | Promise; -type ReqInterceptor = (request: Req, options: Options) => Req | Promise; -type ResInterceptor = (response: Res, request: Req, options: Options) => Res | Promise; -declare class Interceptors { - _fns: Interceptor[]; - constructor(); - clear(): void; - exists(fn: Interceptor): boolean; - eject(fn: Interceptor): void; - use(fn: Interceptor): void; -} -interface Middleware { - error: Pick>, 'eject' | 'use'>; - request: Pick>, 'eject' | 'use'>; - response: Pick>, 'eject' | 'use'>; -} -declare const createConfig: (override?: Config & T>) => Config & T>; - -interface Config extends Omit, Config$1 { - /** - * Base URL for all requests made by this client. - */ - baseUrl?: T['baseUrl']; - /** - * Fetch API implementation. You can use this option to provide a custom - * fetch instance. - * - * @default globalThis.fetch - */ - fetch?: (request: Request) => ReturnType; - /** - * Please don't use the Fetch client for Next.js applications. The `next` - * options won't have any effect. - * - * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead. - */ - next?: never; - /** - * Return the response data parsed in a specified format. By default, `auto` - * will infer the appropriate method from the `Content-Type` response header. - * You can override this behavior with any of the {@link Body} methods. - * Select `stream` if you don't want to parse response data at all. - * - * @default 'auto' - */ - parseAs?: Exclude | 'auto' | 'stream'; - /** - * Throw an error instead of returning it in the response? - * - * @default false - */ - throwOnError?: T['throwOnError']; -} -interface RequestOptions extends Config<{ - throwOnError: ThrowOnError; -}> { - /** - * Any body that you want to add to your request. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} - */ - body?: unknown; - path?: Record; - query?: Record; - /** - * Security mechanism(s) to use for the request. - */ - security?: ReadonlyArray; - url: Url; -} -type RequestResult = ThrowOnError extends true ? Promise<{ - data: TData; - request: Request; - response: Response; -}> : Promise<({ - data: TData; - error: undefined; -} | { - data: undefined; - error: TError; -}) & { - request: Request; - response: Response; -}>; -interface ClientOptions { - baseUrl?: string; - throwOnError?: boolean; -} -type MethodFn = (options: Omit, 'method'>) => RequestResult; -type RequestFn = (options: Omit, 'method'> & Pick>, 'method'>) => RequestResult; -type BuildUrlFn = ; - query?: Record; - url: string; -}>(options: Pick & Options) => string; -type Client = Client$1 & { - interceptors: Middleware; -}; -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -type CreateClientConfig = (override?: Config) => Config & T>; -interface TDataShape { - body?: unknown; - headers?: unknown; - path?: unknown; - query?: unknown; - url: string; -} -type OmitKeys = Pick>; -type Options = OmitKeys, 'body' | 'path' | 'query' | 'url'> & Omit; -type OptionsLegacyParser = TData extends { - body?: any; -} ? TData extends { - headers?: any; -} ? OmitKeys, 'body' | 'headers' | 'url'> & TData : OmitKeys, 'body' | 'url'> & TData & Pick, 'headers'> : TData extends { - headers?: any; -} ? OmitKeys, 'headers' | 'url'> & TData & Pick, 'body'> : OmitKeys, 'url'> & TData; - -declare const createClient: (config?: Config) => Client; - -export { type Auth, type Client, type ClientOptions, type Config, type CreateClientConfig, type Options, type OptionsLegacyParser, type QuerySerializerOptions, type RequestOptions, type RequestResult, type TDataShape, createClient, createConfig, formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer }; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.d.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.d.ts deleted file mode 100644 index bd13d49a2..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/client/index.d.ts +++ /dev/null @@ -1,238 +0,0 @@ -type AuthToken = string | undefined; -interface Auth { - /** - * Which part of the request do we use to send the auth? - * - * @default 'header' - */ - in?: 'header' | 'query' | 'cookie'; - /** - * Header or query parameter name. - * - * @default 'Authorization' - */ - name?: string; - scheme?: 'basic' | 'bearer'; - type: 'apiKey' | 'http'; -} -interface SerializerOptions { - /** - * @default true - */ - explode: boolean; - style: T; -} -type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; -type ObjectStyle = 'form' | 'deepObject'; - -type QuerySerializer = (query: Record) => string; -type BodySerializer = (body: any) => any; -interface QuerySerializerOptions { - allowReserved?: boolean; - array?: SerializerOptions; - object?: SerializerOptions; -} -declare const formDataBodySerializer: { - bodySerializer: | Array>>(body: T) => FormData; -}; -declare const jsonBodySerializer: { - bodySerializer: (body: T) => string; -}; -declare const urlSearchParamsBodySerializer: { - bodySerializer: | Array>>(body: T) => string; -}; - -interface Client$1 { - /** - * Returns the final request URL. - */ - buildUrl: BuildUrlFn; - connect: MethodFn; - delete: MethodFn; - get: MethodFn; - getConfig: () => Config; - head: MethodFn; - options: MethodFn; - patch: MethodFn; - post: MethodFn; - put: MethodFn; - request: RequestFn; - setConfig: (config: Config) => Config; - trace: MethodFn; -} -interface Config$1 { - /** - * Auth token or a function returning auth token. The resolved value will be - * added to the request payload as defined by its `security` array. - */ - auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; - /** - * A function for serializing request body parameter. By default, - * {@link JSON.stringify()} will be used. - */ - bodySerializer?: BodySerializer | null; - /** - * An object containing any HTTP headers that you want to pre-populate your - * `Headers` object with. - * - * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} - */ - headers?: RequestInit['headers'] | Record; - /** - * The request method. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} - */ - method?: 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE'; - /** - * A function for serializing request query parameters. By default, arrays - * will be exploded in form style, objects will be exploded in deepObject - * style, and reserved characters are percent-encoded. - * - * This method will have no effect if the native `paramsSerializer()` Axios - * API function is used. - * - * {@link https://swagger.io/docs/specification/serialization/#query View examples} - */ - querySerializer?: QuerySerializer | QuerySerializerOptions; - /** - * A function transforming response data before it's returned. This is useful - * for post-processing data, e.g. converting ISO strings into Date objects. - */ - responseTransformer?: (data: unknown) => Promise; - /** - * A function validating response data. This is useful if you want to ensure - * the response conforms to the desired shape, so it can be safely passed to - * the transformers and returned to the user. - */ - responseValidator?: (data: unknown) => Promise; -} - -type ErrInterceptor = (error: Err, response: Res, request: Req, options: Options) => Err | Promise; -type ReqInterceptor = (request: Req, options: Options) => Req | Promise; -type ResInterceptor = (response: Res, request: Req, options: Options) => Res | Promise; -declare class Interceptors { - _fns: Interceptor[]; - constructor(); - clear(): void; - exists(fn: Interceptor): boolean; - eject(fn: Interceptor): void; - use(fn: Interceptor): void; -} -interface Middleware { - error: Pick>, 'eject' | 'use'>; - request: Pick>, 'eject' | 'use'>; - response: Pick>, 'eject' | 'use'>; -} -declare const createConfig: (override?: Config & T>) => Config & T>; - -interface Config extends Omit, Config$1 { - /** - * Base URL for all requests made by this client. - */ - baseUrl?: T['baseUrl']; - /** - * Fetch API implementation. You can use this option to provide a custom - * fetch instance. - * - * @default globalThis.fetch - */ - fetch?: (request: Request) => ReturnType; - /** - * Please don't use the Fetch client for Next.js applications. The `next` - * options won't have any effect. - * - * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead. - */ - next?: never; - /** - * Return the response data parsed in a specified format. By default, `auto` - * will infer the appropriate method from the `Content-Type` response header. - * You can override this behavior with any of the {@link Body} methods. - * Select `stream` if you don't want to parse response data at all. - * - * @default 'auto' - */ - parseAs?: Exclude | 'auto' | 'stream'; - /** - * Throw an error instead of returning it in the response? - * - * @default false - */ - throwOnError?: T['throwOnError']; -} -interface RequestOptions extends Config<{ - throwOnError: ThrowOnError; -}> { - /** - * Any body that you want to add to your request. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} - */ - body?: unknown; - path?: Record; - query?: Record; - /** - * Security mechanism(s) to use for the request. - */ - security?: ReadonlyArray; - url: Url; -} -type RequestResult = ThrowOnError extends true ? Promise<{ - data: TData; - request: Request; - response: Response; -}> : Promise<({ - data: TData; - error: undefined; -} | { - data: undefined; - error: TError; -}) & { - request: Request; - response: Response; -}>; -interface ClientOptions { - baseUrl?: string; - throwOnError?: boolean; -} -type MethodFn = (options: Omit, 'method'>) => RequestResult; -type RequestFn = (options: Omit, 'method'> & Pick>, 'method'>) => RequestResult; -type BuildUrlFn = ; - query?: Record; - url: string; -}>(options: Pick & Options) => string; -type Client = Client$1 & { - interceptors: Middleware; -}; -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -type CreateClientConfig = (override?: Config) => Config & T>; -interface TDataShape { - body?: unknown; - headers?: unknown; - path?: unknown; - query?: unknown; - url: string; -} -type OmitKeys = Pick>; -type Options = OmitKeys, 'body' | 'path' | 'query' | 'url'> & Omit; -type OptionsLegacyParser = TData extends { - body?: any; -} ? TData extends { - headers?: any; -} ? OmitKeys, 'body' | 'headers' | 'url'> & TData : OmitKeys, 'body' | 'url'> & TData & Pick, 'headers'> : TData extends { - headers?: any; -} ? OmitKeys, 'headers' | 'url'> & TData & Pick, 'body'> : OmitKeys, 'url'> & TData; - -declare const createClient: (config?: Config) => Client; - -export { type Auth, type Client, type ClientOptions, type Config, type CreateClientConfig, type Options, type OptionsLegacyParser, type QuerySerializerOptions, type RequestOptions, type RequestResult, type TDataShape, createClient, createConfig, formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer }; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/sdk.gen.ts deleted file mode 100644 index 5cc6beedc..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from './client'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/bundle/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/sdk.gen.ts deleted file mode 100644 index 7f932711f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/default/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/sdk.gen.ts deleted file mode 100644 index 7f932711f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/sdk.gen.ts deleted file mode 100644 index 2799b3acc..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/sdk.gen.ts +++ /dev/null @@ -1,408 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options: Options) => { - return options.client.patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options: Options) => { - return options.client.delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options: Options) => { - return options.client.head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options: Options) => { - return options.client.options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options: Options) => { - return options.client.patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return options.client.delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options: Options) => { - return options.client.post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options: Options) => { - return options.client.delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return options.client.post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options: Options) => { - return options.client.post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return options.client.put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/client.gen.ts deleted file mode 100644 index 4668e8723..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-next'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-false/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/client.gen.ts deleted file mode 100644 index f61bb2a26..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-next'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-number/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/client.gen.ts deleted file mode 100644 index f61bb2a26..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-next'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/types.gen.ts deleted file mode 100644 index c3e87ddf4..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-strict/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base'; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/client.gen.ts deleted file mode 100644 index df050ec2d..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-next'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'https://foo.com' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/base-url-string/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client.gen.ts deleted file mode 100644 index 14f2d878c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.cjs b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.cjs deleted file mode 100644 index 7deeaf11a..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use strict';var A=async(s,r)=>{let e=typeof r=="function"?await r(s):r;if(e)return s.scheme==="bearer"?`Bearer ${e}`:s.scheme==="basic"?`Basic ${btoa(e)}`:e},z=(s,r,e)=>{typeof e=="string"||e instanceof Blob?s.append(r,e):s.append(r,JSON.stringify(e));},j=(s,r,e)=>{typeof e=="string"?s.append(r,e):s.append(r,JSON.stringify(e));},v={bodySerializer:s=>{let r=new FormData;return Object.entries(s).forEach(([e,a])=>{a!=null&&(Array.isArray(a)?a.forEach(i=>z(r,e,i)):z(r,e,a));}),r}},b={bodySerializer:s=>JSON.stringify(s,(r,e)=>typeof e=="bigint"?e.toString():e)},T={bodySerializer:s=>{let r=new URLSearchParams;return Object.entries(s).forEach(([e,a])=>{a!=null&&(Array.isArray(a)?a.forEach(i=>j(r,e,i)):j(r,e,a));}),r.toString()}},k=s=>{switch(s){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},$=s=>{switch(s){case "form":return ",";case "pipeDelimited":return "|";case "spaceDelimited":return "%20";default:return ","}},U=s=>{switch(s){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},O=({allowReserved:s,explode:r,name:e,style:a,value:i})=>{if(!r){let t=(s?i:i.map(l=>encodeURIComponent(l))).join($(a));switch(a){case "label":return `.${t}`;case "matrix":return `;${e}=${t}`;case "simple":return t;default:return `${e}=${t}`}}let o=k(a),n=i.map(t=>a==="label"||a==="simple"?s?t:encodeURIComponent(t):d({allowReserved:s,name:e,value:t})).join(o);return a==="label"||a==="matrix"?o+n:n},d=({allowReserved:s,name:r,value:e})=>{if(e==null)return "";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return `${r}=${s?e:encodeURIComponent(e)}`},S=({allowReserved:s,explode:r,name:e,style:a,value:i})=>{if(i instanceof Date)return `${e}=${i.toISOString()}`;if(a!=="deepObject"&&!r){let t=[];Object.entries(i).forEach(([p,c])=>{t=[...t,p,s?c:encodeURIComponent(c)];});let l=t.join(",");switch(a){case "form":return `${e}=${l}`;case "label":return `.${l}`;case "matrix":return `;${e}=${l}`;default:return l}}let o=U(a),n=Object.entries(i).map(([t,l])=>d({allowReserved:s,name:a==="deepObject"?`${e}[${t}]`:t,value:l})).join(o);return a==="label"||a==="matrix"?o+n:n};var _=/\{[^{}]+\}/g,D=({path:s,url:r})=>{let e=r,a=r.match(_);if(a)for(let i of a){let o=false,n=i.substring(1,i.length-1),t="simple";n.endsWith("*")&&(o=true,n=n.substring(0,n.length-1)),n.startsWith(".")?(n=n.substring(1),t="label"):n.startsWith(";")&&(n=n.substring(1),t="matrix");let l=s[n];if(l==null)continue;if(Array.isArray(l)){e=e.replace(i,O({explode:o,name:n,style:t,value:l}));continue}if(typeof l=="object"){e=e.replace(i,S({explode:o,name:n,style:t,value:l}));continue}if(t==="matrix"){e=e.replace(i,`;${d({name:n,value:l})}`);continue}let p=encodeURIComponent(t==="label"?`.${l}`:l);e=e.replace(i,p);}return e},q=({allowReserved:s,array:r,object:e}={})=>i=>{let o=[];if(i&&typeof i=="object")for(let n in i){let t=i[n];if(t!=null){if(Array.isArray(t)){o=[...o,O({allowReserved:s,explode:true,name:n,style:"form",value:t,...r})];continue}if(typeof t=="object"){o=[...o,S({allowReserved:s,explode:true,name:n,style:"deepObject",value:t,...e})];continue}o=[...o,d({allowReserved:s,name:n,value:t})];}}return o.join("&")},E=s=>{if(!s)return "stream";let r=s.split(";")[0]?.trim();if(r){if(r.startsWith("application/json")||r.endsWith("+json"))return "json";if(r==="multipart/form-data")return "formData";if(["application/","audio/","image/","video/"].some(e=>r.startsWith(e)))return "blob";if(r.startsWith("text/"))return "text"}},P=async({security:s,...r})=>{for(let e of s){let a=await A(e,r.auth);if(!a)continue;let i=e.name??"Authorization";switch(e.in){case "query":r.query||(r.query={}),r.query[i]=a;break;case "cookie":r.headers.append("Cookie",`${i}=${a}`);break;case "header":default:r.headers.set(i,a);break}return}},C=s=>H({baseUrl:s.baseUrl,path:s.path,query:s.query,querySerializer:typeof s.querySerializer=="function"?s.querySerializer:q(s.querySerializer),url:s.url}),H=({baseUrl:s,path:r,query:e,querySerializer:a,url:i})=>{let o=i.startsWith("/")?i:`/${i}`,n=(s??"")+o;r&&(n=D({path:r,url:n}));let t=e?a(e):"";return t.startsWith("?")&&(t=t.substring(1)),t&&(n+=`?${t}`),n},R=(s,r)=>{let e={...s,...r};return e.baseUrl?.endsWith("/")&&(e.baseUrl=e.baseUrl.substring(0,e.baseUrl.length-1)),e.headers=x(s.headers,r.headers),e},x=(...s)=>{let r=new Headers;for(let e of s){if(!e||typeof e!="object")continue;let a=e instanceof Headers?e.entries():Object.entries(e);for(let[i,o]of a)if(o===null)r.delete(i);else if(Array.isArray(o))for(let n of o)r.append(i,n);else o!==void 0&&r.set(i,typeof o=="object"?JSON.stringify(o):o);}return r},y=class{_fns;constructor(){this._fns=[];}clear(){this._fns=[];}exists(r){return this._fns.indexOf(r)!==-1}eject(r){let e=this._fns.indexOf(r);e!==-1&&(this._fns=[...this._fns.slice(0,e),...this._fns.slice(e+1)]);}use(r){this._fns=[...this._fns,r];}},I=()=>({error:new y,request:new y,response:new y}),B=q({allowReserved:false,array:{explode:true,style:"form"},object:{explode:true,style:"deepObject"}}),W={"Content-Type":"application/json"},w=(s={})=>({...b,headers:W,parseAs:"auto",querySerializer:B,...s});var N=(s={})=>{let r=R(w(),s),e=()=>({...r}),a=n=>(r=R(r,n),e()),i=I(),o=async n=>{let t={...r,...n,fetch:n.fetch??r.fetch??globalThis.fetch,headers:x(r.headers,n.headers)};t.security&&await P({...t,security:t.security}),t.body&&t.bodySerializer&&(t.body=t.bodySerializer(t.body)),(t.body===void 0||t.body==="")&&t.headers.delete("Content-Type");for(let u of i.request._fns)await u(t);let l=C(t),p=t.fetch,c=await p(l,{...t,body:t.body});for(let u of i.response._fns)c=await u(c,t);let h={response:c};if(c.ok){if(c.status===204||c.headers.get("Content-Length")==="0")return {data:{},...h};let u=(t.parseAs==="auto"?E(c.headers.get("Content-Type")):t.parseAs)??"json";if(u==="stream")return {data:c.body,...h};let g=await c[u]();return u==="json"&&(t.responseValidator&&await t.responseValidator(g),t.responseTransformer&&(g=await t.responseTransformer(g))),{data:g,...h}}let m=await c.text();try{m=JSON.parse(m);}catch{}let f=m;for(let u of i.error._fns)f=await u(m,c,t);if(f=f||{},t.throwOnError)throw f;return {error:f,...h}};return {buildUrl:C,connect:n=>o({...n,method:"CONNECT"}),delete:n=>o({...n,method:"DELETE"}),get:n=>o({...n,method:"GET"}),getConfig:e,head:n=>o({...n,method:"HEAD"}),interceptors:i,options:n=>o({...n,method:"OPTIONS"}),patch:n=>o({...n,method:"PATCH"}),post:n=>o({...n,method:"POST"}),put:n=>o({...n,method:"PUT"}),request:o,setConfig:a,trace:n=>o({...n,method:"TRACE"})}};exports.createClient=N;exports.createConfig=w;exports.formDataBodySerializer=v;exports.jsonBodySerializer=b;exports.urlSearchParamsBodySerializer=T;//# sourceMappingURL=index.cjs.map -//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.d.cts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.d.cts deleted file mode 100644 index eb31a3687..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.d.cts +++ /dev/null @@ -1,229 +0,0 @@ -type AuthToken = string | undefined; -interface Auth { - /** - * Which part of the request do we use to send the auth? - * - * @default 'header' - */ - in?: 'header' | 'query' | 'cookie'; - /** - * Header or query parameter name. - * - * @default 'Authorization' - */ - name?: string; - scheme?: 'basic' | 'bearer'; - type: 'apiKey' | 'http'; -} -interface SerializerOptions { - /** - * @default true - */ - explode: boolean; - style: T; -} -type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; -type ObjectStyle = 'form' | 'deepObject'; - -type QuerySerializer = (query: Record) => string; -type BodySerializer = (body: any) => any; -interface QuerySerializerOptions { - allowReserved?: boolean; - array?: SerializerOptions; - object?: SerializerOptions; -} -declare const formDataBodySerializer: { - bodySerializer: | Array>>(body: T) => FormData; -}; -declare const jsonBodySerializer: { - bodySerializer: (body: T) => string; -}; -declare const urlSearchParamsBodySerializer: { - bodySerializer: | Array>>(body: T) => string; -}; - -interface Client$1 { - /** - * Returns the final request URL. - */ - buildUrl: BuildUrlFn; - connect: MethodFn; - delete: MethodFn; - get: MethodFn; - getConfig: () => Config; - head: MethodFn; - options: MethodFn; - patch: MethodFn; - post: MethodFn; - put: MethodFn; - request: RequestFn; - setConfig: (config: Config) => Config; - trace: MethodFn; -} -interface Config$1 { - /** - * Auth token or a function returning auth token. The resolved value will be - * added to the request payload as defined by its `security` array. - */ - auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; - /** - * A function for serializing request body parameter. By default, - * {@link JSON.stringify()} will be used. - */ - bodySerializer?: BodySerializer | null; - /** - * An object containing any HTTP headers that you want to pre-populate your - * `Headers` object with. - * - * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} - */ - headers?: RequestInit['headers'] | Record; - /** - * The request method. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} - */ - method?: 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE'; - /** - * A function for serializing request query parameters. By default, arrays - * will be exploded in form style, objects will be exploded in deepObject - * style, and reserved characters are percent-encoded. - * - * This method will have no effect if the native `paramsSerializer()` Axios - * API function is used. - * - * {@link https://swagger.io/docs/specification/serialization/#query View examples} - */ - querySerializer?: QuerySerializer | QuerySerializerOptions; - /** - * A function transforming response data before it's returned. This is useful - * for post-processing data, e.g. converting ISO strings into Date objects. - */ - responseTransformer?: (data: unknown) => Promise; - /** - * A function validating response data. This is useful if you want to ensure - * the response conforms to the desired shape, so it can be safely passed to - * the transformers and returned to the user. - */ - responseValidator?: (data: unknown) => Promise; -} - -type ErrInterceptor = (error: Err, response: Res, options: Options) => Err | Promise; -type ReqInterceptor = (options: Options) => void | Promise; -type ResInterceptor = (response: Res, options: Options) => Res | Promise; -declare class Interceptors { - _fns: Interceptor[]; - constructor(); - clear(): void; - exists(fn: Interceptor): boolean; - eject(fn: Interceptor): void; - use(fn: Interceptor): void; -} -interface Middleware { - error: Pick>, 'eject' | 'use'>; - request: Pick>, 'eject' | 'use'>; - response: Pick>, 'eject' | 'use'>; -} -declare const createConfig: (override?: Config & T>) => Config & T>; - -interface Config extends Omit, Config$1 { - /** - * Base URL for all requests made by this client. - */ - baseUrl?: T['baseUrl']; - /** - * Fetch API implementation. You can use this option to provide a custom - * fetch instance. - * - * @default globalThis.fetch - */ - fetch?: typeof fetch; - /** - * Return the response data parsed in a specified format. By default, `auto` - * will infer the appropriate method from the `Content-Type` response header. - * You can override this behavior with any of the {@link Body} methods. - * Select `stream` if you don't want to parse response data at all. - * - * @default 'auto' - */ - parseAs?: Exclude | 'auto' | 'stream'; - /** - * Throw an error instead of returning it in the response? - * - * @default false - */ - throwOnError?: T['throwOnError']; -} -interface RequestOptions extends Config<{ - throwOnError: ThrowOnError; -}> { - /** - * Any body that you want to add to your request. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} - */ - body?: unknown; - path?: Record; - query?: Record; - /** - * Security mechanism(s) to use for the request. - */ - security?: ReadonlyArray; - url: Url; -} -type RequestResult = ThrowOnError extends true ? Promise<{ - data: TData; - response: Response; -}> : Promise<({ - data: TData; - error: undefined; -} | { - data: undefined; - error: TError; -}) & { - response: Response; -}>; -interface ClientOptions { - baseUrl?: string; - throwOnError?: boolean; -} -type MethodFn = (options: Omit, 'method'>) => RequestResult; -type RequestFn = (options: Omit, 'method'> & Pick>, 'method'>) => RequestResult; -type BuildUrlFn = ; - query?: Record; - url: string; -}>(options: Pick & Options) => string; -type Client = Client$1 & { - interceptors: Middleware; -}; -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -type CreateClientConfig = (override?: Config) => Config & T>; -interface TDataShape { - body?: unknown; - headers?: unknown; - path?: unknown; - query?: unknown; - url: string; -} -type OmitKeys = Pick>; -type Options = OmitKeys, 'body' | 'path' | 'query' | 'url'> & Omit; -type OptionsLegacyParser = TData extends { - body?: any; -} ? TData extends { - headers?: any; -} ? OmitKeys, 'body' | 'headers' | 'url'> & TData : OmitKeys, 'body' | 'url'> & TData & Pick, 'headers'> : TData extends { - headers?: any; -} ? OmitKeys, 'headers' | 'url'> & TData & Pick, 'body'> : OmitKeys, 'url'> & TData; - -declare const createClient: (config?: Config) => Client; - -export { type Auth, type Client, type ClientOptions, type Config, type CreateClientConfig, type Options, type OptionsLegacyParser, type QuerySerializerOptions, type RequestOptions, type RequestResult, type TDataShape, createClient, createConfig, formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer }; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.d.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.d.ts deleted file mode 100644 index eb31a3687..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/client/index.d.ts +++ /dev/null @@ -1,229 +0,0 @@ -type AuthToken = string | undefined; -interface Auth { - /** - * Which part of the request do we use to send the auth? - * - * @default 'header' - */ - in?: 'header' | 'query' | 'cookie'; - /** - * Header or query parameter name. - * - * @default 'Authorization' - */ - name?: string; - scheme?: 'basic' | 'bearer'; - type: 'apiKey' | 'http'; -} -interface SerializerOptions { - /** - * @default true - */ - explode: boolean; - style: T; -} -type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; -type ObjectStyle = 'form' | 'deepObject'; - -type QuerySerializer = (query: Record) => string; -type BodySerializer = (body: any) => any; -interface QuerySerializerOptions { - allowReserved?: boolean; - array?: SerializerOptions; - object?: SerializerOptions; -} -declare const formDataBodySerializer: { - bodySerializer: | Array>>(body: T) => FormData; -}; -declare const jsonBodySerializer: { - bodySerializer: (body: T) => string; -}; -declare const urlSearchParamsBodySerializer: { - bodySerializer: | Array>>(body: T) => string; -}; - -interface Client$1 { - /** - * Returns the final request URL. - */ - buildUrl: BuildUrlFn; - connect: MethodFn; - delete: MethodFn; - get: MethodFn; - getConfig: () => Config; - head: MethodFn; - options: MethodFn; - patch: MethodFn; - post: MethodFn; - put: MethodFn; - request: RequestFn; - setConfig: (config: Config) => Config; - trace: MethodFn; -} -interface Config$1 { - /** - * Auth token or a function returning auth token. The resolved value will be - * added to the request payload as defined by its `security` array. - */ - auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; - /** - * A function for serializing request body parameter. By default, - * {@link JSON.stringify()} will be used. - */ - bodySerializer?: BodySerializer | null; - /** - * An object containing any HTTP headers that you want to pre-populate your - * `Headers` object with. - * - * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} - */ - headers?: RequestInit['headers'] | Record; - /** - * The request method. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} - */ - method?: 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE'; - /** - * A function for serializing request query parameters. By default, arrays - * will be exploded in form style, objects will be exploded in deepObject - * style, and reserved characters are percent-encoded. - * - * This method will have no effect if the native `paramsSerializer()` Axios - * API function is used. - * - * {@link https://swagger.io/docs/specification/serialization/#query View examples} - */ - querySerializer?: QuerySerializer | QuerySerializerOptions; - /** - * A function transforming response data before it's returned. This is useful - * for post-processing data, e.g. converting ISO strings into Date objects. - */ - responseTransformer?: (data: unknown) => Promise; - /** - * A function validating response data. This is useful if you want to ensure - * the response conforms to the desired shape, so it can be safely passed to - * the transformers and returned to the user. - */ - responseValidator?: (data: unknown) => Promise; -} - -type ErrInterceptor = (error: Err, response: Res, options: Options) => Err | Promise; -type ReqInterceptor = (options: Options) => void | Promise; -type ResInterceptor = (response: Res, options: Options) => Res | Promise; -declare class Interceptors { - _fns: Interceptor[]; - constructor(); - clear(): void; - exists(fn: Interceptor): boolean; - eject(fn: Interceptor): void; - use(fn: Interceptor): void; -} -interface Middleware { - error: Pick>, 'eject' | 'use'>; - request: Pick>, 'eject' | 'use'>; - response: Pick>, 'eject' | 'use'>; -} -declare const createConfig: (override?: Config & T>) => Config & T>; - -interface Config extends Omit, Config$1 { - /** - * Base URL for all requests made by this client. - */ - baseUrl?: T['baseUrl']; - /** - * Fetch API implementation. You can use this option to provide a custom - * fetch instance. - * - * @default globalThis.fetch - */ - fetch?: typeof fetch; - /** - * Return the response data parsed in a specified format. By default, `auto` - * will infer the appropriate method from the `Content-Type` response header. - * You can override this behavior with any of the {@link Body} methods. - * Select `stream` if you don't want to parse response data at all. - * - * @default 'auto' - */ - parseAs?: Exclude | 'auto' | 'stream'; - /** - * Throw an error instead of returning it in the response? - * - * @default false - */ - throwOnError?: T['throwOnError']; -} -interface RequestOptions extends Config<{ - throwOnError: ThrowOnError; -}> { - /** - * Any body that you want to add to your request. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} - */ - body?: unknown; - path?: Record; - query?: Record; - /** - * Security mechanism(s) to use for the request. - */ - security?: ReadonlyArray; - url: Url; -} -type RequestResult = ThrowOnError extends true ? Promise<{ - data: TData; - response: Response; -}> : Promise<({ - data: TData; - error: undefined; -} | { - data: undefined; - error: TError; -}) & { - response: Response; -}>; -interface ClientOptions { - baseUrl?: string; - throwOnError?: boolean; -} -type MethodFn = (options: Omit, 'method'>) => RequestResult; -type RequestFn = (options: Omit, 'method'> & Pick>, 'method'>) => RequestResult; -type BuildUrlFn = ; - query?: Record; - url: string; -}>(options: Pick & Options) => string; -type Client = Client$1 & { - interceptors: Middleware; -}; -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -type CreateClientConfig = (override?: Config) => Config & T>; -interface TDataShape { - body?: unknown; - headers?: unknown; - path?: unknown; - query?: unknown; - url: string; -} -type OmitKeys = Pick>; -type Options = OmitKeys, 'body' | 'path' | 'query' | 'url'> & Omit; -type OptionsLegacyParser = TData extends { - body?: any; -} ? TData extends { - headers?: any; -} ? OmitKeys, 'body' | 'headers' | 'url'> & TData : OmitKeys, 'body' | 'url'> & TData & Pick, 'headers'> : TData extends { - headers?: any; -} ? OmitKeys, 'headers' | 'url'> & TData & Pick, 'body'> : OmitKeys, 'url'> & TData; - -declare const createClient: (config?: Config) => Client; - -export { type Auth, type Client, type ClientOptions, type Config, type CreateClientConfig, type Options, type OptionsLegacyParser, type QuerySerializerOptions, type RequestOptions, type RequestResult, type TDataShape, createClient, createConfig, formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer }; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/sdk.gen.ts deleted file mode 100644 index 5cc6beedc..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from './client'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/bundle/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/client.gen.ts deleted file mode 100644 index f61bb2a26..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-next'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/sdk.gen.ts deleted file mode 100644 index 3b2915e8a..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-next'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/default/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/client.gen.ts deleted file mode 100644 index f61bb2a26..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-next'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/sdk.gen.ts deleted file mode 100644 index 3b2915e8a..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-next'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-optional/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/client.gen.ts deleted file mode 100644 index f61bb2a26..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-next'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/sdk.gen.ts deleted file mode 100644 index 3a51df813..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/sdk.gen.ts +++ /dev/null @@ -1,408 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-next'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options: Options) => { - return options.client.patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options: Options) => { - return options.client.delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options: Options) => { - return options.client.head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options: Options) => { - return options.client.options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options: Options) => { - return options.client.patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return options.client.delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options: Options) => { - return options.client.post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options: Options) => { - return options.client.delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return options.client.post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options: Options) => { - return options.client.post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return options.client.put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-next/sdk-client-required/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/client.gen.ts deleted file mode 100644 index e4e7ddb56..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-nuxt'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/types.gen.ts deleted file mode 100644 index 9cb3fcf99..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-false/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/client.gen.ts deleted file mode 100644 index 107d15930..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-nuxt'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/types.gen.ts deleted file mode 100644 index 9cb3fcf99..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-number/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/client.gen.ts deleted file mode 100644 index 107d15930..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-nuxt'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/types.gen.ts deleted file mode 100644 index a0d27c8ae..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base'; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/client.gen.ts deleted file mode 100644 index 05d3c1239..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-nuxt'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'https://foo.com' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/types.gen.ts deleted file mode 100644 index 9cb3fcf99..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/base-url-string/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client.gen.ts deleted file mode 100644 index 64c0080e8..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client/index.d.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client/index.d.ts deleted file mode 100644 index d8a2a385e..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client/index.d.ts +++ /dev/null @@ -1,193 +0,0 @@ -import { UseFetchOptions, AsyncDataOptions, useAsyncData, useFetch, useLazyAsyncData, useLazyFetch } from 'nuxt/app'; -import { Ref } from 'vue'; - -type AuthToken = string | undefined; -interface Auth { - /** - * Which part of the request do we use to send the auth? - * - * @default 'header' - */ - in?: 'header' | 'query' | 'cookie'; - /** - * Header or query parameter name. - * - * @default 'Authorization' - */ - name?: string; - scheme?: 'basic' | 'bearer'; - type: 'apiKey' | 'http'; -} -interface SerializerOptions { - /** - * @default true - */ - explode: boolean; - style: T; -} -type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; -type ObjectStyle = 'form' | 'deepObject'; - -type QuerySerializer$1 = (query: Record) => string; -type BodySerializer = (body: any) => any; -interface QuerySerializerOptions { - allowReserved?: boolean; - array?: SerializerOptions; - object?: SerializerOptions; -} -declare const formDataBodySerializer: { - bodySerializer: | Array>>(body: T) => FormData; -}; -declare const jsonBodySerializer: { - bodySerializer: (body: T) => string; -}; -declare const urlSearchParamsBodySerializer: { - bodySerializer: | Array>>(body: T) => string; -}; - -interface Client$1 { - /** - * Returns the final request URL. - */ - buildUrl: BuildUrlFn; - connect: MethodFn; - delete: MethodFn; - get: MethodFn; - getConfig: () => Config; - head: MethodFn; - options: MethodFn; - patch: MethodFn; - post: MethodFn; - put: MethodFn; - request: RequestFn; - setConfig: (config: Config) => Config; - trace: MethodFn; -} -interface Config$1 { - /** - * Auth token or a function returning auth token. The resolved value will be - * added to the request payload as defined by its `security` array. - */ - auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; - /** - * A function for serializing request body parameter. By default, - * {@link JSON.stringify()} will be used. - */ - bodySerializer?: BodySerializer | null; - /** - * An object containing any HTTP headers that you want to pre-populate your - * `Headers` object with. - * - * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} - */ - headers?: RequestInit['headers'] | Record; - /** - * The request method. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} - */ - method?: 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE'; - /** - * A function for serializing request query parameters. By default, arrays - * will be exploded in form style, objects will be exploded in deepObject - * style, and reserved characters are percent-encoded. - * - * This method will have no effect if the native `paramsSerializer()` Axios - * API function is used. - * - * {@link https://swagger.io/docs/specification/serialization/#query View examples} - */ - querySerializer?: QuerySerializer$1 | QuerySerializerOptions; - /** - * A function transforming response data before it's returned. This is useful - * for post-processing data, e.g. converting ISO strings into Date objects. - */ - responseTransformer?: (data: unknown) => Promise; - /** - * A function validating response data. This is useful if you want to ensure - * the response conforms to the desired shape, so it can be safely passed to - * the transformers and returned to the user. - */ - responseValidator?: (data: unknown) => Promise; -} - -type QuerySerializer = (query: Parameters[0]['query']) => string; -type WithRefs = { - [K in keyof TData]: NonNullable extends object ? WithRefs> | Ref> : NonNullable | Ref>; -}; -type KeysOf = Array; -interface Config extends Omit, 'baseURL' | 'body' | 'headers' | 'method' | 'query'>, WithRefs, 'query'>>, Omit { - /** - * Base URL for all requests made by this client. - */ - baseURL?: T['baseURL']; - /** - * A function for serializing request query parameters. By default, arrays - * will be exploded in form style, objects will be exploded in deepObject - * style, and reserved characters are percent-encoded. - * - * {@link https://swagger.io/docs/specification/serialization/#query View examples} - */ - querySerializer?: QuerySerializer | QuerySerializerOptions; -} -interface RequestOptions extends Config, WithRefs<{ - /** - * Any body that you want to add to your request. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} - */ - body?: unknown; - path?: FetchOptions['query']; - query?: FetchOptions['query']; -}> { - asyncDataOptions?: AsyncDataOptions, DefaultT>; - composable: TComposable; - key?: string; - /** - * Security mechanism(s) to use for the request. - */ - security?: ReadonlyArray; - url: Url; -} -type RequestResult = TComposable extends '$fetch' ? ReturnType> : TComposable extends 'useAsyncData' ? ReturnType> : TComposable extends 'useFetch' ? ReturnType> : TComposable extends 'useLazyAsyncData' ? ReturnType> : TComposable extends 'useLazyFetch' ? ReturnType> : never; -interface ClientOptions { - baseURL?: string; -} -type MethodFn = (options: Omit, 'method'>) => RequestResult; -type RequestFn = (options: Omit, 'method'> & Pick>, 'method'>) => RequestResult; -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -type CreateClientConfig = (override?: Config) => Config & T>; -interface TDataShape { - body?: unknown; - headers?: unknown; - path?: FetchOptions['query']; - query?: FetchOptions['query']; - url: string; -} -type BuildUrlOptions = Omit> = Pick, 'path' | 'query'> & Pick & Pick, 'baseURL' | 'querySerializer'>; -type BuildUrlFn = >(options: BuildUrlOptions) => string; -type Client = Client$1; -type OmitKeys = Pick>; -type Options = OmitKeys, 'body' | 'path' | 'query' | 'url'> & WithRefs>; -type OptionsLegacyParser = TData extends { - body?: any; -} ? TData extends { - headers?: any; -} ? OmitKeys & TData : OmitKeys & TData & Pick : TData extends { - headers?: any; -} ? OmitKeys & TData & Pick : OmitKeys & TData; -type FetchOptions = Omit, keyof AsyncDataOptions>; -type Composable = '$fetch' | 'useAsyncData' | 'useFetch' | 'useLazyAsyncData' | 'useLazyFetch'; - -declare const createClient: (config?: Config) => Client; - -declare const createConfig: (override?: Config & T>) => Config & T>; - -export { type Auth, type Client, type ClientOptions, type Composable, type Config, type CreateClientConfig, type Options, type OptionsLegacyParser, type QuerySerializerOptions, type RequestOptions, type RequestResult, type TDataShape, createClient, createConfig, formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer }; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client/index.js b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client/index.js deleted file mode 100644 index fe534408a..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/client/index.js +++ /dev/null @@ -1,2 +0,0 @@ -import {useLazyFetch,useFetch,useAsyncData,useLazyAsyncData}from'nuxt/app';import {toValue,reactive,ref,watch,isRef,unref}from'vue';var E=async(r,t)=>{let e=typeof t=="function"?await t(r):t;if(e)return r.scheme==="bearer"?`Bearer ${e}`:r.scheme==="basic"?`Basic ${btoa(e)}`:e},U=(r,t,e)=>{typeof e=="string"||e instanceof Blob?r.append(t,e):r.append(t,JSON.stringify(e));},k=(r,t,e)=>{typeof e=="string"?r.append(t,e):r.append(t,JSON.stringify(e));},F={bodySerializer:r=>{let t=new FormData;return Object.entries(r).forEach(([e,a])=>{a!=null&&(Array.isArray(a)?a.forEach(o=>U(t,e,o)):U(t,e,a));}),t}},R={bodySerializer:r=>JSON.stringify(r,(t,e)=>typeof e=="bigint"?e.toString():e)},I={bodySerializer:r=>{let t=new URLSearchParams;return Object.entries(r).forEach(([e,a])=>{a!=null&&(Array.isArray(a)?a.forEach(o=>k(t,e,o)):k(t,e,a));}),t.toString()}},N=r=>{switch(r){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},Q=r=>{switch(r){case "form":return ",";case "pipeDelimited":return "|";case "spaceDelimited":return "%20";default:return ","}},V=r=>{switch(r){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},S=({allowReserved:r,explode:t,name:e,style:a,value:o})=>{if(!t){let i=(r?o:o.map(u=>encodeURIComponent(u))).join(Q(a));switch(a){case "label":return `.${i}`;case "matrix":return `;${e}=${i}`;case "simple":return i;default:return `${e}=${i}`}}let n=N(a),s=o.map(i=>a==="label"||a==="simple"?r?i:encodeURIComponent(i):p({allowReserved:r,name:e,value:i})).join(n);return a==="label"||a==="matrix"?n+s:s},p=({allowReserved:r,name:t,value:e})=>{if(e==null)return "";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return `${t}=${r?e:encodeURIComponent(e)}`},z=({allowReserved:r,explode:t,name:e,style:a,value:o})=>{if(o instanceof Date)return `${e}=${o.toISOString()}`;if(a!=="deepObject"&&!t){let i=[];Object.entries(o).forEach(([l,d])=>{i=[...i,l,r?d:encodeURIComponent(d)];});let u=i.join(",");switch(a){case "form":return `${e}=${u}`;case "label":return `.${u}`;case "matrix":return `;${e}=${u}`;default:return u}}let n=V(a),s=Object.entries(o).map(([i,u])=>p({allowReserved:r,name:a==="deepObject"?`${e}[${i}]`:i,value:u})).join(n);return a==="label"||a==="matrix"?n+s:s};var W=/\{[^{}]+\}/g,J=({path:r,url:t})=>{let e=t,a=t.match(W);if(a)for(let o of a){let n=false,s=o.substring(1,o.length-1),i="simple";s.endsWith("*")&&(n=true,s=s.substring(0,s.length-1)),s.startsWith(".")?(s=s.substring(1),i="label"):s.startsWith(";")&&(s=s.substring(1),i="matrix");let u=toValue(toValue(r)[s]);if(u==null)continue;if(Array.isArray(u)){e=e.replace(o,S({explode:n,name:s,style:i,value:u}));continue}if(typeof u=="object"){e=e.replace(o,z({explode:n,name:s,style:i,value:u}));continue}if(i==="matrix"){e=e.replace(o,`;${p({name:s,value:u})}`);continue}let l=encodeURIComponent(i==="label"?`.${u}`:u);e=e.replace(o,l);}return e},v=({allowReserved:r,array:t,object:e}={})=>o=>{let n=[],s=toValue(o);if(s&&typeof s=="object")for(let i in s){let u=toValue(s[i]);if(u!=null){if(Array.isArray(u)){n=[...n,S({allowReserved:r,explode:true,name:i,style:"form",value:u,...t})];continue}if(typeof u=="object"){n=[...n,z({allowReserved:r,explode:true,name:i,style:"deepObject",value:u,...e})];continue}n=[...n,p({allowReserved:r,name:i,value:u})];}}return n.join("&")},B=async({security:r,...t})=>{for(let e of r){let a=await E(e,t.auth);if(!a)continue;let o=e.name??"Authorization";switch(e.in){case "query":t.query||(t.query={}),toValue(t.query)[o]=a;break;case "cookie":t.headers.append("Cookie",`${o}=${a}`);break;case "header":default:t.headers.set(o,a);break}return}},h=r=>M({baseUrl:r.baseURL,path:r.path,query:r.query,querySerializer:typeof r.querySerializer=="function"?r.querySerializer:v(r.querySerializer),url:r.url}),M=({baseUrl:r,path:t,query:e,querySerializer:a,url:o})=>{let n=o.startsWith("/")?o:`/${o}`,s=(r??"")+n;t&&(s=J({path:t,url:s}));let i=e?a(e):"";return i.startsWith("?")&&(i=i.substring(1)),i&&(s+=`?${i}`),s},A=(r,t)=>{let e={...r,...t};return e.baseURL?.endsWith("/")&&(e.baseURL=e.baseURL.substring(0,e.baseURL.length-1)),e.headers=O(r.headers,t.headers),e},O=(...r)=>{let t=new Headers;for(let e of r){if(!e||typeof e!="object")continue;let a=e;isRef(a)&&(a=unref(a));let o=a instanceof Headers?a.entries():Object.entries(a);for(let[n,s]of o)if(s===null)t.delete(n);else if(Array.isArray(s))for(let i of s)t.append(n,y(i));else if(s!==void 0){let i=y(s);t.set(n,typeof i=="object"?JSON.stringify(i):i);}}return t},q=(...r)=>r.reduce((t,e)=>{if(typeof e=="function")t.push(e);else if(Array.isArray(e))return t.concat(e);return t},[]),_=v({allowReserved:false,array:{explode:true,style:"form"},object:{explode:true,style:"deepObject"}}),K={"Content-Type":"application/json"},w=(r={})=>({...R,headers:K,querySerializer:_,...r}),y=r=>{if(r===null||typeof r!="object"||r instanceof Headers)return isRef(r)?unref(r):r;if(Array.isArray(r))return r.map(e=>y(e));if(isRef(r))return y(unref(r));let t={};for(let e in r)t[e]=y(r[e]);return t},g=r=>r.body&&r.bodySerializer?r.bodySerializer(r.body):r.body,P=(r,t)=>{let e=y(r);return e.body=g(e),t(h(r),e)};var re=(r={})=>{let t=A(w(),r),e=()=>({...t}),a=n=>(t=A(t,n),e()),o=({asyncDataOptions:n,composable:s,key:i,...u})=>{let l={...t,...u,$fetch:u.$fetch??t.$fetch??$fetch,headers:O(t.headers,u.headers),onRequest:q(t.onRequest,u.onRequest),onResponse:q(t.onResponse,u.onResponse)},{responseTransformer:d,responseValidator:C,security:j}=l;j&&(l.onRequest=[async({options:c})=>{await B({auth:l.auth,headers:c.headers,query:c.query,security:j});},...l.onRequest]),(d||C)&&(l.onResponse=[...l.onResponse,async({options:c,response:f})=>{c.responseType&&c.responseType!=="json"||f.ok&&(C&&await C(f._data),d&&(f._data=await d(f._data)));}]),(l.body===void 0||l.body==="")&&l.headers.delete("Content-Type");let $=l.$fetch;if(s==="$fetch")return P(l,$);if(s==="useFetch"||s==="useLazyFetch"){let c=reactive({body:l.body,bodySerializer:l.bodySerializer}),f=ref(g(l));return l.body=f,watch(c,D=>{f.value=g(D);}),s==="useLazyFetch"?useLazyFetch(()=>h(l),l):useFetch(()=>h(l),l)}let b=()=>P(l,$);if(s==="useAsyncData")return i?useAsyncData(i,b,n):useAsyncData(b,n);if(s==="useLazyAsyncData")return i?useLazyAsyncData(i,b,n):useLazyAsyncData(b,n)};return {buildUrl:h,connect:n=>o({...n,method:"CONNECT"}),delete:n=>o({...n,method:"DELETE"}),get:n=>o({...n,method:"GET"}),getConfig:e,head:n=>o({...n,method:"HEAD"}),options:n=>o({...n,method:"OPTIONS"}),patch:n=>o({...n,method:"PATCH"}),post:n=>o({...n,method:"POST"}),put:n=>o({...n,method:"PUT"}),request:o,setConfig:a,trace:n=>o({...n,method:"TRACE"})}};export{re as createClient,w as createConfig,F as formDataBodySerializer,R as jsonBodySerializer,I as urlSearchParamsBodySerializer};//# sourceMappingURL=index.js.map -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/sdk.gen.ts deleted file mode 100644 index fb9e7463c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type Composable, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from './client'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options: Options) => { - return (options.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options: Options) => { - return (options.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options: Options) => { - return (options.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options: Options) => { - return (options.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/types.gen.ts deleted file mode 100644 index 9cb3fcf99..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/bundle/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/client.gen.ts deleted file mode 100644 index 107d15930..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-nuxt'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/sdk.gen.ts deleted file mode 100644 index 52b3d2f89..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type Composable, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-nuxt'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options: Options) => { - return (options.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options: Options) => { - return (options.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options: Options) => { - return (options.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options: Options) => { - return (options.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/types.gen.ts deleted file mode 100644 index 9cb3fcf99..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/default/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/client.gen.ts deleted file mode 100644 index 107d15930..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-nuxt'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/sdk.gen.ts deleted file mode 100644 index 52b3d2f89..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type Composable, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-nuxt'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options: Options) => { - return (options.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options: Options) => { - return (options.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options: Options) => { - return (options.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options: Options) => { - return (options.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/types.gen.ts deleted file mode 100644 index 9cb3fcf99..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/client.gen.ts deleted file mode 100644 index 107d15930..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-nuxt'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/sdk.gen.ts deleted file mode 100644 index a9dcde0e7..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/sdk.gen.ts +++ /dev/null @@ -1,408 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type Composable, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-nuxt'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options: Options) => { - return options.client.patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options: Options) => { - return options.client.delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options: Options) => { - return options.client.head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options: Options) => { - return options.client.options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options: Options) => { - return options.client.patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return options.client.delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options: Options) => { - return options.client.post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options: Options) => { - return options.client.delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return options.client.post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options: Options) => { - return options.client.post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return options.client.put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/types.gen.ts deleted file mode 100644 index 9cb3fcf99..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/client.gen.ts deleted file mode 100644 index 851ca2f65..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-custom'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-false/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/client.gen.ts deleted file mode 100644 index c72285a7e..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-custom'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-number/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/client.gen.ts deleted file mode 100644 index c72285a7e..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-custom'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/types.gen.ts deleted file mode 100644 index c3e87ddf4..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-strict/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base'; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/client.gen.ts deleted file mode 100644 index d003f7736..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-custom'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'https://foo.com' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/base-url-string/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client.gen.ts deleted file mode 100644 index 14f2d878c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.cjs b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.cjs deleted file mode 100644 index 2886023aa..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use strict';var A=async(t,r)=>{let e=typeof r=="function"?await r(t):r;if(e)return t.scheme==="bearer"?`Bearer ${e}`:t.scheme==="basic"?`Basic ${btoa(e)}`:e},z=(t,r,e)=>{typeof e=="string"||e instanceof Blob?t.append(r,e):t.append(r,JSON.stringify(e));},j=(t,r,e)=>{typeof e=="string"?t.append(r,e):t.append(r,JSON.stringify(e));},v={bodySerializer:t=>{let r=new FormData;return Object.entries(t).forEach(([e,a])=>{a!=null&&(Array.isArray(a)?a.forEach(i=>z(r,e,i)):z(r,e,a));}),r}},R={bodySerializer:t=>JSON.stringify(t,(r,e)=>typeof e=="bigint"?e.toString():e)},$={bodySerializer:t=>{let r=new URLSearchParams;return Object.entries(t).forEach(([e,a])=>{a!=null&&(Array.isArray(a)?a.forEach(i=>j(r,e,i)):j(r,e,a));}),r.toString()}},U=t=>{switch(t){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},_=t=>{switch(t){case "form":return ",";case "pipeDelimited":return "|";case "spaceDelimited":return "%20";default:return ","}},D=t=>{switch(t){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},O=({allowReserved:t,explode:r,name:e,style:a,value:i})=>{if(!r){let s=(t?i:i.map(l=>encodeURIComponent(l))).join(_(a));switch(a){case "label":return `.${s}`;case "matrix":return `;${e}=${s}`;case "simple":return s;default:return `${e}=${s}`}}let o=U(a),n=i.map(s=>a==="label"||a==="simple"?t?s:encodeURIComponent(s):y({allowReserved:t,name:e,value:s})).join(o);return a==="label"||a==="matrix"?o+n:n},y=({allowReserved:t,name:r,value:e})=>{if(e==null)return "";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return `${r}=${t?e:encodeURIComponent(e)}`},q=({allowReserved:t,explode:r,name:e,style:a,value:i})=>{if(i instanceof Date)return `${e}=${i.toISOString()}`;if(a!=="deepObject"&&!r){let s=[];Object.entries(i).forEach(([f,u])=>{s=[...s,f,t?u:encodeURIComponent(u)];});let l=s.join(",");switch(a){case "form":return `${e}=${l}`;case "label":return `.${l}`;case "matrix":return `;${e}=${l}`;default:return l}}let o=D(a),n=Object.entries(i).map(([s,l])=>y({allowReserved:t,name:a==="deepObject"?`${e}[${s}]`:s,value:l})).join(o);return a==="label"||a==="matrix"?o+n:n};var H=/\{[^{}]+\}/g,B=({path:t,url:r})=>{let e=r,a=r.match(H);if(a)for(let i of a){let o=false,n=i.substring(1,i.length-1),s="simple";n.endsWith("*")&&(o=true,n=n.substring(0,n.length-1)),n.startsWith(".")?(n=n.substring(1),s="label"):n.startsWith(";")&&(n=n.substring(1),s="matrix");let l=t[n];if(l==null)continue;if(Array.isArray(l)){e=e.replace(i,O({explode:o,name:n,style:s,value:l}));continue}if(typeof l=="object"){e=e.replace(i,q({explode:o,name:n,style:s,value:l}));continue}if(s==="matrix"){e=e.replace(i,`;${y({name:n,value:l})}`);continue}let f=encodeURIComponent(s==="label"?`.${l}`:l);e=e.replace(i,f);}return e},E=({allowReserved:t,array:r,object:e}={})=>i=>{let o=[];if(i&&typeof i=="object")for(let n in i){let s=i[n];if(s!=null){if(Array.isArray(s)){o=[...o,O({allowReserved:t,explode:true,name:n,style:"form",value:s,...r})];continue}if(typeof s=="object"){o=[...o,q({allowReserved:t,explode:true,name:n,style:"deepObject",value:s,...e})];continue}o=[...o,y({allowReserved:t,name:n,value:s})];}}return o.join("&")},P=t=>{if(!t)return "stream";let r=t.split(";")[0]?.trim();if(r){if(r.startsWith("application/json")||r.endsWith("+json"))return "json";if(r==="multipart/form-data")return "formData";if(["application/","audio/","image/","video/"].some(e=>r.startsWith(e)))return "blob";if(r.startsWith("text/"))return "text"}},I=async({security:t,...r})=>{for(let e of t){let a=await A(e,r.auth);if(!a)continue;let i=e.name??"Authorization";switch(e.in){case "query":r.query||(r.query={}),r.query[i]=a;break;case "cookie":r.headers.append("Cookie",`${i}=${a}`);break;case "header":default:r.headers.set(i,a);break}return}},S=t=>W({baseUrl:t.baseUrl,path:t.path,query:t.query,querySerializer:typeof t.querySerializer=="function"?t.querySerializer:E(t.querySerializer),url:t.url}),W=({baseUrl:t,path:r,query:e,querySerializer:a,url:i})=>{let o=i.startsWith("/")?i:`/${i}`,n=(t??"")+o;r&&(n=B({path:r,url:n}));let s=e?a(e):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(n+=`?${s}`),n},C=(t,r)=>{let e={...t,...r};return e.baseUrl?.endsWith("/")&&(e.baseUrl=e.baseUrl.substring(0,e.baseUrl.length-1)),e.headers=x(t.headers,r.headers),e},x=(...t)=>{let r=new Headers;for(let e of t){if(!e||typeof e!="object")continue;let a=e instanceof Headers?e.entries():Object.entries(e);for(let[i,o]of a)if(o===null)r.delete(i);else if(Array.isArray(o))for(let n of o)r.append(i,n);else o!==void 0&&r.set(i,typeof o=="object"?JSON.stringify(o):o);}return r},h=class{_fns;constructor(){this._fns=[];}clear(){this._fns=[];}exists(r){return this._fns.indexOf(r)!==-1}eject(r){let e=this._fns.indexOf(r);e!==-1&&(this._fns=[...this._fns.slice(0,e),...this._fns.slice(e+1)]);}use(r){this._fns=[...this._fns,r];}},T=()=>({error:new h,request:new h,response:new h}),N=E({allowReserved:false,array:{explode:true,style:"form"},object:{explode:true,style:"deepObject"}}),Q={"Content-Type":"application/json"},w=(t={})=>({...R,headers:Q,parseAs:"auto",querySerializer:N,...t});var J=(t={})=>{let r=C(w(),t),e=()=>({...r}),a=n=>(r=C(r,n),e()),i=T(),o=async n=>{let s={...r,...n,fetch:n.fetch??r.fetch??globalThis.fetch,headers:x(r.headers,n.headers)};s.security&&await I({...s,security:s.security}),s.body&&s.bodySerializer&&(s.body=s.bodySerializer(s.body)),(s.body===void 0||s.body==="")&&s.headers.delete("Content-Type");let l=S(s),f={redirect:"follow",...s},u=new Request(l,f);for(let p of i.request._fns)u=await p(u,s);let k=s.fetch,c=await k(u);for(let p of i.response._fns)c=await p(c,u,s);let m={request:u,response:c};if(c.ok){if(c.status===204||c.headers.get("Content-Length")==="0")return {data:{},...m};let p=(s.parseAs==="auto"?P(c.headers.get("Content-Type")):s.parseAs)??"json";if(p==="stream")return {data:c.body,...m};let b=await c[p]();return p==="json"&&(s.responseValidator&&await s.responseValidator(b),s.responseTransformer&&(b=await s.responseTransformer(b))),{data:b,...m}}let g=await c.text();try{g=JSON.parse(g);}catch{}let d=g;for(let p of i.error._fns)d=await p(g,c,u,s);if(d=d||{},s.throwOnError)throw d;return {error:d,...m}};return {buildUrl:S,connect:n=>o({...n,method:"CONNECT"}),delete:n=>o({...n,method:"DELETE"}),get:n=>o({...n,method:"GET"}),getConfig:e,head:n=>o({...n,method:"HEAD"}),interceptors:i,options:n=>o({...n,method:"OPTIONS"}),patch:n=>o({...n,method:"PATCH"}),post:n=>o({...n,method:"POST"}),put:n=>o({...n,method:"PUT"}),request:o,setConfig:a,trace:n=>o({...n,method:"TRACE"})}};exports.createClient=J;exports.createConfig=w;exports.formDataBodySerializer=v;exports.jsonBodySerializer=R;exports.urlSearchParamsBodySerializer=$;//# sourceMappingURL=index.cjs.map -//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.d.cts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.d.cts deleted file mode 100644 index ec7b7c7c0..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.d.cts +++ /dev/null @@ -1,231 +0,0 @@ -type AuthToken = string | undefined; -interface Auth { - /** - * Which part of the request do we use to send the auth? - * - * @default 'header' - */ - in?: 'header' | 'query' | 'cookie'; - /** - * Header or query parameter name. - * - * @default 'Authorization' - */ - name?: string; - scheme?: 'basic' | 'bearer'; - type: 'apiKey' | 'http'; -} -interface SerializerOptions { - /** - * @default true - */ - explode: boolean; - style: T; -} -type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; -type ObjectStyle = 'form' | 'deepObject'; - -type QuerySerializer = (query: Record) => string; -type BodySerializer = (body: any) => any; -interface QuerySerializerOptions { - allowReserved?: boolean; - array?: SerializerOptions; - object?: SerializerOptions; -} -declare const formDataBodySerializer: { - bodySerializer: | Array>>(body: T) => FormData; -}; -declare const jsonBodySerializer: { - bodySerializer: (body: T) => string; -}; -declare const urlSearchParamsBodySerializer: { - bodySerializer: | Array>>(body: T) => string; -}; - -interface Client$1 { - /** - * Returns the final request URL. - */ - buildUrl: BuildUrlFn; - connect: MethodFn; - delete: MethodFn; - get: MethodFn; - getConfig: () => Config; - head: MethodFn; - options: MethodFn; - patch: MethodFn; - post: MethodFn; - put: MethodFn; - request: RequestFn; - setConfig: (config: Config) => Config; - trace: MethodFn; -} -interface Config$1 { - /** - * Auth token or a function returning auth token. The resolved value will be - * added to the request payload as defined by its `security` array. - */ - auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; - /** - * A function for serializing request body parameter. By default, - * {@link JSON.stringify()} will be used. - */ - bodySerializer?: BodySerializer | null; - /** - * An object containing any HTTP headers that you want to pre-populate your - * `Headers` object with. - * - * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} - */ - headers?: RequestInit['headers'] | Record; - /** - * The request method. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} - */ - method?: 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE'; - /** - * A function for serializing request query parameters. By default, arrays - * will be exploded in form style, objects will be exploded in deepObject - * style, and reserved characters are percent-encoded. - * - * This method will have no effect if the native `paramsSerializer()` Axios - * API function is used. - * - * {@link https://swagger.io/docs/specification/serialization/#query View examples} - */ - querySerializer?: QuerySerializer | QuerySerializerOptions; - /** - * A function transforming response data before it's returned. This is useful - * for post-processing data, e.g. converting ISO strings into Date objects. - */ - responseTransformer?: (data: unknown) => Promise; - /** - * A function validating response data. This is useful if you want to ensure - * the response conforms to the desired shape, so it can be safely passed to - * the transformers and returned to the user. - */ - responseValidator?: (data: unknown) => Promise; -} - -type ErrInterceptor = (error: Err, response: Res, request: Req, options: Options) => Err | Promise; -type ReqInterceptor = (request: Req, options: Options) => Req | Promise; -type ResInterceptor = (response: Res, request: Req, options: Options) => Res | Promise; -declare class Interceptors { - _fns: Interceptor[]; - constructor(); - clear(): void; - exists(fn: Interceptor): boolean; - eject(fn: Interceptor): void; - use(fn: Interceptor): void; -} -interface Middleware { - error: Pick>, 'eject' | 'use'>; - request: Pick>, 'eject' | 'use'>; - response: Pick>, 'eject' | 'use'>; -} -declare const createConfig: (override?: Config & T>) => Config & T>; - -interface Config extends Omit, Config$1 { - /** - * Base URL for all requests made by this client. - */ - baseUrl?: T['baseUrl']; - /** - * Fetch API implementation. You can use this option to provide a custom - * fetch instance. - * - * @default globalThis.fetch - */ - fetch?: (request: Request) => ReturnType; - /** - * Return the response data parsed in a specified format. By default, `auto` - * will infer the appropriate method from the `Content-Type` response header. - * You can override this behavior with any of the {@link Body} methods. - * Select `stream` if you don't want to parse response data at all. - * - * @default 'auto' - */ - parseAs?: Exclude | 'auto' | 'stream'; - /** - * Throw an error instead of returning it in the response? - * - * @default false - */ - throwOnError?: T['throwOnError']; -} -interface RequestOptions extends Config<{ - throwOnError: ThrowOnError; -}> { - /** - * Any body that you want to add to your request. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} - */ - body?: unknown; - path?: Record; - query?: Record; - /** - * Security mechanism(s) to use for the request. - */ - security?: ReadonlyArray; - url: Url; -} -type RequestResult = ThrowOnError extends true ? Promise<{ - data: TData; - request: Request; - response: Response; -}> : Promise<({ - data: TData; - error: undefined; -} | { - data: undefined; - error: TError; -}) & { - request: Request; - response: Response; -}>; -interface ClientOptions { - baseUrl?: string; - throwOnError?: boolean; -} -type MethodFn = (options: Omit, 'method'>) => RequestResult; -type RequestFn = (options: Omit, 'method'> & Pick>, 'method'>) => RequestResult; -type BuildUrlFn = ; - query?: Record; - url: string; -}>(options: Pick & Options) => string; -type Client = Client$1 & { - interceptors: Middleware; -}; -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -type CreateClientConfig = (override?: Config) => Config & T>; -interface TDataShape { - body?: unknown; - headers?: unknown; - path?: unknown; - query?: unknown; - url: string; -} -type OmitKeys = Pick>; -type Options = OmitKeys, 'body' | 'path' | 'query' | 'url'> & Omit; -type OptionsLegacyParser = TData extends { - body?: any; -} ? TData extends { - headers?: any; -} ? OmitKeys, 'body' | 'headers' | 'url'> & TData : OmitKeys, 'body' | 'url'> & TData & Pick, 'headers'> : TData extends { - headers?: any; -} ? OmitKeys, 'headers' | 'url'> & TData & Pick, 'body'> : OmitKeys, 'url'> & TData; - -declare const createClient: (config?: Config) => Client; - -export { type Auth, type Client, type ClientOptions, type Config, type CreateClientConfig, type Options, type OptionsLegacyParser, type QuerySerializerOptions, type RequestOptions, type RequestResult, type TDataShape, createClient, createConfig, formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer }; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.d.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.d.ts deleted file mode 100644 index ec7b7c7c0..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/client/index.d.ts +++ /dev/null @@ -1,231 +0,0 @@ -type AuthToken = string | undefined; -interface Auth { - /** - * Which part of the request do we use to send the auth? - * - * @default 'header' - */ - in?: 'header' | 'query' | 'cookie'; - /** - * Header or query parameter name. - * - * @default 'Authorization' - */ - name?: string; - scheme?: 'basic' | 'bearer'; - type: 'apiKey' | 'http'; -} -interface SerializerOptions { - /** - * @default true - */ - explode: boolean; - style: T; -} -type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; -type ObjectStyle = 'form' | 'deepObject'; - -type QuerySerializer = (query: Record) => string; -type BodySerializer = (body: any) => any; -interface QuerySerializerOptions { - allowReserved?: boolean; - array?: SerializerOptions; - object?: SerializerOptions; -} -declare const formDataBodySerializer: { - bodySerializer: | Array>>(body: T) => FormData; -}; -declare const jsonBodySerializer: { - bodySerializer: (body: T) => string; -}; -declare const urlSearchParamsBodySerializer: { - bodySerializer: | Array>>(body: T) => string; -}; - -interface Client$1 { - /** - * Returns the final request URL. - */ - buildUrl: BuildUrlFn; - connect: MethodFn; - delete: MethodFn; - get: MethodFn; - getConfig: () => Config; - head: MethodFn; - options: MethodFn; - patch: MethodFn; - post: MethodFn; - put: MethodFn; - request: RequestFn; - setConfig: (config: Config) => Config; - trace: MethodFn; -} -interface Config$1 { - /** - * Auth token or a function returning auth token. The resolved value will be - * added to the request payload as defined by its `security` array. - */ - auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; - /** - * A function for serializing request body parameter. By default, - * {@link JSON.stringify()} will be used. - */ - bodySerializer?: BodySerializer | null; - /** - * An object containing any HTTP headers that you want to pre-populate your - * `Headers` object with. - * - * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} - */ - headers?: RequestInit['headers'] | Record; - /** - * The request method. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} - */ - method?: 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE'; - /** - * A function for serializing request query parameters. By default, arrays - * will be exploded in form style, objects will be exploded in deepObject - * style, and reserved characters are percent-encoded. - * - * This method will have no effect if the native `paramsSerializer()` Axios - * API function is used. - * - * {@link https://swagger.io/docs/specification/serialization/#query View examples} - */ - querySerializer?: QuerySerializer | QuerySerializerOptions; - /** - * A function transforming response data before it's returned. This is useful - * for post-processing data, e.g. converting ISO strings into Date objects. - */ - responseTransformer?: (data: unknown) => Promise; - /** - * A function validating response data. This is useful if you want to ensure - * the response conforms to the desired shape, so it can be safely passed to - * the transformers and returned to the user. - */ - responseValidator?: (data: unknown) => Promise; -} - -type ErrInterceptor = (error: Err, response: Res, request: Req, options: Options) => Err | Promise; -type ReqInterceptor = (request: Req, options: Options) => Req | Promise; -type ResInterceptor = (response: Res, request: Req, options: Options) => Res | Promise; -declare class Interceptors { - _fns: Interceptor[]; - constructor(); - clear(): void; - exists(fn: Interceptor): boolean; - eject(fn: Interceptor): void; - use(fn: Interceptor): void; -} -interface Middleware { - error: Pick>, 'eject' | 'use'>; - request: Pick>, 'eject' | 'use'>; - response: Pick>, 'eject' | 'use'>; -} -declare const createConfig: (override?: Config & T>) => Config & T>; - -interface Config extends Omit, Config$1 { - /** - * Base URL for all requests made by this client. - */ - baseUrl?: T['baseUrl']; - /** - * Fetch API implementation. You can use this option to provide a custom - * fetch instance. - * - * @default globalThis.fetch - */ - fetch?: (request: Request) => ReturnType; - /** - * Return the response data parsed in a specified format. By default, `auto` - * will infer the appropriate method from the `Content-Type` response header. - * You can override this behavior with any of the {@link Body} methods. - * Select `stream` if you don't want to parse response data at all. - * - * @default 'auto' - */ - parseAs?: Exclude | 'auto' | 'stream'; - /** - * Throw an error instead of returning it in the response? - * - * @default false - */ - throwOnError?: T['throwOnError']; -} -interface RequestOptions extends Config<{ - throwOnError: ThrowOnError; -}> { - /** - * Any body that you want to add to your request. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} - */ - body?: unknown; - path?: Record; - query?: Record; - /** - * Security mechanism(s) to use for the request. - */ - security?: ReadonlyArray; - url: Url; -} -type RequestResult = ThrowOnError extends true ? Promise<{ - data: TData; - request: Request; - response: Response; -}> : Promise<({ - data: TData; - error: undefined; -} | { - data: undefined; - error: TError; -}) & { - request: Request; - response: Response; -}>; -interface ClientOptions { - baseUrl?: string; - throwOnError?: boolean; -} -type MethodFn = (options: Omit, 'method'>) => RequestResult; -type RequestFn = (options: Omit, 'method'> & Pick>, 'method'>) => RequestResult; -type BuildUrlFn = ; - query?: Record; - url: string; -}>(options: Pick & Options) => string; -type Client = Client$1 & { - interceptors: Middleware; -}; -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -type CreateClientConfig = (override?: Config) => Config & T>; -interface TDataShape { - body?: unknown; - headers?: unknown; - path?: unknown; - query?: unknown; - url: string; -} -type OmitKeys = Pick>; -type Options = OmitKeys, 'body' | 'path' | 'query' | 'url'> & Omit; -type OptionsLegacyParser = TData extends { - body?: any; -} ? TData extends { - headers?: any; -} ? OmitKeys, 'body' | 'headers' | 'url'> & TData : OmitKeys, 'body' | 'url'> & TData & Pick, 'headers'> : TData extends { - headers?: any; -} ? OmitKeys, 'headers' | 'url'> & TData & Pick, 'body'> : OmitKeys, 'url'> & TData; - -declare const createClient: (config?: Config) => Client; - -export { type Auth, type Client, type ClientOptions, type Config, type CreateClientConfig, type Options, type OptionsLegacyParser, type QuerySerializerOptions, type RequestOptions, type RequestResult, type TDataShape, createClient, createConfig, formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer }; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/sdk.gen.ts deleted file mode 100644 index 5cc6beedc..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from './client'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/bundle/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/client.gen.ts deleted file mode 100644 index c72285a7e..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-custom'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/sdk.gen.ts deleted file mode 100644 index 29335ac4c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-custom'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/default/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/client.gen.ts deleted file mode 100644 index c72285a7e..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-custom'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/sdk.gen.ts deleted file mode 100644 index 29335ac4c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-custom'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-optional/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/client.gen.ts deleted file mode 100644 index c72285a7e..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-custom'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/sdk.gen.ts deleted file mode 100644 index 9b020d8b5..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/sdk.gen.ts +++ /dev/null @@ -1,408 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-custom'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options: Options) => { - return options.client.patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options: Options) => { - return options.client.delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options: Options) => { - return options.client.head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options: Options) => { - return options.client.options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options: Options) => { - return options.client.patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return options.client.delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options: Options) => { - return options.client.post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options: Options) => { - return options.client.delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return options.client.post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options: Options) => { - return options.client.post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return options.client.put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/client-custom/sdk-client-required/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/client.gen.ts deleted file mode 100644 index efa58fa3d..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '../../../../../custom/client'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-false/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/client.gen.ts deleted file mode 100644 index 2dae0db79..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '../../../../../custom/client'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-number/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/client.gen.ts deleted file mode 100644 index 2dae0db79..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '../../../../../custom/client'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/types.gen.ts deleted file mode 100644 index c3e87ddf4..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-strict/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base'; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/client.gen.ts deleted file mode 100644 index 41a499e41..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '../../../../../custom/client'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'https://foo.com' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/base-url-string/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client.gen.ts deleted file mode 100644 index 14f2d878c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/client.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/client.ts deleted file mode 100644 index 79e997eb7..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/client.ts +++ /dev/null @@ -1,167 +0,0 @@ -import type { Client, Config, RequestOptions } from './types'; -import { - buildUrl, - createConfig, - createInterceptors, - getParseAs, - mergeConfigs, - mergeHeaders, - setAuthParams, -} from './utils'; - -type ReqInit = Omit & { - body?: any; - headers: ReturnType; -}; - -export const createClient = (config: Config = {}): Client => { - let _config = mergeConfigs(createConfig(), config); - - const getConfig = (): Config => ({ ..._config }); - - const setConfig = (config: Config): Config => { - _config = mergeConfigs(_config, config); - return getConfig(); - }; - - const interceptors = createInterceptors< - Request, - Response, - unknown, - RequestOptions - >(); - - // @ts-expect-error - const request: Client['request'] = async (options) => { - const opts = { - ..._config, - ...options, - fetch: options.fetch ?? _config.fetch ?? globalThis.fetch, - headers: mergeHeaders(_config.headers, options.headers), - }; - - if (opts.security) { - await setAuthParams({ - ...opts, - security: opts.security, - }); - } - - if (opts.body && opts.bodySerializer) { - opts.body = opts.bodySerializer(opts.body); - } - - // remove Content-Type header if body is empty to avoid sending invalid requests - if (opts.body === undefined || opts.body === '') { - opts.headers.delete('Content-Type'); - } - - const url = buildUrl(opts); - const requestInit: ReqInit = { - redirect: 'follow', - ...opts, - }; - - let request = new Request(url, requestInit); - - for (const fn of interceptors.request._fns) { - request = await fn(request, opts); - } - - // fetch must be assigned here, otherwise it would throw the error: - // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation - const _fetch = opts.fetch!; - let response = await _fetch(request); - - for (const fn of interceptors.response._fns) { - response = await fn(response, request, opts); - } - - const result = { - request, - response, - }; - - if (response.ok) { - if ( - response.status === 204 || - response.headers.get('Content-Length') === '0' - ) { - return { - data: {}, - ...result, - }; - } - - const parseAs = - (opts.parseAs === 'auto' - ? getParseAs(response.headers.get('Content-Type')) - : opts.parseAs) ?? 'json'; - - if (parseAs === 'stream') { - return { - data: response.body, - ...result, - }; - } - - let data = await response[parseAs](); - if (parseAs === 'json') { - if (opts.responseValidator) { - await opts.responseValidator(data); - } - - if (opts.responseTransformer) { - data = await opts.responseTransformer(data); - } - } - - return { - data, - ...result, - }; - } - - let error = await response.text(); - - try { - error = JSON.parse(error); - } catch { - // noop - } - - let finalError = error; - - for (const fn of interceptors.error._fns) { - finalError = (await fn(error, response, request, opts)) as string; - } - - finalError = finalError || ({} as string); - - if (opts.throwOnError) { - throw finalError; - } - - return { - error: finalError, - ...result, - }; - }; - - return { - buildUrl, - connect: (options) => request({ ...options, method: 'CONNECT' }), - delete: (options) => request({ ...options, method: 'DELETE' }), - get: (options) => request({ ...options, method: 'GET' }), - getConfig, - head: (options) => request({ ...options, method: 'HEAD' }), - interceptors, - options: (options) => request({ ...options, method: 'OPTIONS' }), - patch: (options) => request({ ...options, method: 'PATCH' }), - post: (options) => request({ ...options, method: 'POST' }), - put: (options) => request({ ...options, method: 'PUT' }), - request, - setConfig, - trace: (options) => request({ ...options, method: 'TRACE' }), - }; -}; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/index.ts deleted file mode 100644 index d871b459b..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -export { createClient } from './client'; -export type { - Client, - ClientOptions, - Config, - CreateClientConfig, - Options, - OptionsLegacyParser, - RequestOptions, - RequestResult, - TDataShape, -} from './types'; -export { createConfig } from './utils'; -export type { Auth, QuerySerializerOptions } from '@hey-api/client-core'; -export { - formDataBodySerializer, - jsonBodySerializer, - urlSearchParamsBodySerializer, -} from '@hey-api/client-core'; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/plugin.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/plugin.ts deleted file mode 100644 index 87823d645..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/plugin.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { - type Client, - clientDefaultConfig, - clientPluginHandler, - type Plugin, -} from '@hey-api/openapi-ts'; - -export interface Config extends Client.Config { - /** - * Plugin name. Must be unique. - */ - name: string; -} - -export const defaultConfig: Plugin.Config = { - ...clientDefaultConfig, - _handler: clientPluginHandler, - _handlerLegacy: () => {}, - name: __filename, -}; - -/** - * Type helper for `my-client` plugin, returns {@link Plugin.Config} object - */ -export const myClientPlugin: Plugin.DefineConfig = (config) => ({ - ...defaultConfig, - ...config, -}); diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/types.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/types.ts deleted file mode 100644 index ae688bcf2..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/types.ts +++ /dev/null @@ -1,159 +0,0 @@ -import type { - Auth, - Client as CoreClient, - Config as CoreConfig, -} from '@hey-api/client-core'; - -import type { Middleware } from './utils'; - -export interface Config - extends Omit, - CoreConfig { - /** - * Base URL for all requests made by this client. - */ - baseUrl?: T['baseUrl']; - /** - * Fetch API implementation. You can use this option to provide a custom - * fetch instance. - * - * @default globalThis.fetch - */ - fetch?: (request: Request) => ReturnType; - /** - * Return the response data parsed in a specified format. By default, `auto` - * will infer the appropriate method from the `Content-Type` response header. - * You can override this behavior with any of the {@link Body} methods. - * Select `stream` if you don't want to parse response data at all. - * - * @default 'auto' - */ - parseAs?: Exclude | 'auto' | 'stream'; - /** - * Throw an error instead of returning it in the response? - * - * @default false - */ - throwOnError?: T['throwOnError']; -} - -export interface RequestOptions< - ThrowOnError extends boolean = boolean, - Url extends string = string, -> extends Config<{ - throwOnError: ThrowOnError; - }> { - /** - * Any body that you want to add to your request. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} - */ - body?: unknown; - path?: Record; - query?: Record; - /** - * Security mechanism(s) to use for the request. - */ - security?: ReadonlyArray; - url: Url; -} - -export type RequestResult< - TData = unknown, - TError = unknown, - ThrowOnError extends boolean = boolean, -> = ThrowOnError extends true - ? Promise<{ - data: TData; - request: Request; - response: Response; - }> - : Promise< - ( - | { data: TData; error: undefined } - | { data: undefined; error: TError } - ) & { - request: Request; - response: Response; - } - >; - -export interface ClientOptions { - baseUrl?: string; - throwOnError?: boolean; -} - -type MethodFn = < - TData = unknown, - TError = unknown, - ThrowOnError extends boolean = false, ->( - options: Omit, 'method'>, -) => RequestResult; - -type RequestFn = < - TData = unknown, - TError = unknown, - ThrowOnError extends boolean = false, ->( - options: Omit, 'method'> & - Pick>, 'method'>, -) => RequestResult; - -type BuildUrlFn = < - TData extends { - body?: unknown; - path?: Record; - query?: Record; - url: string; - }, ->( - options: Pick & Options, -) => string; - -export type Client = CoreClient & { - interceptors: Middleware; -}; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = ( - override?: Config, -) => Config & T>; - -export interface TDataShape { - body?: unknown; - headers?: unknown; - path?: unknown; - query?: unknown; - url: string; -} - -type OmitKeys = Pick>; - -export type Options< - TData extends TDataShape = TDataShape, - ThrowOnError extends boolean = boolean, -> = OmitKeys, 'body' | 'path' | 'query' | 'url'> & - Omit; - -export type OptionsLegacyParser< - TData = unknown, - ThrowOnError extends boolean = boolean, -> = TData extends { body?: any } - ? TData extends { headers?: any } - ? OmitKeys, 'body' | 'headers' | 'url'> & TData - : OmitKeys, 'body' | 'url'> & - TData & - Pick, 'headers'> - : TData extends { headers?: any } - ? OmitKeys, 'headers' | 'url'> & - TData & - Pick, 'body'> - : OmitKeys, 'url'> & TData; diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/utils.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/utils.ts deleted file mode 100644 index eb145e4d0..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/client/utils.ts +++ /dev/null @@ -1,406 +0,0 @@ -import type { - QuerySerializer, - QuerySerializerOptions, -} from '@hey-api/client-core'; -import { - getAuthToken, - jsonBodySerializer, - serializeArrayParam, - serializeObjectParam, - serializePrimitiveParam, -} from '@hey-api/client-core'; - -import type { Client, ClientOptions, Config, RequestOptions } from './types'; - -interface PathSerializer { - path: Record; - url: string; -} - -const PATH_PARAM_RE = /\{[^{}]+\}/g; - -type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; -type MatrixStyle = 'label' | 'matrix' | 'simple'; -type ArraySeparatorStyle = ArrayStyle | MatrixStyle; - -const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => { - let url = _url; - const matches = _url.match(PATH_PARAM_RE); - if (matches) { - for (const match of matches) { - let explode = false; - let name = match.substring(1, match.length - 1); - let style: ArraySeparatorStyle = 'simple'; - - if (name.endsWith('*')) { - explode = true; - name = name.substring(0, name.length - 1); - } - - if (name.startsWith('.')) { - name = name.substring(1); - style = 'label'; - } else if (name.startsWith(';')) { - name = name.substring(1); - style = 'matrix'; - } - - const value = path[name]; - - if (value === undefined || value === null) { - continue; - } - - if (Array.isArray(value)) { - url = url.replace( - match, - serializeArrayParam({ explode, name, style, value }), - ); - continue; - } - - if (typeof value === 'object') { - url = url.replace( - match, - serializeObjectParam({ - explode, - name, - style, - value: value as Record, - }), - ); - continue; - } - - if (style === 'matrix') { - url = url.replace( - match, - `;${serializePrimitiveParam({ - name, - value: value as string, - })}`, - ); - continue; - } - - const replaceValue = encodeURIComponent( - style === 'label' ? `.${value as string}` : (value as string), - ); - url = url.replace(match, replaceValue); - } - } - return url; -}; - -export const createQuerySerializer = ({ - allowReserved, - array, - object, -}: QuerySerializerOptions = {}) => { - const querySerializer = (queryParams: T) => { - let search: string[] = []; - if (queryParams && typeof queryParams === 'object') { - for (const name in queryParams) { - const value = queryParams[name]; - - if (value === undefined || value === null) { - continue; - } - - if (Array.isArray(value)) { - search = [ - ...search, - serializeArrayParam({ - allowReserved, - explode: true, - name, - style: 'form', - value, - ...array, - }), - ]; - continue; - } - - if (typeof value === 'object') { - search = [ - ...search, - serializeObjectParam({ - allowReserved, - explode: true, - name, - style: 'deepObject', - value: value as Record, - ...object, - }), - ]; - continue; - } - - search = [ - ...search, - serializePrimitiveParam({ - allowReserved, - name, - value: value as string, - }), - ]; - } - } - return search.join('&'); - }; - return querySerializer; -}; - -/** - * Infers parseAs value from provided Content-Type header. - */ -export const getParseAs = ( - contentType: string | null, -): Exclude => { - if (!contentType) { - // If no Content-Type header is provided, the best we can do is return the raw response body, - // which is effectively the same as the 'stream' option. - return 'stream'; - } - - const cleanContent = contentType.split(';')[0]?.trim(); - - if (!cleanContent) { - return; - } - - if ( - cleanContent.startsWith('application/json') || - cleanContent.endsWith('+json') - ) { - return 'json'; - } - - if (cleanContent === 'multipart/form-data') { - return 'formData'; - } - - if ( - ['application/', 'audio/', 'image/', 'video/'].some((type) => - cleanContent.startsWith(type), - ) - ) { - return 'blob'; - } - - if (cleanContent.startsWith('text/')) { - return 'text'; - } -}; - -export const setAuthParams = async ({ - security, - ...options -}: Pick, 'security'> & - Pick & { - headers: Headers; - }) => { - for (const auth of security) { - const token = await getAuthToken(auth, options.auth); - - if (!token) { - continue; - } - - const name = auth.name ?? 'Authorization'; - - switch (auth.in) { - case 'query': - if (!options.query) { - options.query = {}; - } - options.query[name] = token; - break; - case 'cookie': - options.headers.append('Cookie', `${name}=${token}`); - break; - case 'header': - default: - options.headers.set(name, token); - break; - } - - return; - } -}; - -export const buildUrl: Client['buildUrl'] = (options) => { - const url = getUrl({ - baseUrl: options.baseUrl as string, - path: options.path, - query: options.query, - querySerializer: - typeof options.querySerializer === 'function' - ? options.querySerializer - : createQuerySerializer(options.querySerializer), - url: options.url, - }); - return url; -}; - -export const getUrl = ({ - baseUrl, - path, - query, - querySerializer, - url: _url, -}: { - baseUrl?: string; - path?: Record; - query?: Record; - querySerializer: QuerySerializer; - url: string; -}) => { - const pathUrl = _url.startsWith('/') ? _url : `/${_url}`; - let url = (baseUrl ?? '') + pathUrl; - if (path) { - url = defaultPathSerializer({ path, url }); - } - let search = query ? querySerializer(query) : ''; - if (search.startsWith('?')) { - search = search.substring(1); - } - if (search) { - url += `?${search}`; - } - return url; -}; - -export const mergeConfigs = (a: Config, b: Config): Config => { - const config = { ...a, ...b }; - if (config.baseUrl?.endsWith('/')) { - config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1); - } - config.headers = mergeHeaders(a.headers, b.headers); - return config; -}; - -export const mergeHeaders = ( - ...headers: Array['headers'] | undefined> -): Headers => { - const mergedHeaders = new Headers(); - for (const header of headers) { - if (!header || typeof header !== 'object') { - continue; - } - - const iterator = - header instanceof Headers ? header.entries() : Object.entries(header); - - for (const [key, value] of iterator) { - if (value === null) { - mergedHeaders.delete(key); - } else if (Array.isArray(value)) { - for (const v of value) { - mergedHeaders.append(key, v as string); - } - } else if (value !== undefined) { - // assume object headers are meant to be JSON stringified, i.e. their - // content value in OpenAPI specification is 'application/json' - mergedHeaders.set( - key, - typeof value === 'object' ? JSON.stringify(value) : (value as string), - ); - } - } - } - return mergedHeaders; -}; - -type ErrInterceptor = ( - error: Err, - response: Res, - request: Req, - options: Options, -) => Err | Promise; - -type ReqInterceptor = ( - request: Req, - options: Options, -) => Req | Promise; - -type ResInterceptor = ( - response: Res, - request: Req, - options: Options, -) => Res | Promise; - -class Interceptors { - _fns: Interceptor[]; - - constructor() { - this._fns = []; - } - - clear() { - this._fns = []; - } - - exists(fn: Interceptor) { - return this._fns.indexOf(fn) !== -1; - } - - eject(fn: Interceptor) { - const index = this._fns.indexOf(fn); - if (index !== -1) { - this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; - } - } - - use(fn: Interceptor) { - this._fns = [...this._fns, fn]; - } -} - -// `createInterceptors()` response, meant for external use as it does not -// expose internals -export interface Middleware { - error: Pick< - Interceptors>, - 'eject' | 'use' - >; - request: Pick>, 'eject' | 'use'>; - response: Pick< - Interceptors>, - 'eject' | 'use' - >; -} - -// do not add `Middleware` as return type so we can use _fns internally -export const createInterceptors = () => ({ - error: new Interceptors>(), - request: new Interceptors>(), - response: new Interceptors>(), -}); - -const defaultQuerySerializer = createQuerySerializer({ - allowReserved: false, - array: { - explode: true, - style: 'form', - }, - object: { - explode: true, - style: 'deepObject', - }, -}); - -const defaultHeaders = { - 'Content-Type': 'application/json', -}; - -export const createConfig = ( - override: Config & T> = {}, -): Config & T> => ({ - ...jsonBodySerializer, - headers: defaultHeaders, - parseAs: 'auto', - querySerializer: defaultQuerySerializer, - ...override, -}); diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/sdk.gen.ts deleted file mode 100644 index 5cc6beedc..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from './client'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/bundle/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/client.gen.ts deleted file mode 100644 index 2dae0db79..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '../../../../../custom/client'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/sdk.gen.ts deleted file mode 100644 index ed8ab824b..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '../../../../../custom/client'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/default/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/client.gen.ts deleted file mode 100644 index 2dae0db79..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '../../../../../custom/client'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/sdk.gen.ts deleted file mode 100644 index ed8ab824b..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '../../../../../custom/client'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-optional/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/client.gen.ts deleted file mode 100644 index 2dae0db79..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '../../../../../custom/client'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/sdk.gen.ts deleted file mode 100644 index 70883547b..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/sdk.gen.ts +++ /dev/null @@ -1,408 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '../../../../../custom/client'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options: Options) => { - return options.client.patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options: Options) => { - return options.client.delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options: Options) => { - return options.client.head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options: Options) => { - return options.client.options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options: Options) => { - return options.client.patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return options.client.delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options: Options) => { - return options.client.post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options: Options) => { - return options.client.delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return options.client.post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options: Options) => { - return options.client.get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options: Options) => { - return options.client.post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return options.client.put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return options.client.post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return options.client.put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/clients/my-client/sdk-client-required/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/components-request-bodies/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/components-request-bodies/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/components-request-bodies/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/components-request-bodies/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/components-request-bodies/types.gen.ts deleted file mode 100644 index 769d4ee8c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/components-request-bodies/types.gen.ts +++ /dev/null @@ -1,29 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Foo - */ -export type Foo = { - page?: number; -}; - -export type PostFooData = { - /** - * Foo - */ - body: Foo; - path?: never; - query?: never; - url: '/foo'; -}; - -export type PostFooResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/const/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/const/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/const/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/const/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/const/types.gen.ts deleted file mode 100644 index cae8a70b3..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/const/types.gen.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: 'First line.\n\nSecond line.\n\nPS: I love you.'; -}; - -export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/content-binary/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/content-binary/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/content-binary/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/content-binary/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/content-binary/types.gen.ts deleted file mode 100644 index e8a09c992..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/content-binary/types.gen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - 200: string; -}; - -export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; - -export type GetBarData = { - body?: never; - path?: never; - query?: never; - url: '/bar'; -}; - -export type GetBarResponses = { - 200: Blob | File; -}; - -export type GetBarResponse = GetBarResponses[keyof GetBarResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-all-of/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-all-of/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-all-of/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-all-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-all-of/types.gen.ts deleted file mode 100644 index d74f66a4a..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-all-of/types.gen.ts +++ /dev/null @@ -1,49 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - id: string; -}; - -export type Bar = Foo & { - id: 'Bar'; -} & { - bar?: string; -}; - -export type Baz = Foo & { - id: 'Baz'; -} & { - baz?: string; -}; - -export type Qux = Foo & { - id: 'Qux'; -} & { - qux?: boolean; -}; - -export type FooMapped = { - id: string; -}; - -export type BarMapped = FooMapped & { - id: 'bar'; -} & { - bar?: string; -}; - -export type BazMapped = FooMapped & { - id: 'baz'; -} & { - baz?: string; -}; - -export type QuxMapped = FooMapped & { - id: 'QuxMapped'; -} & { - qux?: boolean; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-any-of/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-any-of/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-any-of/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-any-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-any-of/types.gen.ts deleted file mode 100644 index cdd9c641f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-any-of/types.gen.ts +++ /dev/null @@ -1,28 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = ({ - type?: 'Bar'; -} & Bar) | ({ - type?: 'Baz'; -} & Baz); - -export type Baz = Qux; - -export type Bar = Qux; - -export type Qux = { - id: string; - type: Quux; -}; - -export type Quux = 'Bar' | 'Baz'; - -export type Quuz = ({ - type?: 'bar'; -} & Bar) | ({ - type?: 'baz'; -} & Baz); - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-mapped-many/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-mapped-many/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-mapped-many/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-mapped-many/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-mapped-many/types.gen.ts deleted file mode 100644 index bbbd8dfa9..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-mapped-many/types.gen.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = ({ - foo?: 'one'; -} & Bar) | ({ - foo?: 'three'; -} & Baz); - -export type Bar = { - foo?: 'one' | 'two'; -}; - -export type Baz = { - foo?: 'three'; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-one-of/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-one-of/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-one-of/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-one-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-one-of/types.gen.ts deleted file mode 100644 index cdd9c641f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/discriminator-one-of/types.gen.ts +++ /dev/null @@ -1,28 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = ({ - type?: 'Bar'; -} & Bar) | ({ - type?: 'Baz'; -} & Baz); - -export type Baz = Qux; - -export type Bar = Qux; - -export type Qux = { - id: string; - type: Quux; -}; - -export type Quux = 'Bar' | 'Baz'; - -export type Quuz = ({ - type?: 'bar'; -} & Bar) | ({ - type?: 'baz'; -} & Baz); - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/duplicate-null/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/duplicate-null/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/duplicate-null/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/duplicate-null/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/duplicate-null/types.gen.ts deleted file mode 100644 index 6c58ee588..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/duplicate-null/types.gen.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * should not produce duplicate null - */ -export type WeirdEnum = '' | string | null; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-escape/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-escape/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-escape/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-escape/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-escape/types.gen.ts deleted file mode 100644 index d3fff794b..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-escape/types.gen.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - foo?: "foo'bar" | 'foo"bar'; -}; - -export type Bar = "foo'bar" | 'foo"bar'; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-javascript/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-javascript/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-javascript/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-javascript/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-javascript/types.gen.ts deleted file mode 100644 index bf1c86991..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-javascript/types.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Type = 'foo' | 'bar'; - -export const Type = { - FOO: 'foo', - BAR: 'bar' -} as const; - -export type Foo = { - type?: 'foo' | 'bar'; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript-namespace/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript-namespace/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript-namespace/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript-namespace/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript-namespace/types.gen.ts deleted file mode 100644 index ef7778bd5..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript-namespace/types.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export namespace Foo { - export enum Type { - FOO = 'foo', - BAR = 'bar' - } -} - -export type Foo = { - type?: 'foo' | 'bar'; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript/types.gen.ts deleted file mode 100644 index 86b67e018..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline-typescript/types.gen.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export enum Type { - FOO = 'foo', - BAR = 'bar' -} - -export type Foo = { - type?: 'foo' | 'bar'; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline/types.gen.ts deleted file mode 100644 index de2459b6b..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-inline/types.gen.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Type = 'foo' | 'bar'; - -export type Foo = { - type?: 'foo' | 'bar'; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-PascalCase/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-PascalCase/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-PascalCase/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-PascalCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-PascalCase/types.gen.ts deleted file mode 100644 index 8c89a55c8..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-PascalCase/types.gen.ts +++ /dev/null @@ -1,48 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _110 = '1-10' | '11-20'; - -export const _110 = { - 110: '1-10', - 1120: '11-20' -} as const; - -export type MyFoo = 'myFoo' | 'myBar'; - -export const MyFoo = { - MyFoo: 'myFoo', - MyBar: 'myBar' -} as const; - -export type MyFoo2 = 'MyFoo' | 'MyBar'; - -export const MyFoo2 = { - MyFoo: 'MyFoo', - MyBar: 'MyBar' -} as const; - -export type Foo = 'foo' | 'bar' | null | '' | true | false; - -export const Foo = { - Foo: 'foo', - Bar: 'bar', - Null: null, - '': '', - True: true, - False: false -} as const; - -export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; - -export const Numbers = { - 100: 100, - 200: 200, - 300: 300, - '-100': -100, - '-200': -200, - '-300': -300 -} as const; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts deleted file mode 100644 index 66f2f4dc0..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts +++ /dev/null @@ -1,48 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _110 = '1-10' | '11-20'; - -export const _110 = { - '1_10': '1-10', - '11_20': '11-20' -} as const; - -export type MyFoo = 'myFoo' | 'myBar'; - -export const MyFoo = { - MY_FOO: 'myFoo', - MY_BAR: 'myBar' -} as const; - -export type MyFoo2 = 'MyFoo' | 'MyBar'; - -export const MyFoo2 = { - MY_FOO: 'MyFoo', - MY_BAR: 'MyBar' -} as const; - -export type Foo = 'foo' | 'bar' | null | '' | true | false; - -export const Foo = { - FOO: 'foo', - BAR: 'bar', - NULL: null, - '': '', - TRUE: true, - FALSE: false -} as const; - -export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; - -export const Numbers = { - 100: 100, - 200: 200, - 300: 300, - '-100': -100, - '-200': -200, - '-300': -300 -} as const; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-camelCase/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-camelCase/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-camelCase/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-camelCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-camelCase/types.gen.ts deleted file mode 100644 index 7f0f85ab5..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-camelCase/types.gen.ts +++ /dev/null @@ -1,48 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _110 = '1-10' | '11-20'; - -export const _110 = { - 110: '1-10', - 1120: '11-20' -} as const; - -export type MyFoo = 'myFoo' | 'myBar'; - -export const MyFoo = { - myFoo: 'myFoo', - myBar: 'myBar' -} as const; - -export type MyFoo2 = 'MyFoo' | 'MyBar'; - -export const MyFoo2 = { - myFoo: 'MyFoo', - myBar: 'MyBar' -} as const; - -export type Foo = 'foo' | 'bar' | null | '' | true | false; - -export const Foo = { - foo: 'foo', - bar: 'bar', - null: null, - '': '', - true: true, - false: false -} as const; - -export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; - -export const Numbers = { - 100: 100, - 200: 200, - 300: 300, - '-100': -100, - '-200': -200, - '-300': -300 -} as const; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-preserve/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-preserve/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-preserve/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-preserve/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-preserve/types.gen.ts deleted file mode 100644 index 2a631eac8..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-preserve/types.gen.ts +++ /dev/null @@ -1,48 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _110 = '1-10' | '11-20'; - -export const _110 = { - '1-10': '1-10', - '11-20': '11-20' -} as const; - -export type MyFoo = 'myFoo' | 'myBar'; - -export const MyFoo = { - myFoo: 'myFoo', - myBar: 'myBar' -} as const; - -export type MyFoo2 = 'MyFoo' | 'MyBar'; - -export const MyFoo2 = { - MyFoo: 'MyFoo', - MyBar: 'MyBar' -} as const; - -export type Foo = 'foo' | 'bar' | null | '' | true | false; - -export const Foo = { - foo: 'foo', - bar: 'bar', - null: null, - '': '', - true: true, - false: false -} as const; - -export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; - -export const Numbers = { - 100: 100, - 200: 200, - 300: 300, - '-100': -100, - '-200': -200, - '-300': -300 -} as const; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-snake_case/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-snake_case/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-snake_case/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-snake_case/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-snake_case/types.gen.ts deleted file mode 100644 index 81146d8df..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-javascript-snake_case/types.gen.ts +++ /dev/null @@ -1,48 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _110 = '1-10' | '11-20'; - -export const _110 = { - '1_10': '1-10', - '11_20': '11-20' -} as const; - -export type MyFoo = 'myFoo' | 'myBar'; - -export const MyFoo = { - my_foo: 'myFoo', - my_bar: 'myBar' -} as const; - -export type MyFoo2 = 'MyFoo' | 'MyBar'; - -export const MyFoo2 = { - my_foo: 'MyFoo', - my_bar: 'MyBar' -} as const; - -export type Foo = 'foo' | 'bar' | null | '' | true | false; - -export const Foo = { - foo: 'foo', - bar: 'bar', - null: null, - '': '', - true: true, - false: false -} as const; - -export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; - -export const Numbers = { - 100: 100, - 200: 200, - 300: 300, - '-100': -100, - '-200': -200, - '-300': -300 -} as const; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-PascalCase/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-PascalCase/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-PascalCase/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-PascalCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-PascalCase/types.gen.ts deleted file mode 100644 index 2f43e6815..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-PascalCase/types.gen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export enum _110 { - _110 = '1-10', - _1120 = '11-20' -} - -export enum MyFoo { - MyFoo = 'myFoo', - MyBar = 'myBar' -} - -export enum MyFoo2 { - MyFoo = 'MyFoo', - MyBar = 'MyBar' -} - -export type Foo = 'foo' | 'bar' | null | '' | true | false; - -export enum Numbers { - _100 = 100, - _200 = 200, - _300 = 300, - '_-100' = -100, - '_-200' = -200, - '_-300' = -300 -} - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts deleted file mode 100644 index 541fd2094..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export enum _110 { - '1_10' = '1-10', - '11_20' = '11-20' -} - -export enum MyFoo { - MY_FOO = 'myFoo', - MY_BAR = 'myBar' -} - -export enum MyFoo2 { - MY_FOO = 'MyFoo', - MY_BAR = 'MyBar' -} - -export type Foo = 'foo' | 'bar' | null | '' | true | false; - -export enum Numbers { - _100 = 100, - _200 = 200, - _300 = 300, - '_-100' = -100, - '_-200' = -200, - '_-300' = -300 -} - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-camelCase/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-camelCase/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-camelCase/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-camelCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-camelCase/types.gen.ts deleted file mode 100644 index 49796afc5..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-camelCase/types.gen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export enum _110 { - _110 = '1-10', - _1120 = '11-20' -} - -export enum MyFoo { - myFoo = 'myFoo', - myBar = 'myBar' -} - -export enum MyFoo2 { - myFoo = 'MyFoo', - myBar = 'MyBar' -} - -export type Foo = 'foo' | 'bar' | null | '' | true | false; - -export enum Numbers { - _100 = 100, - _200 = 200, - _300 = 300, - '_-100' = -100, - '_-200' = -200, - '_-300' = -300 -} - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-preserve/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-preserve/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-preserve/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-preserve/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-preserve/types.gen.ts deleted file mode 100644 index 9ee13c15d..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-preserve/types.gen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export enum _110 { - '1-10' = '1-10', - '11-20' = '11-20' -} - -export enum MyFoo { - myFoo = 'myFoo', - myBar = 'myBar' -} - -export enum MyFoo2 { - MyFoo = 'MyFoo', - MyBar = 'MyBar' -} - -export type Foo = 'foo' | 'bar' | null | '' | true | false; - -export enum Numbers { - _100 = 100, - _200 = 200, - _300 = 300, - '_-100' = -100, - '_-200' = -200, - '_-300' = -300 -} - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-snake_case/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-snake_case/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-snake_case/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-snake_case/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-snake_case/types.gen.ts deleted file mode 100644 index 3a07bbbc6..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values-typescript-snake_case/types.gen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export enum _110 { - '1_10' = '1-10', - '11_20' = '11-20' -} - -export enum MyFoo { - my_foo = 'myFoo', - my_bar = 'myBar' -} - -export enum MyFoo2 { - my_foo = 'MyFoo', - my_bar = 'MyBar' -} - -export type Foo = 'foo' | 'bar' | null | '' | true | false; - -export enum Numbers { - _100 = 100, - _200 = 200, - _300 = 300, - '_-100' = -100, - '_-200' = -200, - '_-300' = -300 -} - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values/types.gen.ts deleted file mode 100644 index 334fc7e35..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-names-values/types.gen.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _110 = '1-10' | '11-20'; - -export type MyFoo = 'myFoo' | 'myBar'; - -export type MyFoo2 = 'MyFoo' | 'MyBar'; - -export type Foo = 'foo' | 'bar' | null | '' | true | false; - -export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-null/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-null/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-null/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-null/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-null/types.gen.ts deleted file mode 100644 index 48d0f83a2..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-null/types.gen.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = 'foo' | 'bar' | null; - -export type Bar = 'foo' | 'bar'; - -export type Baz = 'foo' | 'bar'; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/enum-null/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/enum-null/zod.gen.ts deleted file mode 100644 index ef3e1daa7..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/enum-null/zod.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { z } from 'zod'; - -export const zFoo = z.enum([ - 'foo', - 'bar' -]); - -export const zBar = z.enum([ - 'foo', - 'bar' -]); - -export const zBaz = z.enum([ - 'foo', - 'bar' -]); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/exclude-deprecated/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/exclude-deprecated/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/exclude-deprecated/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/exclude-deprecated/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/exclude-deprecated/types.gen.ts deleted file mode 100644 index f09b2f30d..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/exclude-deprecated/types.gen.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = string; - -export type PostFooData = { - body: Foo; - path?: never; - query?: never; - url: '/foo'; -}; - -export type PostFooResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/@tanstack/react-query.gen.ts deleted file mode 100644 index d2d72e484..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/@tanstack/react-query.gen.ts +++ /dev/null @@ -1,99 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, create } from '../sdk.gen'; -import { queryOptions, type UseMutationOptions, type DefaultError } from '@tanstack/react-query'; -import type { CreateData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const createQueryKey2 = (options?: Options) => createQueryKey('create', options); - -export const createOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await create({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: createQueryKey2(options) - }); -}; - -export const createMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await create({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const createQueryKey2 = (options?: Options) => createQueryKey('create', options); - -export const createOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await create({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: createQueryKey2(options) - }); -}; - -export const createMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await create({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/sdk.gen.ts deleted file mode 100644 index 8f8c0777a..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/sdk.gen.ts +++ /dev/null @@ -1,40 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { CreateData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const create = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/foo', - ...options - }); -}; - -export const create = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/foo', - ...options - }); -}; - -export const create = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/foo', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/types.gen.ts deleted file mode 100644 index 38b0bfb2b..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/internal-name-conflict/types.gen.ts +++ /dev/null @@ -1,47 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type CreateData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type CreateResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type CreateData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type CreateResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type CreateData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type CreateResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-all-of/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-all-of/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-all-of/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-all-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-all-of/types.gen.ts deleted file mode 100644 index 05d02f8ae..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-all-of/types.gen.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - bar: string; -} & { - baz: string; -} & { - foo: string; - bar?: string; - baz?: string; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-any-of/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-any-of/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-any-of/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-any-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-any-of/types.gen.ts deleted file mode 100644 index f50aef2b5..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-any-of/types.gen.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = ({ - bar: string; -} | { - baz: string; -}) & { - foo: string; - bar?: string; - baz?: string; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-one-of/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-one-of/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-one-of/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-one-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-one-of/types.gen.ts deleted file mode 100644 index f50aef2b5..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/object-properties-one-of/types.gen.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = ({ - bar: string; -} | { - baz: string; -}) & { - foo: string; - bar?: string; - baz?: string; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/operation-204/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/operation-204/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/operation-204/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/operation-204/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/operation-204/types.gen.ts deleted file mode 100644 index 0250e75aa..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/operation-204/types.gen.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type PostFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type PostFooResponses = { - /** - * OK - */ - 200: string; - /** - * Created - */ - 204: void; -}; - -export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/@tanstack/react-query.gen.ts deleted file mode 100644 index 3dc6cc795..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/@tanstack/react-query.gen.ts +++ /dev/null @@ -1,123 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, postFoo } from '../sdk.gen'; -import { queryOptions, infiniteQueryOptions, type InfiniteData, type DefaultError, type UseMutationOptions } from '@tanstack/react-query'; -import type { PostFooData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const postFooQueryKey = (options: Options) => createQueryKey('postFoo', options); - -export const postFooOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postFoo({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postFooQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const postFooInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postFoo', options, true); - -export const postFooInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await postFoo({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postFooInfiniteQueryKey(options) - }); -}; - -export const postFooMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/sdk.gen.ts deleted file mode 100644 index 29f6cea10..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/sdk.gen.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { PostFooData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const postFoo = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/foo', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/types.gen.ts deleted file mode 100644 index deb98bc46..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/pagination-ref-any-of/types.gen.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - page?: number | null; -}; - -export type PostFooData = { - body: Foo; - path?: never; - query?: never; - url: '/foo'; -}; - -export type PostFooResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/client.gen.ts deleted file mode 100644 index c4dedd629..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/sdk.gen.ts deleted file mode 100644 index fd567117c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/sdk.gen.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-axios'; -import type { PostFooData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const postFoo = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/foo', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/types.gen.ts deleted file mode 100644 index e1ed1030b..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false-axios/types.gen.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type PostFooData = { - body?: never; - path?: never; - query?: { - foo?: Array; - }; - url: '/foo'; -}; - -export type PostFooResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ClientOptions = { - baseURL: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/sdk.gen.ts deleted file mode 100644 index b34dd5ddb..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/sdk.gen.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { PostFooData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const postFoo = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - querySerializer: { - array: { - explode: false, - style: 'form' - } - }, - url: '/foo', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/types.gen.ts deleted file mode 100644 index d69993ad2..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-explode-false/types.gen.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type PostFooData = { - body?: never; - path?: never; - query?: { - foo?: Array; - }; - url: '/foo'; -}; - -export type PostFooResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-tuple/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-tuple/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-tuple/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-tuple/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/parameter-tuple/types.gen.ts deleted file mode 100644 index a37b6958b..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/parameter-tuple/types.gen.ts +++ /dev/null @@ -1,26 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type PostFooData = { - body?: never; - path?: never; - query?: { - tuple?: [ - number, - number, - number, - number - ]; - }; - url: '/foo'; -}; - -export type PostFooResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/schemas/default/schemas.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/schemas/default/schemas.gen.ts deleted file mode 100644 index 5e7432861..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/schemas/default/schemas.gen.ts +++ /dev/null @@ -1,1981 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export const _400Schema = { - description: 'Model with number-only name', - type: 'string' -} as const; - -export const camelCaseCommentWithBreaksSchema = { - description: `Testing multiline comments in string: First line -Second line - -Fourth line`, - type: 'integer' -} as const; - -export const CommentWithBreaksSchema = { - description: `Testing multiline comments in string: First line -Second line - -Fourth line`, - type: 'integer' -} as const; - -export const CommentWithBackticksSchema = { - description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work', - type: 'integer' -} as const; - -export const CommentWithBackticksAndQuotesSchema = { - description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`, - type: 'integer' -} as const; - -export const CommentWithSlashesSchema = { - description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work', - type: 'integer' -} as const; - -export const CommentWithExpressionPlaceholdersSchema = { - description: 'Testing expression placeholders in string: ${expression} should work', - type: 'integer' -} as const; - -export const CommentWithQuotesSchema = { - description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`, - type: 'integer' -} as const; - -export const CommentWithReservedCharactersSchema = { - description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work', - type: 'integer' -} as const; - -export const SimpleIntegerSchema = { - description: 'This is a simple number', - type: 'integer' -} as const; - -export const SimpleBooleanSchema = { - description: 'This is a simple boolean', - type: 'boolean' -} as const; - -export const SimpleStringSchema = { - description: 'This is a simple string', - type: 'string' -} as const; - -export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = { - description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)', - type: 'string' -} as const; - -export const SimpleFileSchema = { - description: 'This is a simple file', - format: 'binary', - type: 'string' -} as const; - -export const SimpleReferenceSchema = { - description: 'This is a simple reference', - '$ref': '#/components/schemas/ModelWithString' -} as const; - -export const SimpleStringWithPatternSchema = { - description: 'This is a simple string', - maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$', - type: ['string', 'null'] -} as const; - -export const EnumWithStringsSchema = { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串'] -} as const; - -export const EnumWithReplacedCharactersSchema = { - enum: ["'Single Quote'", '"Double Quotes"', 'øæåôöØÆÅÔÖ字符串', 3.1, ''], - type: 'string' -} as const; - -export const EnumWithNumbersSchema = { - description: 'This is a simple enum with numbers', - enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3], - default: 200 -} as const; - -export const EnumFromDescriptionSchema = { - description: 'Success=1,Warning=2,Error=3', - type: 'number' -} as const; - -export const EnumWithExtensionsSchema = { - description: 'This is a simple enum with numbers', - enum: [200, 400, 500], - 'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'], - 'x-enum-descriptions': ['Used when the status of something is successful', 'Used when the status of something has a warning', 'Used when the status of something has an error'] -} as const; - -export const EnumWithXEnumNamesSchema = { - enum: [0, 1, 2], - 'x-enumNames': ['zero', 'one', 'two'] -} as const; - -export const ArrayWithNumbersSchema = { - description: 'This is a simple array with numbers', - type: 'array', - items: { - type: 'integer' - } -} as const; - -export const ArrayWithBooleansSchema = { - description: 'This is a simple array with booleans', - type: 'array', - items: { - type: 'boolean' - } -} as const; - -export const ArrayWithStringsSchema = { - description: 'This is a simple array with strings', - type: 'array', - items: { - type: 'string' - }, - default: ['test'] -} as const; - -export const ArrayWithReferencesSchema = { - description: 'This is a simple array with references', - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithString' - } -} as const; - -export const ArrayWithArraySchema = { - description: 'This is a simple array containing an array', - type: 'array', - items: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithString' - } - } -} as const; - -export const ArrayWithPropertiesSchema = { - description: 'This is a simple array with properties', - type: 'array', - items: { - type: 'object', - properties: { - '16x16': { - '$ref': '#/components/schemas/camelCaseCommentWithBreaks' - }, - bar: { - type: 'string' - } - } - } -} as const; - -export const ArrayWithAnyOfPropertiesSchema = { - description: 'This is a simple array with any of properties', - type: 'array', - items: { - anyOf: [ - { - type: 'object', - properties: { - foo: { - type: 'string', - default: 'test' - } - } - }, - { - type: 'object', - properties: { - bar: { - type: 'string' - } - } - } - ] - } -} as const; - -export const AnyOfAnyAndNullSchema = { - type: 'object', - properties: { - data: { - anyOf: [ - {}, - { - type: 'null' - } - ] - } - } -} as const; - -export const AnyOfArraysSchema = { - description: 'This is a simple array with any of properties', - type: 'object', - properties: { - results: { - items: { - anyOf: [ - { - type: 'object', - properties: { - foo: { - type: 'string' - } - } - }, - { - type: 'object', - properties: { - bar: { - type: 'string' - } - } - } - ] - }, - type: 'array' - } - } -} as const; - -export const DictionaryWithStringSchema = { - description: 'This is a string dictionary', - type: 'object', - additionalProperties: { - type: 'string' - } -} as const; - -export const DictionaryWithPropertiesAndAdditionalPropertiesSchema = { - type: 'object', - properties: { - foo: { - type: 'number' - }, - bar: { - type: 'boolean' - } - }, - additionalProperties: { - type: 'string' - } -} as const; - -export const DictionaryWithReferenceSchema = { - description: 'This is a string reference', - type: 'object', - additionalProperties: { - '$ref': '#/components/schemas/ModelWithString' - } -} as const; - -export const DictionaryWithArraySchema = { - description: 'This is a complex dictionary', - type: 'object', - additionalProperties: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithString' - } - } -} as const; - -export const DictionaryWithDictionarySchema = { - description: 'This is a string dictionary', - type: 'object', - additionalProperties: { - type: 'object', - additionalProperties: { - type: 'string' - } - } -} as const; - -export const DictionaryWithPropertiesSchema = { - description: 'This is a complex dictionary', - type: 'object', - additionalProperties: { - type: 'object', - properties: { - foo: { - type: 'string' - }, - bar: { - type: 'string' - } - } - } -} as const; - -export const ModelWithIntegerSchema = { - description: 'This is a model with one number property', - type: 'object', - properties: { - prop: { - description: 'This is a simple number property', - type: 'integer' - } - } -} as const; - -export const ModelWithBooleanSchema = { - description: 'This is a model with one boolean property', - type: 'object', - properties: { - prop: { - description: 'This is a simple boolean property', - type: 'boolean' - } - } -} as const; - -export const ModelWithStringSchema = { - description: 'This is a model with one string property', - type: 'object', - properties: { - prop: { - description: 'This is a simple string property', - type: 'string' - } - } -} as const; - -export const ModelWithStringErrorSchema = { - description: 'This is a model with one string property', - type: 'object', - properties: { - prop: { - description: 'This is a simple string property', - type: 'string' - } - } -} as const; - -export const Model_From_ZendeskSchema = { - description: `\`Comment\` or \`VoiceComment\`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets)`, - type: 'string' -} as const; - -export const ModelWithNullableStringSchema = { - description: 'This is a model with one string property', - type: 'object', - required: ['nullableRequiredProp1', 'nullableRequiredProp2'], - properties: { - nullableProp1: { - description: 'This is a simple string property', - type: ['string', 'null'] - }, - nullableRequiredProp1: { - description: 'This is a simple string property', - type: ['string', 'null'] - }, - nullableProp2: { - description: 'This is a simple string property', - type: ['string', 'null'] - }, - nullableRequiredProp2: { - description: 'This is a simple string property', - type: ['string', 'null'] - }, - 'foo_bar-enum': { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] - } - } -} as const; - -export const ModelWithEnumSchema = { - description: 'This is a model with one enum', - type: 'object', - properties: { - 'foo_bar-enum': { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] - }, - statusCode: { - description: 'These are the HTTP error code enums', - enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar'] - }, - bool: { - description: 'Simple boolean enum', - type: 'boolean', - enum: [true] - } - } -} as const; - -export const ModelWithEnumWithHyphenSchema = { - description: 'This is a model with one enum with escaped name', - type: 'object', - properties: { - 'foo-bar-baz-qux': { - type: 'string', - enum: ['3.0'], - title: 'Foo-Bar-Baz-Qux', - default: '3.0' - } - } -} as const; - -export const ModelWithEnumFromDescriptionSchema = { - description: 'This is a model with one enum', - type: 'object', - properties: { - test: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' - } - } -} as const; - -export const ModelWithNestedEnumsSchema = { - description: 'This is a model with nested enums', - type: 'object', - properties: { - dictionaryWithEnum: { - type: 'object', - additionalProperties: { - enum: ['Success', 'Warning', 'Error'] - } - }, - dictionaryWithEnumFromDescription: { - type: 'object', - additionalProperties: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' - } - }, - arrayWithEnum: { - type: 'array', - items: { - enum: ['Success', 'Warning', 'Error'] - } - }, - arrayWithDescription: { - type: 'array', - items: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' - } - }, - 'foo_bar-enum': { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] - } - } -} as const; - -export const ModelWithReferenceSchema = { - description: 'This is a model with one property containing a reference', - type: 'object', - properties: { - prop: { - '$ref': '#/components/schemas/ModelWithProperties' - } - } -} as const; - -export const ModelWithArrayReadOnlyAndWriteOnlySchema = { - description: 'This is a model with one property containing an array', - type: 'object', - properties: { - prop: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnly' - } - }, - propWithFile: { - type: 'array', - items: { - format: 'binary', - type: 'string' - } - }, - propWithNumber: { - type: 'array', - items: { - type: 'number' - } - } - } -} as const; - -export const ModelWithArraySchema = { - description: 'This is a model with one property containing an array', - type: 'object', - properties: { - prop: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithString' - } - }, - propWithFile: { - type: 'array', - items: { - format: 'binary', - type: 'string' - } - }, - propWithNumber: { - type: 'array', - items: { - type: 'number' - } - } - } -} as const; - -export const ModelWithDictionarySchema = { - description: 'This is a model with one property containing a dictionary', - type: 'object', - properties: { - prop: { - type: 'object', - additionalProperties: { - type: 'string' - } - } - } -} as const; - -export const DeprecatedModelSchema = { - deprecated: true, - description: 'This is a deprecated model with a deprecated property', - type: 'object', - properties: { - prop: { - deprecated: true, - description: 'This is a deprecated property', - type: 'string' - } - } -} as const; - -export const ModelWithCircularReferenceSchema = { - description: 'This is a model with one property containing a circular reference', - type: 'object', - properties: { - prop: { - '$ref': '#/components/schemas/ModelWithCircularReference' - } - } -} as const; - -export const CompositionWithOneOfSchema = { - description: "This is a model with one property with a 'one of' relationship", - type: 'object', - properties: { - propA: { - type: 'object', - oneOf: [ - { - '$ref': '#/components/schemas/ModelWithString' - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const CompositionWithOneOfAnonymousSchema = { - description: "This is a model with one property with a 'one of' relationship where the options are not $ref", - type: 'object', - properties: { - propA: { - type: 'object', - oneOf: [ - { - description: 'Anonymous object type', - type: 'object', - properties: { - propA: { - type: 'string' - } - } - }, - { - description: 'Anonymous string type', - type: 'string' - }, - { - description: 'Anonymous integer type', - type: 'integer' - } - ] - } - } -} as const; - -export const ModelCircleSchema = { - description: 'Circle', - type: 'object', - required: ['kind'], - properties: { - kind: { - type: 'string' - }, - radius: { - type: 'number' - } - } -} as const; - -export const ModelSquareSchema = { - description: 'Square', - type: 'object', - required: ['kind'], - properties: { - kind: { - type: 'string' - }, - sideLength: { - type: 'number' - } - } -} as const; - -export const CompositionWithOneOfDiscriminatorSchema = { - description: "This is a model with one property with a 'one of' relationship where the options are not $ref", - type: 'object', - oneOf: [ - { - '$ref': '#/components/schemas/ModelCircle' - }, - { - '$ref': '#/components/schemas/ModelSquare' - } - ], - discriminator: { - propertyName: 'kind', - mapping: { - circle: '#/components/schemas/ModelCircle', - square: '#/components/schemas/ModelSquare' - } - } -} as const; - -export const CompositionWithAnyOfSchema = { - description: "This is a model with one property with a 'any of' relationship", - type: 'object', - properties: { - propA: { - type: 'object', - anyOf: [ - { - '$ref': '#/components/schemas/ModelWithString' - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const CompositionWithAnyOfAnonymousSchema = { - description: "This is a model with one property with a 'any of' relationship where the options are not $ref", - type: 'object', - properties: { - propA: { - type: 'object', - anyOf: [ - { - description: 'Anonymous object type', - type: 'object', - properties: { - propA: { - type: 'string' - } - } - }, - { - description: 'Anonymous string type', - type: 'string' - }, - { - description: 'Anonymous integer type', - type: 'integer' - } - ] - } - } -} as const; - -export const CompositionWithNestedAnyAndTypeNullSchema = { - description: "This is a model with nested 'any of' property with a type null", - type: 'object', - properties: { - propA: { - type: 'object', - anyOf: [ - { - items: { - anyOf: [ - { - '$ref': '#/components/schemas/ModelWithDictionary' - }, - { - type: 'null' - } - ] - }, - type: 'array' - }, - { - items: { - anyOf: [ - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - type: 'null' - } - ] - }, - type: 'array' - } - ] - } - } -} as const; - -export const _3e_num_1ПериодSchema = { - enum: ['Bird', 'Dog'], - type: 'string' -} as const; - -export const ConstValueSchema = { - type: 'string', - const: 'ConstValue' -} as const; - -export const CompositionWithNestedAnyOfAndNullSchema = { - description: "This is a model with one property with a 'any of' relationship where the options are not $ref", - type: 'object', - properties: { - propA: { - anyOf: [ - { - items: { - anyOf: [ - { - '$ref': '#/components/schemas/3e-num_1Период' - }, - { - '$ref': '#/components/schemas/ConstValue' - } - ] - }, - type: 'array' - }, - { - type: 'null' - } - ], - title: 'Scopes' - } - } -} as const; - -export const CompositionWithOneOfAndNullableSchema = { - description: "This is a model with one property with a 'one of' relationship", - type: 'object', - properties: { - propA: { - type: ['object', 'null'], - oneOf: [ - { - type: 'object', - properties: { - boolean: { - type: 'boolean' - } - } - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const CompositionWithOneOfAndSimpleDictionarySchema = { - description: 'This is a model that contains a simple dictionary within composition', - type: 'object', - properties: { - propA: { - oneOf: [ - { - type: 'boolean' - }, - { - type: 'object', - additionalProperties: { - type: 'number' - } - } - ] - } - } -} as const; - -export const CompositionWithOneOfAndSimpleArrayDictionarySchema = { - description: 'This is a model that contains a dictionary of simple arrays within composition', - type: 'object', - properties: { - propA: { - oneOf: [ - { - type: 'boolean' - }, - { - type: 'object', - additionalProperties: { - type: 'array', - items: { - type: 'boolean' - } - } - } - ] - } - } -} as const; - -export const CompositionWithOneOfAndComplexArrayDictionarySchema = { - description: 'This is a model that contains a dictionary of complex arrays (composited) within composition', - type: 'object', - properties: { - propA: { - oneOf: [ - { - type: 'boolean' - }, - { - type: 'object', - additionalProperties: { - type: 'array', - items: { - oneOf: [ - { - type: 'number' - }, - { - type: 'string' - } - ] - } - } - } - ] - } - } -} as const; - -export const CompositionWithAllOfAndNullableSchema = { - description: "This is a model with one property with a 'all of' relationship", - type: 'object', - properties: { - propA: { - type: ['object', 'null'], - allOf: [ - { - type: 'object', - properties: { - boolean: { - type: 'boolean' - } - } - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const CompositionWithAnyOfAndNullableSchema = { - description: "This is a model with one property with a 'any of' relationship", - type: 'object', - properties: { - propA: { - type: ['object', 'null'], - anyOf: [ - { - type: 'object', - properties: { - boolean: { - type: 'boolean' - } - } - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const CompositionBaseModelSchema = { - description: 'This is a base model with two simple optional properties', - type: 'object', - properties: { - firstName: { - type: 'string' - }, - lastname: { - type: 'string' - } - } -} as const; - -export const CompositionExtendedModelSchema = { - description: 'This is a model that extends the base model', - type: 'object', - allOf: [ - { - '$ref': '#/components/schemas/CompositionBaseModel' - } - ], - properties: { - age: { - type: 'number' - } - }, - required: ['firstName', 'lastname', 'age'] -} as const; - -export const ModelWithPropertiesSchema = { - description: 'This is a model with one nested property', - type: 'object', - required: ['required', 'requiredAndReadOnly', 'requiredAndNullable'], - properties: { - required: { - type: 'string' - }, - requiredAndReadOnly: { - type: 'string', - readOnly: true - }, - requiredAndNullable: { - type: ['string', 'null'] - }, - string: { - type: 'string' - }, - number: { - type: 'number' - }, - boolean: { - type: 'boolean' - }, - reference: { - '$ref': '#/components/schemas/ModelWithString' - }, - 'property with space': { - type: 'string' - }, - default: { - type: 'string' - }, - try: { - type: 'string' - }, - '@namespace.string': { - type: 'string', - readOnly: true - }, - '@namespace.integer': { - type: 'integer', - readOnly: true - } - } -} as const; - -export const ModelWithNestedPropertiesSchema = { - description: 'This is a model with one nested property', - type: 'object', - required: ['first'], - properties: { - first: { - type: ['object', 'null'], - required: ['second'], - readOnly: true, - properties: { - second: { - type: ['object', 'null'], - required: ['third'], - readOnly: true, - properties: { - third: { - type: ['string', 'null'], - required: true, - readOnly: true - } - } - } - } - } - } -} as const; - -export const ModelWithDuplicatePropertiesSchema = { - description: 'This is a model with duplicated properties', - type: 'object', - properties: { - prop: { - '$ref': '#/components/schemas/ModelWithString' - } - } -} as const; - -export const ModelWithOrderedPropertiesSchema = { - description: 'This is a model with ordered properties', - type: 'object', - properties: { - zebra: { - type: 'string' - }, - apple: { - type: 'string' - }, - hawaii: { - type: 'string' - } - } -} as const; - -export const ModelWithDuplicateImportsSchema = { - description: 'This is a model with duplicated imports', - type: 'object', - properties: { - propA: { - '$ref': '#/components/schemas/ModelWithString' - }, - propB: { - '$ref': '#/components/schemas/ModelWithString' - }, - propC: { - '$ref': '#/components/schemas/ModelWithString' - } - } -} as const; - -export const ModelThatExtendsSchema = { - description: 'This is a model that extends another model', - type: 'object', - allOf: [ - { - '$ref': '#/components/schemas/ModelWithString' - }, - { - type: 'object', - properties: { - propExtendsA: { - type: 'string' - }, - propExtendsB: { - '$ref': '#/components/schemas/ModelWithString' - } - } - } - ] -} as const; - -export const ModelThatExtendsExtendsSchema = { - description: 'This is a model that extends another model', - type: 'object', - allOf: [ - { - '$ref': '#/components/schemas/ModelWithString' - }, - { - '$ref': '#/components/schemas/ModelThatExtends' - }, - { - type: 'object', - properties: { - propExtendsC: { - type: 'string' - }, - propExtendsD: { - '$ref': '#/components/schemas/ModelWithString' - } - } - } - ] -} as const; - -export const ModelWithPatternSchema = { - description: 'This is a model that contains a some patterns', - type: 'object', - required: ['key', 'name'], - properties: { - key: { - maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$', - type: 'string' - }, - name: { - maxLength: 255, - type: 'string' - }, - enabled: { - type: 'boolean', - readOnly: true - }, - modified: { - type: 'string', - format: 'date-time', - readOnly: true - }, - id: { - type: 'string', - pattern: '^\\d{2}-\\d{3}-\\d{4}$' - }, - text: { - type: 'string', - pattern: '^\\w+$' - }, - patternWithSingleQuotes: { - type: 'string', - pattern: "^[a-zA-Z0-9']*$" - }, - patternWithNewline: { - type: 'string', - pattern: 'aaa\\nbbb' - }, - patternWithBacktick: { - type: 'string', - pattern: 'aaa`bbb' - } - } -} as const; - -export const FileSchema = { - required: ['mime'], - type: 'object', - properties: { - id: { - title: 'Id', - type: 'string', - readOnly: true, - minLength: 1 - }, - updated_at: { - title: 'Updated at', - type: 'string', - format: 'date-time', - readOnly: true - }, - created_at: { - title: 'Created at', - type: 'string', - format: 'date-time', - readOnly: true - }, - mime: { - title: 'Mime', - type: 'string', - maxLength: 24, - minLength: 1 - }, - file: { - title: 'File', - type: 'string', - readOnly: true, - format: 'uri' - } - } -} as const; - -export const defaultSchema = { - type: 'object', - properties: { - name: { - type: 'string' - } - } -} as const; - -export const PageableSchema = { - type: 'object', - properties: { - page: { - minimum: 0, - type: 'integer', - format: 'int32', - default: 0 - }, - size: { - minimum: 1, - type: 'integer', - format: 'int32' - }, - sort: { - type: 'array', - items: { - type: 'string' - } - } - } -} as const; - -export const FreeFormObjectWithoutAdditionalPropertiesSchema = { - description: 'This is a free-form object without additionalProperties.', - type: 'object' -} as const; - -export const FreeFormObjectWithAdditionalPropertiesEqTrueSchema = { - description: 'This is a free-form object with additionalProperties: true.', - type: 'object', - additionalProperties: true -} as const; - -export const FreeFormObjectWithAdditionalPropertiesEqEmptyObjectSchema = { - description: 'This is a free-form object with additionalProperties: {}.', - type: 'object', - additionalProperties: {} -} as const; - -export const ModelWithConstSchema = { - type: 'object', - properties: { - String: { - const: 'String' - }, - number: { - const: 0 - }, - null: { - const: null - }, - withType: { - type: 'string', - const: 'Some string' - } - } -} as const; - -export const ModelWithAdditionalPropertiesEqTrueSchema = { - description: 'This is a model with one property and additionalProperties: true', - type: 'object', - properties: { - prop: { - description: 'This is a simple string property', - type: 'string' - } - }, - additionalProperties: true -} as const; - -export const NestedAnyOfArraysNullableSchema = { - properties: { - nullableArray: { - anyOf: [ - { - items: { - anyOf: [ - { - type: 'string' - }, - { - type: 'boolean' - } - ] - }, - type: 'array' - }, - { - type: 'null' - } - ] - } - }, - type: 'object' -} as const; - -export const CompositionWithOneOfAndPropertiesSchema = { - type: 'object', - oneOf: [ - { - type: 'object', - required: ['foo'], - properties: { - foo: { - '$ref': '#/components/parameters/SimpleParameter' - } - }, - additionalProperties: false - }, - { - type: 'object', - required: ['bar'], - properties: { - bar: { - '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' - } - }, - additionalProperties: false - } - ], - required: ['baz', 'qux'], - properties: { - baz: { - type: ['integer', 'null'], - format: 'uint16', - minimum: 0 - }, - qux: { - type: 'integer', - format: 'uint8', - minimum: 0 - } - } -} as const; - -export const NullableObjectSchema = { - type: ['object', 'null'], - description: 'An object that can be null', - properties: { - foo: { - type: 'string' - } - }, - default: null -} as const; - -export const CharactersInDescriptionSchema = { - type: 'string', - description: 'Some % character' -} as const; - -export const ModelWithNullableObjectSchema = { - type: 'object', - properties: { - data: { - '$ref': '#/components/schemas/NullableObject' - } - } -} as const; - -export const ModelWithOneOfEnumSchema = { - oneOf: [ - { - type: 'object', - required: ['foo'], - properties: { - foo: { - type: 'string', - enum: ['Bar'] - } - } - }, - { - type: 'object', - required: ['foo'], - properties: { - foo: { - type: 'string', - enum: ['Baz'] - } - } - }, - { - type: 'object', - required: ['foo'], - properties: { - foo: { - type: 'string', - enum: ['Qux'] - } - } - }, - { - type: 'object', - required: ['content', 'foo'], - properties: { - content: { - type: 'string', - format: 'date-time' - }, - foo: { - type: 'string', - enum: ['Quux'] - } - } - }, - { - type: 'object', - required: ['content', 'foo'], - properties: { - content: { - type: 'array', - prefixItems: [ - { - type: 'string', - format: 'date-time' - }, - { - type: 'string' - } - ], - maxItems: 2, - minItems: 2 - }, - foo: { - type: 'string', - enum: ['Corge'] - } - } - } - ] -} as const; - -export const ModelWithNestedArrayEnumsDataFooSchema = { - enum: ['foo', 'bar'], - type: 'string' -} as const; - -export const ModelWithNestedArrayEnumsDataBarSchema = { - enum: ['baz', 'qux'], - type: 'string' -} as const; - -export const ModelWithNestedArrayEnumsDataSchema = { - type: 'object', - properties: { - foo: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' - } - }, - bar: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataBar' - } - } - } -} as const; - -export const ModelWithNestedArrayEnumsSchema = { - type: 'object', - properties: { - array_strings: { - type: 'array', - items: { - type: 'string' - } - }, - data: { - allOf: [ - { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsData' - } - ] - } - } -} as const; - -export const ModelWithNestedCompositionEnumsSchema = { - type: 'object', - properties: { - foo: { - allOf: [ - { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' - } - ] - } - } -} as const; - -export const ModelWithReadOnlyAndWriteOnlySchema = { - type: 'object', - required: ['foo', 'bar', 'baz'], - properties: { - foo: { - type: 'string' - }, - bar: { - readOnly: true, - type: 'string' - }, - baz: { - type: 'string', - writeOnly: true - } - } -} as const; - -export const ModelWithConstantSizeArraySchema = { - type: 'array', - items: { - type: 'number' - }, - minItems: 2, - maxItems: 2 -} as const; - -export const ModelWithAnyOfConstantSizeArraySchema = { - type: 'array', - items: { - oneOf: [ - { - type: 'number' - }, - { - type: 'string' - } - ] - }, - minItems: 3, - maxItems: 3 -} as const; - -export const ModelWithPrefixItemsConstantSizeArraySchema = { - type: 'array', - prefixItems: [ - { - '$ref': '#/components/schemas/ModelWithInteger' - }, - { - oneOf: [ - { - type: 'number' - }, - { - type: 'string' - } - ] - }, - { - type: 'string' - } - ] -} as const; - -export const ModelWithAnyOfConstantSizeArrayNullableSchema = { - type: ['array'], - items: { - oneOf: [ - { - type: ['number', 'null'] - }, - { - type: 'string' - } - ] - }, - minItems: 3, - maxItems: 3 -} as const; - -export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsSchema = { - type: 'array', - items: { - oneOf: [ - { - type: 'number' - }, - { - '$ref': '#/components/schemas/import' - } - ] - }, - minItems: 2, - maxItems: 2 -} as const; - -export const ModelWithAnyOfConstantSizeArrayAndIntersectSchema = { - type: 'array', - items: { - allOf: [ - { - type: 'number' - }, - { - type: 'string' - } - ] - }, - minItems: 2, - maxItems: 2 -} as const; - -export const ModelWithNumericEnumUnionSchema = { - type: 'object', - properties: { - value: { - type: 'number', - description: 'Период', - enum: [-10, -1, 0, 1, 3, 6, 12] - } - } -} as const; - -export const ModelWithBackticksInDescriptionSchema = { - description: 'Some description with `back ticks`', - type: 'object', - properties: { - template: { - type: 'string', - description: `The template \`that\` should be used for parsing and importing the contents of the CSV file. - -

There is one placeholder currently supported:

  • \${x} - refers to the n-th column in the CSV file, e.g. \${1}, \${2}, ...)

Example of a correct JSON template:

-
-[
-  {
-    "resourceType": "Asset",
-    "identifier": {
-      "name": "\${1}",
-      "domain": {
-        "name": "\${2}",
-        "community": {
-          "name": "Some Community"
-        }
-      }
-    },
-    "attributes" : {
-      "00000000-0000-0000-0000-000000003115" : [ {
-        "value" : "\${3}" 
-      } ],
-      "00000000-0000-0000-0000-000000000222" : [ {
-        "value" : "\${4}"
-      } ]
-    }
-  }
-]
-
` - } - } -} as const; - -export const ModelWithOneOfAndPropertiesSchema = { - type: 'object', - oneOf: [ - { - '$ref': '#/components/parameters/SimpleParameter' - }, - { - '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' - } - ], - required: ['baz', 'qux'], - properties: { - baz: { - type: ['integer', 'null'], - format: 'uint16', - minimum: 0 - }, - qux: { - type: 'integer', - format: 'uint8', - minimum: 0 - } - } -} as const; - -export const ParameterSimpleParameterUnusedSchema = { - description: 'Model used to test deduplication strategy (unused)', - type: 'string' -} as const; - -export const PostServiceWithEmptyTagResponseSchema = { - description: 'Model used to test deduplication strategy', - type: 'string' -} as const; - -export const PostServiceWithEmptyTagResponse2Schema = { - description: 'Model used to test deduplication strategy', - type: 'string' -} as const; - -export const DeleteFooDataSchema = { - description: 'Model used to test deduplication strategy', - type: 'string' -} as const; - -export const DeleteFooData2Schema = { - description: 'Model used to test deduplication strategy', - type: 'string' -} as const; - -export const importSchema = { - description: 'Model with restricted keyword name', - type: 'string' -} as const; - -export const SchemaWithFormRestrictedKeysSchema = { - type: 'object', - properties: { - description: { - type: 'string' - }, - 'x-enum-descriptions': { - type: 'string' - }, - 'x-enum-varnames': { - type: 'string' - }, - 'x-enumNames': { - type: 'string' - }, - title: { - type: 'string' - }, - object: { - type: 'object', - properties: { - description: { - type: 'string' - }, - 'x-enum-descriptions': { - type: 'string' - }, - 'x-enum-varnames': { - type: 'string' - }, - 'x-enumNames': { - type: 'string' - }, - title: { - type: 'string' - } - } - }, - array: { - type: 'array', - items: { - type: 'object', - properties: { - description: { - type: 'string' - }, - 'x-enum-descriptions': { - type: 'string' - }, - 'x-enum-varnames': { - type: 'string' - }, - 'x-enumNames': { - type: 'string' - }, - title: { - type: 'string' - } - } - } - } - } -} as const; - -export const io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptionsSchema = { - description: 'This schema was giving PascalCase transformations a hard time', - properties: { - preconditions: { - allOf: [ - { - '$ref': '#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions' - } - ], - description: 'Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.' - } - }, - type: 'object' -} as const; - -export const io_k8s_apimachinery_pkg_apis_meta_v1_PreconditionsSchema = { - description: 'This schema was giving PascalCase transformations a hard time', - properties: { - resourceVersion: { - description: 'Specifies the target ResourceVersion', - type: 'string' - }, - uid: { - description: 'Specifies the target UID.', - type: 'string' - } - }, - type: 'object' -} as const; - -export const AdditionalPropertiesUnknownIssueSchema = { - type: 'object', - properties: {}, - additionalProperties: { - anyOf: [ - { - type: 'string' - }, - { - type: 'number' - } - ] - } -} as const; - -export const AdditionalPropertiesUnknownIssue2Schema = { - type: 'object', - additionalProperties: { - anyOf: [ - { - type: 'string' - }, - { - type: 'number' - } - ] - } -} as const; - -export const AdditionalPropertiesUnknownIssue3Schema = { - type: 'object', - allOf: [ - { - type: 'string' - }, - { - type: 'object', - required: ['entries'], - properties: { - entries: { - type: 'object', - additionalProperties: { - '$ref': '#/components/schemas/AdditionalPropertiesUnknownIssue' - } - } - } - } - ] -} as const; - -export const AdditionalPropertiesIntegerIssueSchema = { - type: 'object', - required: ['value'], - properties: { - value: { - type: 'integer' - } - }, - additionalProperties: { - type: 'integer' - } -} as const; - -export const OneOfAllOfIssueSchema = { - oneOf: [ - { - allOf: [ - { - oneOf: [ - { - '$ref': '#/components/schemas/ConstValue' - }, - { - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]' - } - ] - }, - { - '$ref': '#/components/schemas/3e-num_1Период' - } - ] - }, - { - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]' - } - ] -} as const; - -export const Generic_Schema_Duplicate_Issue_1_System_Boolean_Schema = { - type: 'object', - properties: { - item: { - type: 'boolean' - }, - error: { - type: ['string', 'null'] - }, - hasError: { - type: 'boolean', - readOnly: true - }, - data: { - type: 'object', - properties: {}, - additionalProperties: false - } - }, - additionalProperties: false -} as const; - -export const Generic_Schema_Duplicate_Issue_1_System_String_Schema = { - type: 'object', - properties: { - item: { - type: ['string', 'null'] - }, - error: { - type: ['string', 'null'] - }, - hasError: { - type: 'boolean', - readOnly: true - } - }, - additionalProperties: false -} as const; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/sdk.gen.ts deleted file mode 100644 index 7f932711f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/default/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts deleted file mode 100644 index caa002cde..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base', - throwOnError: true -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts deleted file mode 100644 index 4300b2379..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts deleted file mode 100644 index b3e776847..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { PostFooData, PostFooResponse } from './types.gen'; -import { postFooResponseTransformer } from './transformers.gen'; -import { zPostFooResponse } from './zod.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const postFoo = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - responseTransformer: postFooResponseTransformer, - responseValidator: async (data) => { - return await zPostFooResponse.parseAsync(data); - }, - url: '/foo', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts deleted file mode 100644 index 419690a91..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { PostFooResponse } from './types.gen'; - -const fooSchemaResponseTransformer = (data: any) => { - data.foo = BigInt(data.foo.toString()); - return data; -}; - -export const postFooResponseTransformer = async (data: any): Promise => { - data = fooSchemaResponseTransformer(data); - return data; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/types.gen.ts deleted file mode 100644 index a796d8382..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/types.gen.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - bar?: number; - foo: bigint; - id: string; -}; - -export type Bar = { - foo: number; - [key: string]: number; -}; - -export type PostFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type PostFooResponses = { - /** - * OK - */ - 200: Foo; -}; - -export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/zod.gen.ts deleted file mode 100644 index 328fe6811..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/transformers/type-format/zod.gen.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { z } from 'zod'; - -export const zFoo = z.object({ - bar: z.number().int().optional(), - foo: z.coerce.bigint(), - id: z.string() -}); - -export const zBar = z.object({ - foo: z.number().int() -}); - -export const zPostFooResponse = zFoo; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts deleted file mode 100644 index ed1facdfd..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts +++ /dev/null @@ -1,95 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type ReadableFooReadWrite = ReadableBarRead; - -export type WritableFooReadWrite = WritableBarRead & { - foo?: string; -}; - -export type ReadableFooRead = ReadableBarRead & { - readonly foo?: string; -}; - -export type WritableFooRead = WritableBarRead; - -export type ReadableFooWrite = ReadableBarWrite; - -export type WritableFooWrite = WritableBarWrite & { - foo?: string; -}; - -export type ReadableBarRead = Baz | ReadableQuxAllWrite | ReadableQuxAllRead | { - readonly bar?: string; -}; - -export type WritableBarRead = Baz | WritableQuxAllWrite | WritableQuxAllRead; - -export type ReadableBarWrite = Baz | ReadableQuxAllWrite | ReadableQuxAllRead; - -export type WritableBarWrite = Baz | WritableQuxAllWrite | WritableQuxAllRead | { - bar?: string; -}; - -export type Baz = { - baz?: string; -}; - -export type WritableQuxAllWrite = { - baz?: string; -}; - -export type ReadableQuxAllRead = { - readonly baz?: string; -}; - -export type PostFooReadWriteData = { - body: WritableFooReadWrite; - path?: never; - query?: never; - url: '/foo-read-write'; -}; - -export type PostFooReadWriteResponses = { - /** - * OK - */ - 200: ReadableFooReadWrite; -}; - -export type PostFooReadWriteResponse = PostFooReadWriteResponses[keyof PostFooReadWriteResponses]; - -export type PostFooReadData = { - body: WritableFooRead; - path?: never; - query?: never; - url: '/foo-read'; -}; - -export type PostFooReadResponses = { - /** - * OK - */ - 200: ReadableFooRead; -}; - -export type PostFooReadResponse = PostFooReadResponses[keyof PostFooReadResponses]; - -export type PostFooWriteData = { - body: WritableFooWrite; - path?: never; - query?: never; - url: '/foo-write'; -}; - -export type PostFooWriteResponses = { - /** - * OK - */ - 200: ReadableFooWrite; -}; - -export type PostFooWriteResponse = PostFooWriteResponses[keyof PostFooWriteResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts deleted file mode 100644 index eefb71005..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts +++ /dev/null @@ -1,85 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type FooReadWrite = BarRead & { - foo?: string; -}; - -export type FooRead = BarRead & { - readonly foo?: string; -}; - -export type FooWrite = BarWrite & { - foo?: string; -}; - -export type BarRead = Baz | QuxAllWrite | QuxAllRead | { - readonly bar?: string; -}; - -export type BarWrite = Baz | QuxAllWrite | QuxAllRead | { - bar?: string; -}; - -export type Baz = { - baz?: string; -}; - -export type QuxAllWrite = { - baz?: string; -}; - -export type QuxAllRead = { - readonly baz?: string; -}; - -export type PostFooReadWriteData = { - body: FooReadWrite; - path?: never; - query?: never; - url: '/foo-read-write'; -}; - -export type PostFooReadWriteResponses = { - /** - * OK - */ - 200: FooReadWrite; -}; - -export type PostFooReadWriteResponse = PostFooReadWriteResponses[keyof PostFooReadWriteResponses]; - -export type PostFooReadData = { - body: FooRead; - path?: never; - query?: never; - url: '/foo-read'; -}; - -export type PostFooReadResponses = { - /** - * OK - */ - 200: FooRead; -}; - -export type PostFooReadResponse = PostFooReadResponses[keyof PostFooReadResponses]; - -export type PostFooWriteData = { - body: FooWrite; - path?: never; - query?: never; - url: '/foo-write'; -}; - -export type PostFooWriteResponses = { - /** - * OK - */ - 200: FooWrite; -}; - -export type PostFooWriteResponse = PostFooWriteResponses[keyof PostFooWriteResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts deleted file mode 100644 index 33e101093..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts +++ /dev/null @@ -1,1128 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, DefaultService, SimpleService, ParametersService, DescriptionsService, DeprecatedService, RequestBodyService, FormDataService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, UploadService, FileResponseService, ComplexService, MultipartService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/angular-query-experimental'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.export({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.import({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.import({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DeprecatedService.deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DeprecatedService.deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await FormDataService.postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await FormDataService.postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NoContentService.callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await CollectionFormatService.collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await TypesService.types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await UploadService.uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await UploadService.uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await FileResponseService.fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ComplexService.complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipartService.multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipartService.multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await MultipartService.multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ComplexService.complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts deleted file mode 100644 index e94d5103c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts +++ /dev/null @@ -1,506 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export class DefaultService { - public static export(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static patchApiVbyApiVersionNoTag(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static import(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static fooWow(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static getApiVbyApiVersionSimpleOperation(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); - } - -} - -export class SimpleService { - public static apiVVersionODataControllerCount(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); - } - - public static deleteCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static getCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static headCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static optionsCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static patchCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static postCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static putCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); - } - -} - -export class ParametersService { - public static deleteFoo(options: Options) { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); - } - - public static callWithParameters(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static callWithWeirdParameterNames(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static getCallWithOptionalParam(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static postCallWithOptionalParam(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class DescriptionsService { - public static callWithDescriptions(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); - } - -} - -export class DeprecatedService { - /** - * @deprecated - */ - public static deprecatedCall(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); - } - -} - -export class RequestBodyService { - public static postApiVbyApiVersionRequestBody(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class FormDataService { - public static postApiVbyApiVersionFormData(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); - } - -} - -export class DefaultsService { - public static callWithDefaultParameters(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callWithDefaultOptionalParameters(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callToTestOrderOfParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - -} - -export class DuplicateService { - public static duplicateName(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName2(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName3(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName4(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - -} - -export class NoContentService { - public static callWithNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); - } - - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - -} - -export class ResponseService { - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - - public static callWithResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithDuplicateResponses(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithResponses(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); - } - -} - -export class MultipleTags1Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags2Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags3Service { - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class CollectionFormatService { - public static collectionFormat(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); - } - -} - -export class TypesService { - public static types(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); - } - -} - -export class UploadService { - public static uploadFile(options: Options) { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); - } - -} - -export class FileResponseService { - public static fileResponse(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); - } - -} - -export class ComplexService { - public static complexTypes(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); - } - - public static complexParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); - } - -} - -export class MultipartService { - public static multipartResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); - } - - public static multipartRequest(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); - } - -} - -export class HeaderService { - public static callWithResultFromHeader(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); - } - -} - -export class ErrorService { - public static testErrorCode(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); - } - - /** - * Login User - */ - public static putWithFormUrlEncoded(options: Options) { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts deleted file mode 100644 index 6c51e6e80..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts +++ /dev/null @@ -1,1129 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/angular-query-experimental'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import type { AxiosError } from 'axios'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await export_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await import_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await import_({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts deleted file mode 100644 index 1d97df8bc..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts deleted file mode 100644 index 9e76f2fd8..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/sdk.gen.ts +++ /dev/null @@ -1,410 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - responseType: 'blob', - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts deleted file mode 100644 index 9cb3fcf99..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts deleted file mode 100644 index 8b834b887..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts +++ /dev/null @@ -1,1128 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/angular-query-experimental'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await export_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await import_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await import_({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts deleted file mode 100644 index 7f932711f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts deleted file mode 100644 index 05426b6bd..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts +++ /dev/null @@ -1,1128 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, DefaultService, SimpleService, ParametersService, DescriptionsService, DeprecatedService, RequestBodyService, FormDataService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, UploadService, FileResponseService, ComplexService, MultipartService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; -import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/react-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.export({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.import({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.import({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DeprecatedService.deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DeprecatedService.deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await FormDataService.postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await FormDataService.postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NoContentService.callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await CollectionFormatService.collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await TypesService.types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await UploadService.uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await UploadService.uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await FileResponseService.fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ComplexService.complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipartService.multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipartService.multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await MultipartService.multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ComplexService.complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts deleted file mode 100644 index e94d5103c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts +++ /dev/null @@ -1,506 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export class DefaultService { - public static export(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static patchApiVbyApiVersionNoTag(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static import(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static fooWow(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static getApiVbyApiVersionSimpleOperation(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); - } - -} - -export class SimpleService { - public static apiVVersionODataControllerCount(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); - } - - public static deleteCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static getCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static headCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static optionsCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static patchCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static postCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static putCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); - } - -} - -export class ParametersService { - public static deleteFoo(options: Options) { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); - } - - public static callWithParameters(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static callWithWeirdParameterNames(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static getCallWithOptionalParam(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static postCallWithOptionalParam(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class DescriptionsService { - public static callWithDescriptions(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); - } - -} - -export class DeprecatedService { - /** - * @deprecated - */ - public static deprecatedCall(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); - } - -} - -export class RequestBodyService { - public static postApiVbyApiVersionRequestBody(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class FormDataService { - public static postApiVbyApiVersionFormData(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); - } - -} - -export class DefaultsService { - public static callWithDefaultParameters(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callWithDefaultOptionalParameters(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callToTestOrderOfParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - -} - -export class DuplicateService { - public static duplicateName(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName2(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName3(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName4(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - -} - -export class NoContentService { - public static callWithNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); - } - - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - -} - -export class ResponseService { - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - - public static callWithResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithDuplicateResponses(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithResponses(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); - } - -} - -export class MultipleTags1Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags2Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags3Service { - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class CollectionFormatService { - public static collectionFormat(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); - } - -} - -export class TypesService { - public static types(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); - } - -} - -export class UploadService { - public static uploadFile(options: Options) { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); - } - -} - -export class FileResponseService { - public static fileResponse(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); - } - -} - -export class ComplexService { - public static complexTypes(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); - } - - public static complexParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); - } - -} - -export class MultipartService { - public static multipartResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); - } - - public static multipartRequest(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); - } - -} - -export class HeaderService { - public static callWithResultFromHeader(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); - } - -} - -export class ErrorService { - public static testErrorCode(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); - } - - /** - * Login User - */ - public static putWithFormUrlEncoded(options: Options) { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/asClass/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts deleted file mode 100644 index 43c7a6a12..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts +++ /dev/null @@ -1,1129 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; -import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/react-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import type { AxiosError } from 'axios'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await export_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await import_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await import_({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/client.gen.ts deleted file mode 100644 index 1d97df8bc..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/sdk.gen.ts deleted file mode 100644 index 9e76f2fd8..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/sdk.gen.ts +++ /dev/null @@ -1,410 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - responseType: 'blob', - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/types.gen.ts deleted file mode 100644 index 9cb3fcf99..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/axios/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts deleted file mode 100644 index 0cd713c64..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts +++ /dev/null @@ -1,1128 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; -import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/react-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await export_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await import_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await import_({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts deleted file mode 100644 index 7f932711f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/react-query/fetch/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts deleted file mode 100644 index ba5915d9f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts +++ /dev/null @@ -1,1128 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, DefaultService, SimpleService, ParametersService, DescriptionsService, DeprecatedService, RequestBodyService, FormDataService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, UploadService, FileResponseService, ComplexService, MultipartService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/solid-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.export({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.import({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.import({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DeprecatedService.deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DeprecatedService.deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await FormDataService.postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await FormDataService.postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NoContentService.callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await CollectionFormatService.collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await TypesService.types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await UploadService.uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await UploadService.uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await FileResponseService.fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ComplexService.complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipartService.multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipartService.multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await MultipartService.multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ComplexService.complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts deleted file mode 100644 index e94d5103c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts +++ /dev/null @@ -1,506 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export class DefaultService { - public static export(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static patchApiVbyApiVersionNoTag(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static import(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static fooWow(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static getApiVbyApiVersionSimpleOperation(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); - } - -} - -export class SimpleService { - public static apiVVersionODataControllerCount(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); - } - - public static deleteCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static getCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static headCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static optionsCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static patchCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static postCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static putCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); - } - -} - -export class ParametersService { - public static deleteFoo(options: Options) { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); - } - - public static callWithParameters(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static callWithWeirdParameterNames(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static getCallWithOptionalParam(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static postCallWithOptionalParam(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class DescriptionsService { - public static callWithDescriptions(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); - } - -} - -export class DeprecatedService { - /** - * @deprecated - */ - public static deprecatedCall(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); - } - -} - -export class RequestBodyService { - public static postApiVbyApiVersionRequestBody(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class FormDataService { - public static postApiVbyApiVersionFormData(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); - } - -} - -export class DefaultsService { - public static callWithDefaultParameters(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callWithDefaultOptionalParameters(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callToTestOrderOfParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - -} - -export class DuplicateService { - public static duplicateName(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName2(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName3(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName4(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - -} - -export class NoContentService { - public static callWithNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); - } - - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - -} - -export class ResponseService { - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - - public static callWithResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithDuplicateResponses(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithResponses(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); - } - -} - -export class MultipleTags1Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags2Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags3Service { - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class CollectionFormatService { - public static collectionFormat(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); - } - -} - -export class TypesService { - public static types(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); - } - -} - -export class UploadService { - public static uploadFile(options: Options) { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); - } - -} - -export class FileResponseService { - public static fileResponse(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); - } - -} - -export class ComplexService { - public static complexTypes(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); - } - - public static complexParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); - } - -} - -export class MultipartService { - public static multipartResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); - } - - public static multipartRequest(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); - } - -} - -export class HeaderService { - public static callWithResultFromHeader(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); - } - -} - -export class ErrorService { - public static testErrorCode(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); - } - - /** - * Login User - */ - public static putWithFormUrlEncoded(options: Options) { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/asClass/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts deleted file mode 100644 index 0855483e8..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts +++ /dev/null @@ -1,1129 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/solid-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import type { AxiosError } from 'axios'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await export_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await import_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await import_({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/client.gen.ts deleted file mode 100644 index 1d97df8bc..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts deleted file mode 100644 index 9e76f2fd8..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/sdk.gen.ts +++ /dev/null @@ -1,410 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - responseType: 'blob', - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/types.gen.ts deleted file mode 100644 index 9cb3fcf99..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/axios/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts deleted file mode 100644 index 51709ca90..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts +++ /dev/null @@ -1,1128 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/solid-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await export_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await import_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await import_({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts deleted file mode 100644 index 7f932711f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/solid-query/fetch/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts deleted file mode 100644 index cae8ef1f5..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts +++ /dev/null @@ -1,1128 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, DefaultService, SimpleService, ParametersService, DescriptionsService, DeprecatedService, RequestBodyService, FormDataService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, UploadService, FileResponseService, ComplexService, MultipartService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/svelte-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.export({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.import({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.import({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DeprecatedService.deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DeprecatedService.deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await FormDataService.postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await FormDataService.postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NoContentService.callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await CollectionFormatService.collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await TypesService.types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await UploadService.uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await UploadService.uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await FileResponseService.fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ComplexService.complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipartService.multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipartService.multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await MultipartService.multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ComplexService.complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts deleted file mode 100644 index e94d5103c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts +++ /dev/null @@ -1,506 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export class DefaultService { - public static export(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static patchApiVbyApiVersionNoTag(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static import(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static fooWow(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static getApiVbyApiVersionSimpleOperation(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); - } - -} - -export class SimpleService { - public static apiVVersionODataControllerCount(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); - } - - public static deleteCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static getCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static headCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static optionsCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static patchCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static postCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static putCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); - } - -} - -export class ParametersService { - public static deleteFoo(options: Options) { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); - } - - public static callWithParameters(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static callWithWeirdParameterNames(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static getCallWithOptionalParam(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static postCallWithOptionalParam(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class DescriptionsService { - public static callWithDescriptions(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); - } - -} - -export class DeprecatedService { - /** - * @deprecated - */ - public static deprecatedCall(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); - } - -} - -export class RequestBodyService { - public static postApiVbyApiVersionRequestBody(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class FormDataService { - public static postApiVbyApiVersionFormData(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); - } - -} - -export class DefaultsService { - public static callWithDefaultParameters(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callWithDefaultOptionalParameters(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callToTestOrderOfParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - -} - -export class DuplicateService { - public static duplicateName(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName2(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName3(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName4(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - -} - -export class NoContentService { - public static callWithNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); - } - - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - -} - -export class ResponseService { - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - - public static callWithResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithDuplicateResponses(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithResponses(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); - } - -} - -export class MultipleTags1Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags2Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags3Service { - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class CollectionFormatService { - public static collectionFormat(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); - } - -} - -export class TypesService { - public static types(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); - } - -} - -export class UploadService { - public static uploadFile(options: Options) { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); - } - -} - -export class FileResponseService { - public static fileResponse(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); - } - -} - -export class ComplexService { - public static complexTypes(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); - } - - public static complexParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); - } - -} - -export class MultipartService { - public static multipartResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); - } - - public static multipartRequest(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); - } - -} - -export class HeaderService { - public static callWithResultFromHeader(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); - } - -} - -export class ErrorService { - public static testErrorCode(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); - } - - /** - * Login User - */ - public static putWithFormUrlEncoded(options: Options) { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts deleted file mode 100644 index 9ba592ed0..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts +++ /dev/null @@ -1,1129 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/svelte-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import type { AxiosError } from 'axios'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await export_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await import_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await import_({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions, Options> => { - const mutationOptions: MutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/client.gen.ts deleted file mode 100644 index 1d97df8bc..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts deleted file mode 100644 index 9e76f2fd8..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/sdk.gen.ts +++ /dev/null @@ -1,410 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - responseType: 'blob', - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/types.gen.ts deleted file mode 100644 index 9cb3fcf99..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/axios/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts deleted file mode 100644 index 7527d5f7d..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts +++ /dev/null @@ -1,1128 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; -import { queryOptions, type MutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/svelte-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await export_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await import_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await import_({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): MutationOptions> => { - const mutationOptions: MutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts deleted file mode 100644 index 7f932711f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts deleted file mode 100644 index cf95804c4..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts +++ /dev/null @@ -1,1128 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, DefaultService, SimpleService, ParametersService, DescriptionsService, DeprecatedService, RequestBodyService, FormDataService, DefaultsService, DuplicateService, NoContentService, ResponseService, MultipleTags1Service, CollectionFormatService, TypesService, UploadService, FileResponseService, ComplexService, MultipartService, HeaderService, ErrorService, NonAsciiÆøåÆøÅöôêÊService } from '../sdk.gen'; -import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/vue-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.export({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.import({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.import({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultService.fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultService.getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await SimpleService.putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DescriptionsService.callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DeprecatedService.deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DeprecatedService.deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ParametersService.postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await RequestBodyService.postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await FormDataService.postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await FormDataService.postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DefaultsService.callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await DuplicateService.duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NoContentService.callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipleTags1Service.dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ResponseService.callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await CollectionFormatService.collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await TypesService.types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await UploadService.uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await UploadService.uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await FileResponseService.fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ComplexService.complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipartService.multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await MultipartService.multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await MultipartService.multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ComplexService.complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await HeaderService.callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await ErrorService.testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await NonAsciiÆøåÆøÅöôêÊService.putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts deleted file mode 100644 index e94d5103c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts +++ /dev/null @@ -1,506 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export class DefaultService { - public static export(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static patchApiVbyApiVersionNoTag(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static import(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static fooWow(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); - } - - public static getApiVbyApiVersionSimpleOperation(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); - } - -} - -export class SimpleService { - public static apiVVersionODataControllerCount(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); - } - - public static deleteCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static getCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static headCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static optionsCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static patchCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static postCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); - } - - public static putCallWithoutParametersAndResponse(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); - } - -} - -export class ParametersService { - public static deleteFoo(options: Options) { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); - } - - public static callWithParameters(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static callWithWeirdParameterNames(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static getCallWithOptionalParam(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - public static postCallWithOptionalParam(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class DescriptionsService { - public static callWithDescriptions(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); - } - -} - -export class DeprecatedService { - /** - * @deprecated - */ - public static deprecatedCall(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); - } - -} - -export class RequestBodyService { - public static postApiVbyApiVersionRequestBody(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - -} - -export class FormDataService { - public static postApiVbyApiVersionFormData(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); - } - -} - -export class DefaultsService { - public static callWithDefaultParameters(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callWithDefaultOptionalParameters(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - - public static callToTestOrderOfParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); - } - -} - -export class DuplicateService { - public static duplicateName(options?: Options) { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName2(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName3(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - - public static duplicateName4(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); - } - -} - -export class NoContentService { - public static callWithNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); - } - - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - -} - -export class ResponseService { - public static callWithResponseAndNoContentResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); - } - - public static callWithResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithDuplicateResponses(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); - } - - public static callWithResponses(options?: Options) { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); - } - -} - -export class MultipleTags1Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags2Service { - public static dummyA(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); - } - - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class MultipleTags3Service { - public static dummyB(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); - } - -} - -export class CollectionFormatService { - public static collectionFormat(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); - } - -} - -export class TypesService { - public static types(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); - } - -} - -export class UploadService { - public static uploadFile(options: Options) { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); - } - -} - -export class FileResponseService { - public static fileResponse(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); - } - -} - -export class ComplexService { - public static complexTypes(options: Options) { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); - } - - public static complexParams(options: Options) { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); - } - -} - -export class MultipartService { - public static multipartResponse(options?: Options) { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); - } - - public static multipartRequest(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); - } - -} - -export class HeaderService { - public static callWithResultFromHeader(options?: Options) { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); - } - -} - -export class ErrorService { - public static testErrorCode(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - public static nonAsciiæøåÆøÅöôêÊ字符串(options: Options) { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); - } - - /** - * Login User - */ - public static putWithFormUrlEncoded(options: Options) { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/asClass/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts deleted file mode 100644 index 12019c68f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts +++ /dev/null @@ -1,1129 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; -import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/vue-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import type { AxiosError } from 'axios'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseURL: (options?.client ?? _heyApiClient).getConfig().baseURL } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await export_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await import_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await import_({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, InfiniteData, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions, Options> => { - const mutationOptions: UseMutationOptions, Options> = { - mutationFn: async (localOptions) => { - const { data } = await putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/client.gen.ts deleted file mode 100644 index 1d97df8bc..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts deleted file mode 100644 index 9e76f2fd8..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/sdk.gen.ts +++ /dev/null @@ -1,410 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-axios'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - responseType: 'blob', - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/types.gen.ts deleted file mode 100644 index 9cb3fcf99..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/axios/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseURL: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts deleted file mode 100644 index 70669eb30..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts +++ /dev/null @@ -1,1128 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; -import { queryOptions, type UseMutationOptions, type DefaultError, infiniteQueryOptions, type InfiniteData } from '@tanstack/vue-query'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; -import { client as _heyApiClient } from '../client.gen'; - -export type QueryKey = [ - Pick & { - _id: string; - _infinite?: boolean; - } -]; - -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean): [ - QueryKey[0] -] => { - const params: QueryKey[0] = { _id: id, baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey[0]; - if (infinite) { - params._infinite = infinite; - } - if (options?.body) { - params.body = options.body; - } - if (options?.headers) { - params.headers = options.headers; - } - if (options?.path) { - params.path = options.path; - } - if (options?.query) { - params.query = options.query; - } - return [ - params - ]; -}; - -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); - -export const exportOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await export_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: exportQueryKey(options) - }); -}; - -export const patchApiVbyApiVersionNoTagMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchApiVbyApiVersionNoTag({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const importQueryKey = (options: Options) => createQueryKey('import', options); - -export const importOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await import_({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: importQueryKey(options) - }); -}; - -export const importMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await import_({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fooWowMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await fooWow({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); - -export const apiVVersionODataControllerCountOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await apiVVersionODataControllerCount({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: apiVVersionODataControllerCountQueryKey(options) - }); -}; - -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); - -export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getApiVbyApiVersionSimpleOperation({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) - }); -}; - -export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); - -export const getCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const patchCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await patchCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('postCallWithoutParametersAndResponse', options); - -export const postCallWithoutParametersAndResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithoutParametersAndResponseQueryKey(options) - }); -}; - -export const postCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putCallWithoutParametersAndResponseMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putCallWithoutParametersAndResponse({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deleteFooMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deleteFoo({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDescriptionsQueryKey = (options?: Options) => createQueryKey('callWithDescriptions', options); - -export const callWithDescriptionsOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDescriptions({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDescriptionsQueryKey(options) - }); -}; - -export const callWithDescriptionsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDescriptions({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const deprecatedCallQueryKey = (options: Options) => createQueryKey('deprecatedCall', options); - -export const deprecatedCallOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await deprecatedCall({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: deprecatedCallQueryKey(options) - }); -}; - -export const deprecatedCallMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await deprecatedCall({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithParametersQueryKey = (options: Options) => createQueryKey('callWithParameters', options); - -export const callWithParametersOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersQueryKey(options) - }); -}; - -const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { - const params = queryKey[0]; - if (page.body) { - params.body = { - ...queryKey[0].body as any, - ...page.body as any - }; - } - if (page.headers) { - params.headers = { - ...queryKey[0].headers, - ...page.headers - }; - } - if (page.path) { - params.path = { - ...queryKey[0].path as any, - ...page.path as any - }; - } - if (page.query) { - params.query = { - ...queryKey[0].query as any, - ...page.query as any - }; - } - return params as unknown as typeof page; -}; - -export const callWithParametersInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('callWithParameters', options, true); - -export const callWithParametersInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, string | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - cursor: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await callWithParameters({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithParametersInfiniteQueryKey(options) - }); -}; - -export const callWithParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithWeirdParameterNamesQueryKey = (options: Options) => createQueryKey('callWithWeirdParameterNames', options); - -export const callWithWeirdParameterNamesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithWeirdParameterNamesQueryKey(options) - }); -}; - -export const callWithWeirdParameterNamesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithWeirdParameterNames({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); - -export const getCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await getCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamQueryKey(options) - }); -}; - -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); - -export const getCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - query: { - page: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await getCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: getCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('postCallWithOptionalParam', options); - -export const postCallWithOptionalParamOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamQueryKey(options) - }); -}; - -export const postCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('postCallWithOptionalParam', options, true); - -export const postCallWithOptionalParamInfiniteOptions = (options: Options) => { - return infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( - // @ts-ignore - { - queryFn: async ({ pageParam, queryKey, signal }) => { - // @ts-ignore - const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { - body: { - offset: pageParam - } - }; - const params = createInfiniteParams(queryKey, page); - const { data } = await postCallWithOptionalParam({ - ...options, - ...params, - signal, - throwOnError: true - }); - return data; - }, - queryKey: postCallWithOptionalParamInfiniteQueryKey(options) - }); -}; - -export const postCallWithOptionalParamMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postCallWithOptionalParam({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionRequestBodyQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionRequestBody', options); - -export const postApiVbyApiVersionRequestBodyOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionRequestBodyQueryKey(options) - }); -}; - -export const postApiVbyApiVersionRequestBodyMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionRequestBody({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const postApiVbyApiVersionFormDataQueryKey = (options?: Options) => createQueryKey('postApiVbyApiVersionFormData', options); - -export const postApiVbyApiVersionFormDataOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: postApiVbyApiVersionFormDataQueryKey(options) - }); -}; - -export const postApiVbyApiVersionFormDataMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await postApiVbyApiVersionFormData({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); - -export const callWithDefaultParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultOptionalParameters', options); - -export const callWithDefaultOptionalParametersOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDefaultOptionalParametersQueryKey(options) - }); -}; - -export const callWithDefaultOptionalParametersMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDefaultOptionalParameters({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callToTestOrderOfParamsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callToTestOrderOfParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateNameMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); - -export const duplicateName2Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName2({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName2QueryKey(options) - }); -}; - -export const duplicateName3QueryKey = (options?: Options) => createQueryKey('duplicateName3', options); - -export const duplicateName3Options = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await duplicateName3({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: duplicateName3QueryKey(options) - }); -}; - -export const duplicateName3Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName3({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const duplicateName4Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await duplicateName4({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); - -export const callWithNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithNoContentResponseQueryKey(options) - }); -}; - -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); - -export const callWithResponseAndNoContentResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponseAndNoContentResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseAndNoContentResponseQueryKey(options) - }); -}; - -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); - -export const dummyAOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyA({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyAQueryKey(options) - }); -}; - -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); - -export const dummyBOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await dummyB({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: dummyBQueryKey(options) - }); -}; - -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); - -export const callWithResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResponseQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesQueryKey = (options?: Options) => createQueryKey('callWithDuplicateResponses', options); - -export const callWithDuplicateResponsesOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithDuplicateResponsesQueryKey(options) - }); -}; - -export const callWithDuplicateResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithDuplicateResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResponsesMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResponses({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); - -export const collectionFormatOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await collectionFormat({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: collectionFormatQueryKey(options) - }); -}; - -export const typesQueryKey = (options: Options) => createQueryKey('types', options); - -export const typesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await types({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: typesQueryKey(options) - }); -}; - -export const uploadFileQueryKey = (options: Options) => createQueryKey('uploadFile', options); - -export const uploadFileOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await uploadFile({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: uploadFileQueryKey(options) - }); -}; - -export const uploadFileMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await uploadFile({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); - -export const fileResponseOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await fileResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: fileResponseQueryKey(options) - }); -}; - -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); - -export const complexTypesOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await complexTypes({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: complexTypesQueryKey(options) - }); -}; - -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); - -export const multipartResponseOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartResponse({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartResponseQueryKey(options) - }); -}; - -export const multipartRequestQueryKey = (options?: Options) => createQueryKey('multipartRequest', options); - -export const multipartRequestOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await multipartRequest({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: multipartRequestQueryKey(options) - }); -}; - -export const multipartRequestMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await multipartRequest({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const complexParamsMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await complexParams({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const callWithResultFromHeaderQueryKey = (options?: Options) => createQueryKey('callWithResultFromHeader', options); - -export const callWithResultFromHeaderOptions = (options?: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: callWithResultFromHeaderQueryKey(options) - }); -}; - -export const callWithResultFromHeaderMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await callWithResultFromHeader({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const testErrorCodeQueryKey = (options: Options) => createQueryKey('testErrorCode', options); - -export const testErrorCodeOptions = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await testErrorCode({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: testErrorCodeQueryKey(options) - }); -}; - -export const testErrorCodeMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await testErrorCode({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串QueryKey = (options: Options) => createQueryKey('nonAsciiæøåÆøÅöôêÊ字符串', options); - -export const nonAsciiæøåÆøÅöôêÊ字符串Options = (options: Options) => { - return queryOptions({ - queryFn: async ({ queryKey, signal }) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...queryKey[0], - signal, - throwOnError: true - }); - return data; - }, - queryKey: nonAsciiæøåÆøÅöôêÊ字符串QueryKey(options) - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串Mutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await nonAsciiæøåÆøÅöôêÊ字符串({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; - -export const putWithFormUrlEncodedMutation = (options?: Partial>): UseMutationOptions> => { - const mutationOptions: UseMutationOptions> = { - mutationFn: async (localOptions) => { - const { data } = await putWithFormUrlEncoded({ - ...options, - ...localOptions, - throwOnError: true - }); - return data; - } - }; - return mutationOptions; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts deleted file mode 100644 index 7f932711f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/@tanstack/vue-query/fetch/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/fastify.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/fastify.gen.ts deleted file mode 100644 index 03f6f3f43..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/fastify.gen.ts +++ /dev/null @@ -1,130 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ImportData, ImportResponses, ApiVVersionODataControllerCountResponses, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponses, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponses, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, CallWithNoContentResponseResponses, CallWithResponseAndNoContentResponseResponses, DummyAResponses, DummyBResponses, CallWithDuplicateResponsesErrors, CallWithDuplicateResponsesResponses, CallWithResponsesErrors, CallWithResponsesResponses, CollectionFormatData, TypesData, TypesResponses, UploadFileData, UploadFileResponses, FileResponseData, FileResponseResponses, ComplexTypesData, ComplexTypesErrors, ComplexTypesResponses, MultipartResponseResponses, MultipartRequestData, ComplexParamsData, ComplexParamsResponses, CallWithResultFromHeaderErrors, CallWithResultFromHeaderResponses, TestErrorCodeData, TestErrorCodeErrors, TestErrorCodeResponses, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Responses, PutWithFormUrlEncodedData } from './types.gen'; -import type { RouteHandler } from 'fastify'; - -export type RouteHandlers = { - import: RouteHandler<{ - Body: ImportData['body']; - Reply: Omit; - }>; - apiVVersionODataControllerCount: RouteHandler<{ - Reply: ApiVVersionODataControllerCountResponses; - }>; - getApiVbyApiVersionSimpleOperation: RouteHandler<{ - Params: GetApiVbyApiVersionSimpleOperationData['path']; - Reply: GetApiVbyApiVersionSimpleOperationResponses; - }>; - deleteFoo: RouteHandler<{ - Headers: DeleteFooData3['headers']; - Params: DeleteFooData3['path']; - }>; - callWithDescriptions: RouteHandler<{ - Querystring?: CallWithDescriptionsData['query']; - }>; - deprecatedCall: RouteHandler<{ - Headers: DeprecatedCallData['headers']; - }>; - callWithParameters: RouteHandler<{ - Body: CallWithParametersData['body']; - Headers: CallWithParametersData['headers']; - Params: CallWithParametersData['path']; - Querystring: CallWithParametersData['query']; - }>; - callWithWeirdParameterNames: RouteHandler<{ - Body: CallWithWeirdParameterNamesData['body']; - Headers: CallWithWeirdParameterNamesData['headers']; - Params: CallWithWeirdParameterNamesData['path']; - Querystring: CallWithWeirdParameterNamesData['query']; - }>; - getCallWithOptionalParam: RouteHandler<{ - Body: GetCallWithOptionalParamData['body']; - Querystring?: GetCallWithOptionalParamData['query']; - }>; - postCallWithOptionalParam: RouteHandler<{ - Body: PostCallWithOptionalParamData['body']; - Querystring: PostCallWithOptionalParamData['query']; - Reply: PostCallWithOptionalParamResponses; - }>; - postApiVbyApiVersionRequestBody: RouteHandler<{ - Body: PostApiVbyApiVersionRequestBodyData['body']; - Querystring?: PostApiVbyApiVersionRequestBodyData['query']; - }>; - postApiVbyApiVersionFormData: RouteHandler<{ - Body: PostApiVbyApiVersionFormDataData['body']; - Querystring?: PostApiVbyApiVersionFormDataData['query']; - }>; - callWithDefaultParameters: RouteHandler<{ - Querystring?: CallWithDefaultParametersData['query']; - }>; - callWithDefaultOptionalParameters: RouteHandler<{ - Querystring?: CallWithDefaultOptionalParametersData['query']; - }>; - callToTestOrderOfParams: RouteHandler<{ - Querystring: CallToTestOrderOfParamsData['query']; - }>; - callWithNoContentResponse: RouteHandler<{ - Reply: CallWithNoContentResponseResponses; - }>; - callWithResponseAndNoContentResponse: RouteHandler<{ - Reply: CallWithResponseAndNoContentResponseResponses; - }>; - dummyA: RouteHandler<{ - Reply: DummyAResponses; - }>; - dummyB: RouteHandler<{ - Reply: DummyBResponses; - }>; - callWithDuplicateResponses: RouteHandler<{ - Reply: Omit & CallWithDuplicateResponsesResponses; - }>; - callWithResponses: RouteHandler<{ - Reply: Omit & CallWithResponsesResponses; - }>; - collectionFormat: RouteHandler<{ - Querystring: CollectionFormatData['query']; - }>; - types: RouteHandler<{ - Params?: TypesData['path']; - Querystring: TypesData['query']; - Reply: TypesResponses; - }>; - uploadFile: RouteHandler<{ - Body: UploadFileData['body']; - Params: UploadFileData['path']; - Reply: UploadFileResponses; - }>; - fileResponse: RouteHandler<{ - Params: FileResponseData['path']; - Reply: FileResponseResponses; - }>; - complexTypes: RouteHandler<{ - Querystring: ComplexTypesData['query']; - Reply: ComplexTypesErrors & ComplexTypesResponses; - }>; - multipartResponse: RouteHandler<{ - Reply: MultipartResponseResponses; - }>; - multipartRequest: RouteHandler<{ - Body: MultipartRequestData['body']; - }>; - complexParams: RouteHandler<{ - Body: ComplexParamsData['body']; - Params: ComplexParamsData['path']; - Reply: ComplexParamsResponses; - }>; - callWithResultFromHeader: RouteHandler<{ - Reply: CallWithResultFromHeaderErrors & CallWithResultFromHeaderResponses; - }>; - testErrorCode: RouteHandler<{ - Querystring: TestErrorCodeData['query']; - Reply: TestErrorCodeErrors & TestErrorCodeResponses; - }>; - nonAsciiæøåÆøÅöôêÊ字符串: RouteHandler<{ - Querystring: NonAsciiæøåÆøÅöôêÊ字符串Data['query']; - Reply: NonAsciiæøåÆøÅöôêÊ字符串Responses; - }>; - putWithFormUrlEncoded: RouteHandler<{ - Body: PutWithFormUrlEncodedData['body']; - }>; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/fastify/default/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/my-plugin/default/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/zod/default/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/plugins/zod/default/zod.gen.ts deleted file mode 100644 index d94d75cf2..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/plugins/zod/default/zod.gen.ts +++ /dev/null @@ -1,754 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { z } from 'zod'; - -export const z400 = z.string(); - -export const zCamelCaseCommentWithBreaks = z.number().int(); - -export const zCommentWithBreaks = z.number().int(); - -export const zCommentWithBackticks = z.number().int(); - -export const zCommentWithBackticksAndQuotes = z.number().int(); - -export const zCommentWithSlashes = z.number().int(); - -export const zCommentWithExpressionPlaceholders = z.number().int(); - -export const zCommentWithQuotes = z.number().int(); - -export const zCommentWithReservedCharacters = z.number().int(); - -export const zSimpleInteger = z.number().int(); - -export const zSimpleBoolean = z.boolean(); - -export const zSimpleString = z.string(); - -export const zNonAsciiStringæøåÆøÅöôêÊ字符串 = z.string(); - -export const zSimpleFile = z.string(); - -export const zModelWithString = z.object({ - prop: z.string().optional() -}); - -export const zSimpleReference = zModelWithString; - -export const zSimpleStringWithPattern = z.union([ - z.string().max(64).regex(/^[a-zA-Z0-9_]*$/), - z.null() -]); - -export const zEnumWithStrings = z.enum([ - 'Success', - 'Warning', - 'Error', - "'Single Quote'", - '"Double Quotes"', - 'Non-ascii: øæåôöØÆÅÔÖ字符串' -]); - -export const zEnumWithReplacedCharacters = z.enum([ - "'Single Quote'", - '"Double Quotes"', - 'øæåôöØÆÅÔÖ字符串', - '' -]); - -export const zEnumWithNumbers = z.unknown(); - -export const zEnumFromDescription = z.number(); - -export const zEnumWithExtensions = z.unknown(); - -export const zEnumWithXEnumNames = z.unknown(); - -export const zArrayWithNumbers = z.array(z.number().int()); - -export const zArrayWithBooleans = z.array(z.boolean()); - -export const zArrayWithStrings = z.array(z.string()).default(['test']); - -export const zArrayWithReferences = z.array(zModelWithString); - -export const zArrayWithArray = z.array(z.array(zModelWithString)); - -export const zArrayWithProperties = z.array(z.object({ - '16x16': zCamelCaseCommentWithBreaks.optional(), - bar: z.string().optional() -})); - -export const zArrayWithAnyOfProperties = z.array(z.unknown()); - -export const zAnyOfAnyAndNull = z.object({ - data: z.union([ - z.unknown(), - z.null() - ]).optional() -}); - -export const zAnyOfArrays = z.object({ - results: z.array(z.unknown()).optional() -}); - -export const zDictionaryWithString = z.object({}); - -export const zDictionaryWithPropertiesAndAdditionalProperties = z.object({ - foo: z.number().optional(), - bar: z.boolean().optional() -}); - -export const zDictionaryWithReference = z.object({}); - -export const zDictionaryWithArray = z.object({}); - -export const zDictionaryWithDictionary = z.object({}); - -export const zDictionaryWithProperties = z.object({}); - -export const zModelWithInteger = z.object({ - prop: z.number().int().optional() -}); - -export const zModelWithBoolean = z.object({ - prop: z.boolean().optional() -}); - -export const zModelWithStringError = z.object({ - prop: z.string().optional() -}); - -export const zModelFromZendesk = z.string(); - -export const zModelWithNullableString = z.object({ - nullableProp1: z.union([ - z.string(), - z.null() - ]).optional(), - nullableRequiredProp1: z.union([ - z.string(), - z.null() - ]), - nullableProp2: z.union([ - z.string(), - z.null() - ]).optional(), - nullableRequiredProp2: z.union([ - z.string(), - z.null() - ]), - 'foo_bar-enum': z.enum([ - 'Success', - 'Warning', - 'Error', - 'ØÆÅ字符串' - ]).optional() -}); - -export const zModelWithEnum = z.object({ - 'foo_bar-enum': z.enum([ - 'Success', - 'Warning', - 'Error', - 'ØÆÅ字符串' - ]).optional(), - statusCode: z.enum([ - '100', - '200 FOO', - '300 FOO_BAR', - '400 foo-bar', - '500 foo.bar', - '600 foo&bar' - ]).optional(), - bool: z.unknown().optional() -}); - -export const zModelWithEnumWithHyphen = z.object({ - 'foo-bar-baz-qux': z.enum([ - '3.0' - ]).optional() -}); - -export const zModelWithEnumFromDescription = z.object({ - test: z.number().int().optional() -}); - -export const zModelWithNestedEnums = z.object({ - dictionaryWithEnum: z.object({}).optional(), - dictionaryWithEnumFromDescription: z.object({}).optional(), - arrayWithEnum: z.array(z.enum([ - 'Success', - 'Warning', - 'Error' - ])).optional(), - arrayWithDescription: z.array(z.number().int()).optional(), - 'foo_bar-enum': z.enum([ - 'Success', - 'Warning', - 'Error', - 'ØÆÅ字符串' - ]).optional() -}); - -export const zModelWithProperties = z.object({ - required: z.string(), - requiredAndReadOnly: z.string().readonly(), - requiredAndNullable: z.union([ - z.string(), - z.null() - ]), - string: z.string().optional(), - number: z.number().optional(), - boolean: z.boolean().optional(), - reference: zModelWithString.optional(), - 'property with space': z.string().optional(), - default: z.string().optional(), - try: z.string().optional(), - '@namespace.string': z.string().readonly().optional(), - '@namespace.integer': z.number().int().readonly().optional() -}); - -export const zModelWithReference = z.object({ - prop: zModelWithProperties.optional() -}); - -export const zModelWithReadOnlyAndWriteOnly = z.object({ - foo: z.string(), - bar: z.string().readonly(), - baz: z.string() -}); - -export const zModelWithArrayReadOnlyAndWriteOnly = z.object({ - prop: z.array(zModelWithReadOnlyAndWriteOnly).optional(), - propWithFile: z.array(z.string()).optional(), - propWithNumber: z.array(z.number()).optional() -}); - -export const zModelWithArray = z.object({ - prop: z.array(zModelWithString).optional(), - propWithFile: z.array(z.string()).optional(), - propWithNumber: z.array(z.number()).optional() -}); - -export const zModelWithDictionary = z.object({ - prop: z.object({}).optional() -}); - -export const zDeprecatedModel = z.object({ - prop: z.string().optional() -}); - -export const zModelWithCircularReference: z.AnyZodObject = z.object({ - prop: z.lazy(() => { - return zModelWithCircularReference; - }).optional() -}); - -export const zCompositionWithOneOf = z.object({ - propA: z.union([ - zModelWithString, - zModelWithEnum, - zModelWithArray, - zModelWithDictionary - ]).optional() -}); - -export const zCompositionWithOneOfAnonymous = z.object({ - propA: z.union([ - z.object({ - propA: z.string().optional() - }), - z.string(), - z.number().int() - ]).optional() -}); - -export const zModelCircle = z.object({ - kind: z.string(), - radius: z.number().optional() -}); - -export const zModelSquare = z.object({ - kind: z.string(), - sideLength: z.number().optional() -}); - -export const zCompositionWithOneOfDiscriminator = z.union([ - z.object({ - kind: z.literal('circle').optional() - }).merge(zModelCircle), - z.object({ - kind: z.literal('square').optional() - }).merge(zModelSquare) -]); - -export const zCompositionWithAnyOf = z.object({ - propA: z.union([ - zModelWithString, - zModelWithEnum, - zModelWithArray, - zModelWithDictionary - ]).optional() -}); - -export const zCompositionWithAnyOfAnonymous = z.object({ - propA: z.union([ - z.object({ - propA: z.string().optional() - }), - z.string(), - z.number().int() - ]).optional() -}); - -export const zCompositionWithNestedAnyAndTypeNull = z.object({ - propA: z.union([ - z.array(z.unknown()), - z.array(z.unknown()) - ]).optional() -}); - -export const z3eNum1Период = z.enum([ - 'Bird', - 'Dog' -]); - -export const zConstValue = z.literal('ConstValue'); - -export const zCompositionWithNestedAnyOfAndNull = z.object({ - propA: z.union([ - z.array(z.unknown()), - z.null() - ]).optional() -}); - -export const zCompositionWithOneOfAndNullable = z.object({ - propA: z.union([ - z.object({ - boolean: z.boolean().optional() - }), - zModelWithEnum, - zModelWithArray, - zModelWithDictionary, - z.null() - ]).optional() -}); - -export const zCompositionWithOneOfAndSimpleDictionary = z.object({ - propA: z.union([ - z.boolean(), - z.object({}) - ]).optional() -}); - -export const zCompositionWithOneOfAndSimpleArrayDictionary = z.object({ - propA: z.union([ - z.boolean(), - z.object({}) - ]).optional() -}); - -export const zCompositionWithOneOfAndComplexArrayDictionary = z.object({ - propA: z.union([ - z.boolean(), - z.object({}) - ]).optional() -}); - -export const zCompositionWithAllOfAndNullable = z.object({ - propA: z.union([ - z.object({ - boolean: z.boolean().optional() - }).merge(zModelWithEnum).merge(zModelWithArray).merge(zModelWithDictionary), - z.null() - ]).optional() -}); - -export const zCompositionWithAnyOfAndNullable = z.object({ - propA: z.union([ - z.object({ - boolean: z.boolean().optional() - }), - zModelWithEnum, - zModelWithArray, - zModelWithDictionary, - z.null() - ]).optional() -}); - -export const zCompositionBaseModel = z.object({ - firstName: z.string().optional(), - lastname: z.string().optional() -}); - -export const zCompositionExtendedModel = zCompositionBaseModel.merge(z.object({ - age: z.number(), - firstName: z.string(), - lastname: z.string() -})); - -export const zModelWithNestedProperties = z.object({ - first: z.union([ - z.object({ - second: z.union([ - z.object({ - third: z.union([ - z.string().readonly(), - z.null() - ]).readonly() - }).readonly(), - z.null() - ]).readonly() - }).readonly(), - z.null() - ]).readonly() -}); - -export const zModelWithDuplicateProperties = z.object({ - prop: zModelWithString.optional() -}); - -export const zModelWithOrderedProperties = z.object({ - zebra: z.string().optional(), - apple: z.string().optional(), - hawaii: z.string().optional() -}); - -export const zModelWithDuplicateImports = z.object({ - propA: zModelWithString.optional(), - propB: zModelWithString.optional(), - propC: zModelWithString.optional() -}); - -export const zModelThatExtends = zModelWithString.merge(z.object({ - propExtendsA: z.string().optional(), - propExtendsB: zModelWithString.optional() -})); - -export const zModelThatExtendsExtends = zModelWithString.merge(zModelThatExtends).merge(z.object({ - propExtendsC: z.string().optional(), - propExtendsD: zModelWithString.optional() -})); - -export const zModelWithPattern = z.object({ - key: z.string().max(64).regex(/^[a-zA-Z0-9_]*$/), - name: z.string().max(255), - enabled: z.boolean().readonly().optional(), - modified: z.string().datetime().readonly().optional(), - id: z.string().regex(/^\d{2}-\d{3}-\d{4}$/).optional(), - text: z.string().regex(/^\w+$/).optional(), - patternWithSingleQuotes: z.string().regex(/^[a-zA-Z0-9']*$/).optional(), - patternWithNewline: z.string().regex(/aaa\nbbb/).optional(), - patternWithBacktick: z.string().regex(/aaa`bbb/).optional() -}); - -export const zFile = z.object({ - id: z.string().min(1).readonly().optional(), - updated_at: z.string().datetime().readonly().optional(), - created_at: z.string().datetime().readonly().optional(), - mime: z.string().min(1).max(24), - file: z.string().url().readonly().optional() -}); - -export const zDefault = z.object({ - name: z.string().optional() -}); - -export const zPageable = z.object({ - page: z.number().int().gte(0).optional().default(0), - size: z.number().int().gte(1).optional(), - sort: z.array(z.string()).optional() -}); - -export const zFreeFormObjectWithoutAdditionalProperties = z.object({}); - -export const zFreeFormObjectWithAdditionalPropertiesEqTrue = z.object({}); - -export const zFreeFormObjectWithAdditionalPropertiesEqEmptyObject = z.object({}); - -export const zModelWithConst = z.object({ - String: z.literal('String').optional(), - number: z.literal(0).optional(), - null: z.null().optional(), - withType: z.literal('Some string').optional() -}); - -export const zModelWithAdditionalPropertiesEqTrue = z.object({ - prop: z.string().optional() -}); - -export const zNestedAnyOfArraysNullable = z.object({ - nullableArray: z.union([ - z.array(z.unknown()), - z.null() - ]).optional() -}); - -export const zSimpleParameter = z.unknown(); - -export const zCompositionWithOneOfAndProperties = z.intersection(z.union([ - z.object({ - foo: zSimpleParameter - }), - z.object({ - bar: zNonAsciiStringæøåÆøÅöôêÊ字符串 - }) -]), z.object({ - baz: z.union([ - z.number().int().gte(0), - z.null() - ]), - qux: z.number().int().gte(0) -})); - -export const zNullableObject = z.union([ - z.object({ - foo: z.string().optional() - }), - z.null() -]).default(null); - -export const zCharactersInDescription = z.string(); - -export const zModelWithNullableObject = z.object({ - data: zNullableObject.optional() -}); - -export const zModelWithOneOfEnum = z.union([ - z.object({ - foo: z.enum([ - 'Bar' - ]) - }), - z.object({ - foo: z.enum([ - 'Baz' - ]) - }), - z.object({ - foo: z.enum([ - 'Qux' - ]) - }), - z.object({ - content: z.string().datetime(), - foo: z.enum([ - 'Quux' - ]) - }), - z.object({ - content: z.unknown(), - foo: z.enum([ - 'Corge' - ]) - }) -]); - -export const zModelWithNestedArrayEnumsDataFoo = z.enum([ - 'foo', - 'bar' -]); - -export const zModelWithNestedArrayEnumsDataBar = z.enum([ - 'baz', - 'qux' -]); - -export const zModelWithNestedArrayEnumsData = z.object({ - foo: z.array(zModelWithNestedArrayEnumsDataFoo).optional(), - bar: z.array(zModelWithNestedArrayEnumsDataBar).optional() -}); - -export const zModelWithNestedArrayEnums = z.object({ - array_strings: z.array(z.string()).optional(), - data: zModelWithNestedArrayEnumsData.optional() -}); - -export const zModelWithNestedCompositionEnums = z.object({ - foo: zModelWithNestedArrayEnumsDataFoo.optional() -}); - -export const zModelWithConstantSizeArray = z.unknown(); - -export const zModelWithAnyOfConstantSizeArray = z.unknown(); - -export const zModelWithPrefixItemsConstantSizeArray = z.unknown(); - -export const zModelWithAnyOfConstantSizeArrayNullable = z.unknown(); - -export const zModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = z.unknown(); - -export const zModelWithAnyOfConstantSizeArrayAndIntersect = z.unknown(); - -export const zModelWithNumericEnumUnion = z.object({ - value: z.unknown().optional() -}); - -export const zModelWithBackticksInDescription = z.object({ - template: z.string().optional() -}); - -export const zModelWithOneOfAndProperties = z.intersection(z.union([ - zSimpleParameter, - zNonAsciiStringæøåÆøÅöôêÊ字符串 -]), z.object({ - baz: z.union([ - z.number().int().gte(0), - z.null() - ]), - qux: z.number().int().gte(0) -})); - -export const zParameterSimpleParameterUnused = z.string(); - -export const zPostServiceWithEmptyTagResponse = z.string(); - -export const zPostServiceWithEmptyTagResponse2 = z.string(); - -export const zDeleteFooData = z.string(); - -export const zDeleteFooData2 = z.string(); - -export const zImport = z.string(); - -export const zSchemaWithFormRestrictedKeys = z.object({ - description: z.string().optional(), - 'x-enum-descriptions': z.string().optional(), - 'x-enum-varnames': z.string().optional(), - 'x-enumNames': z.string().optional(), - title: z.string().optional(), - object: z.object({ - description: z.string().optional(), - 'x-enum-descriptions': z.string().optional(), - 'x-enum-varnames': z.string().optional(), - 'x-enumNames': z.string().optional(), - title: z.string().optional() - }).optional(), - array: z.array(z.object({ - description: z.string().optional(), - 'x-enum-descriptions': z.string().optional(), - 'x-enum-varnames': z.string().optional(), - 'x-enumNames': z.string().optional(), - title: z.string().optional() - })).optional() -}); - -export const zIoK8sApimachineryPkgApisMetaV1Preconditions = z.object({ - resourceVersion: z.string().optional(), - uid: z.string().optional() -}); - -export const zIoK8sApimachineryPkgApisMetaV1DeleteOptions = z.object({ - preconditions: zIoK8sApimachineryPkgApisMetaV1Preconditions.optional() -}); - -export const zAdditionalPropertiesUnknownIssue = z.object({}); - -export const zAdditionalPropertiesUnknownIssue2 = z.object({}); - -export const zAdditionalPropertiesUnknownIssue3 = z.intersection(z.string(), z.object({ - entries: z.object({}) -})); - -export const zAdditionalPropertiesIntegerIssue = z.object({ - value: z.number().int() -}); - -export const zGenericSchemaDuplicateIssue1SystemBoolean = z.object({ - item: z.boolean().optional(), - error: z.union([ - z.string(), - z.null() - ]).optional(), - hasError: z.boolean().readonly().optional(), - data: z.object({}).optional() -}); - -export const zGenericSchemaDuplicateIssue1SystemString = z.object({ - item: z.union([ - z.string(), - z.null() - ]).optional(), - error: z.union([ - z.string(), - z.null() - ]).optional(), - hasError: z.boolean().readonly().optional() -}); - -export const zOneOfAllOfIssue = z.union([ - z.intersection(z.union([ - zConstValue, - zGenericSchemaDuplicateIssue1SystemBoolean - ]), z3eNum1Период), - zGenericSchemaDuplicateIssue1SystemString -]); - -export const zImportResponse = z.union([ - zModelFromZendesk, - zModelWithReadOnlyAndWriteOnly -]); - -export const zApiVVersionODataControllerCountResponse = zModelFromZendesk; - -export const zGetApiVbyApiVersionSimpleOperationResponse = z.number(); - -export const zPostCallWithOptionalParamResponse = z.union([ - z.number(), - z.void() -]); - -export const zCallWithNoContentResponseResponse = z.void(); - -export const zCallWithResponseAndNoContentResponseResponse = z.union([ - z.number(), - z.void() -]); - -export const zDummyAResponse = z400; - -export const zDummyBResponse = z.void(); - -export const zCallWithResponseResponse = zImport; - -export const zCallWithDuplicateResponsesResponse = z.union([ - zModelWithBoolean.merge(zModelWithInteger), - zModelWithString -]); - -export const zCallWithResponsesResponse = z.union([ - z.object({ - '@namespace.string': z.string().readonly().optional(), - '@namespace.integer': z.number().int().readonly().optional(), - value: z.array(zModelWithString).readonly().optional() - }), - zModelThatExtends, - zModelThatExtendsExtends -]); - -export const zTypesResponse = z.union([ - z.number(), - z.string(), - z.boolean(), - z.object({}) -]); - -export const zUploadFileResponse = z.boolean(); - -export const zFileResponseResponse = z.string(); - -export const zComplexTypesResponse = z.array(zModelWithString); - -export const zMultipartResponseResponse = z.object({ - file: z.string().optional(), - metadata: z.object({ - foo: z.string().optional(), - bar: z.string().optional() - }).optional() -}); - -export const zComplexParamsResponse = zModelWithString; - -export const zNonAsciiæøåÆøÅöôêÊ字符串Response = z.array(zNonAsciiStringæøåÆøÅöôêÊ字符串); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/types.gen.ts deleted file mode 100644 index 310ad3e5f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/read-write-only/types.gen.ts +++ /dev/null @@ -1,95 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type FooReadWriteReadable = BarReadReadable; - -export type FooReadWriteWritable = BarReadWritable & { - foo?: string; -}; - -export type FooReadReadable = BarReadReadable & { - readonly foo?: string; -}; - -export type FooReadWritable = BarReadWritable; - -export type FooWriteReadable = BarWriteReadable; - -export type FooWriteWritable = BarWriteWritable & { - foo?: string; -}; - -export type BarReadReadable = Baz | QuxAllWriteReadable | QuxAllReadReadable | { - readonly bar?: string; -}; - -export type BarReadWritable = Baz | QuxAllWriteWritable | QuxAllReadWritable; - -export type BarWriteReadable = Baz | QuxAllWriteReadable | QuxAllReadReadable; - -export type BarWriteWritable = Baz | QuxAllWriteWritable | QuxAllReadWritable | { - bar?: string; -}; - -export type Baz = { - baz?: string; -}; - -export type QuxAllWriteWritable = { - baz?: string; -}; - -export type QuxAllReadReadable = { - readonly baz?: string; -}; - -export type PostFooReadWriteData = { - body: FooReadWriteWritable; - path?: never; - query?: never; - url: '/foo-read-write'; -}; - -export type PostFooReadWriteResponses = { - /** - * OK - */ - 200: FooReadWriteReadable; -}; - -export type PostFooReadWriteResponse = PostFooReadWriteResponses[keyof PostFooReadWriteResponses]; - -export type PostFooReadData = { - body: FooReadWritable; - path?: never; - query?: never; - url: '/foo-read'; -}; - -export type PostFooReadResponses = { - /** - * OK - */ - 200: FooReadReadable; -}; - -export type PostFooReadResponse = PostFooReadResponses[keyof PostFooReadResponses]; - -export type PostFooWriteData = { - body: FooWriteWritable; - path?: never; - query?: never; - url: '/foo-write'; -}; - -export type PostFooWriteResponses = { - /** - * OK - */ - 200: FooWriteReadable; -}; - -export type PostFooWriteResponse = PostFooWriteResponses[keyof PostFooWriteResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/ref-type/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/ref-type/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/ref-type/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/ref-type/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/ref-type/types.gen.ts deleted file mode 100644 index 259cbcfaa..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/ref-type/types.gen.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - foo: Array<{ - baz: Bar; - }>; -}; - -export type Bar = { - bar: number; -}; - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: Foo; -}; - -export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/required-all-of-ref/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/required-all-of-ref/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/required-all-of-ref/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/required-all-of-ref/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/required-all-of-ref/types.gen.ts deleted file mode 100644 index bf9831f75..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/required-all-of-ref/types.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - foo?: string; - baz?: string; -}; - -export type Bar = Foo & { - bar: number; - foo: string; - baz: string; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/required-any-of-ref/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/required-any-of-ref/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/required-any-of-ref/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/required-any-of-ref/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/required-any-of-ref/types.gen.ts deleted file mode 100644 index b001001df..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/required-any-of-ref/types.gen.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - foo?: string; - baz?: string; -}; - -export type Bar = Foo & { - bar: number; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/required-one-of-ref/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/required-one-of-ref/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/required-one-of-ref/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/required-one-of-ref/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/required-one-of-ref/types.gen.ts deleted file mode 100644 index b001001df..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/required-one-of-ref/types.gen.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - foo?: string; - baz?: string; -}; - -export type Bar = Foo & { - bar: number; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/schema-const/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/schema-const/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/schema-const/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/schema-const/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/schema-const/types.gen.ts deleted file mode 100644 index 32a859497..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/schema-const/types.gen.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - foo?: 'foo'; - bar?: 3.2; - baz?: -1; - qux?: true; - quux?: [ - 1, - 2, - 3, - 'foo', - true - ]; - corge?: { - [key: string]: unknown; - }; - garply?: 10n; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/schema-const/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/schema-const/zod.gen.ts deleted file mode 100644 index 808d0e91b..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/schema-const/zod.gen.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { z } from 'zod'; - -export const zFoo = z.object({ - foo: z.literal('foo').optional(), - bar: z.literal(3.2).optional(), - baz: z.literal(-1).optional(), - qux: z.literal(true).optional(), - quux: z.tuple([ - z.literal(1), - z.literal(2), - z.literal(3), - z.literal('foo'), - z.literal(true) - ]).optional(), - corge: z.object({}).optional(), - garply: z.coerce.bigint().optional() -}); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/sdk.gen.ts deleted file mode 100644 index 033f5c32d..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/sdk.gen.ts +++ /dev/null @@ -1,47 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { GetFooData, GetBarData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const getFoo = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - security: [ - { - in: 'query', - name: 'foo', - type: 'apiKey' - } - ], - url: '/foo', - ...options - }); -}; - -export const getBar = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - security: [ - { - in: 'cookie', - name: 'bar', - type: 'apiKey' - } - ], - url: '/bar', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/types.gen.ts deleted file mode 100644 index a641918b4..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/security-api-key/types.gen.ts +++ /dev/null @@ -1,33 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type GetBarData = { - body?: never; - path?: never; - query?: never; - url: '/bar'; -}; - -export type GetBarResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-false/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-false/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/security-false/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-false/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-false/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/security-false/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-false/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-false/sdk.gen.ts deleted file mode 100644 index 14ebd7036..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/security-false/sdk.gen.ts +++ /dev/null @@ -1,26 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { GetFooData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const getFoo = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/foo', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-false/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-false/types.gen.ts deleted file mode 100644 index 884795c3f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/security-false/types.gen.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/sdk.gen.ts deleted file mode 100644 index bcb05a226..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/sdk.gen.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { GetFooData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const getFoo = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - security: [ - { - scheme: 'bearer', - type: 'http' - } - ], - url: '/foo', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/types.gen.ts deleted file mode 100644 index 884795c3f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/security-http-bearer/types.gen.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/sdk.gen.ts deleted file mode 100644 index bcb05a226..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/sdk.gen.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { GetFooData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const getFoo = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - security: [ - { - scheme: 'bearer', - type: 'http' - } - ], - url: '/foo', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/types.gen.ts deleted file mode 100644 index 884795c3f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/security-oauth2/types.gen.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/sdk.gen.ts deleted file mode 100644 index bcb05a226..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/sdk.gen.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -import type { GetFooData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const getFoo = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - security: [ - { - scheme: 'bearer', - type: 'http' - } - ], - url: '/foo', - ...options - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/types.gen.ts deleted file mode 100644 index 884795c3f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/security-open-id-connect/types.gen.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: unknown; -}; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/servers/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/servers/client.gen.ts deleted file mode 100644 index 89e76c00f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/servers/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'https://foo.com/v1' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/servers/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/servers/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/servers/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/servers/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/servers/types.gen.ts deleted file mode 100644 index fa745dd45..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/servers/types.gen.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: string; -}; - -export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; - -export type ClientOptions = { - baseUrl: 'https://foo.com/v1' | `${string}://${string}/v1` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/transformers.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/transformers.gen.ts deleted file mode 100644 index 0b520225d..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/transformers.gen.ts +++ /dev/null @@ -1,35 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { GetFooResponse } from './types.gen'; - -const quxSchemaResponseTransformer = (data: any) => { - if (data.baz) { - data.baz = new Date(data.baz); - } - return data; -}; - -const bazSchemaResponseTransformer = (data: any) => { - data = quxSchemaResponseTransformer(data); - data.bar = new Date(data.bar); - return data; -}; - -const barSchemaResponseTransformer = (data: any) => { - data.foo = data.foo.map((item: any) => { - return bazSchemaResponseTransformer(item); - }); - return data; -}; - -const fooSchemaResponseTransformer = (data: any) => { - data.foo = data.foo.map((item: any) => { - return barSchemaResponseTransformer(item); - }); - return data; -}; - -export const getFooResponseTransformer = async (data: any): Promise => { - data = fooSchemaResponseTransformer(data); - return data; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/types.gen.ts deleted file mode 100644 index 25ae9771c..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-all-of/types.gen.ts +++ /dev/null @@ -1,46 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = { - foo: Array; -}; - -export type Bar = { - foo: Array; - bar: 'foo' | 'bar' | 'baz'; -}; - -export type Baz = Qux & { - id: 'Baz'; -} & { - foo: number; - bar: Date; - baz: 'foo' | 'bar' | 'baz'; - qux: number; -}; - -export type Qux = { - foo: number; - bar: number; - baz?: Date; - id: string; -}; - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: Foo; -}; - -export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/transformers.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/transformers.gen.ts deleted file mode 100644 index 15b043f4f..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/transformers.gen.ts +++ /dev/null @@ -1,40 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { GetFooResponse, NestedDateObjectResponse } from './types.gen'; - -const fooSchemaResponseTransformer = (data: any) => { - if (data.foo) { - data.foo = new Date(data.foo); - } - if (data.bar) { - data.bar = new Date(data.bar); - } - if (data.baz) { - data.baz = new Date(data.baz); - } - if (data.requiredQux) { - data.requiredQux = new Date(data.requiredQux); - } - return data; -}; - -export const getFooResponseTransformer = async (data: any): Promise => { - data = data.map((item: any) => { - return fooSchemaResponseTransformer(item); - }); - return data; -}; - -const nestedDateObjectSchemaResponseTransformer = (data: any) => { - if (data.foo) { - if (data.foo.bar) { - data.foo.bar = new Date(data.foo.bar); - } - } - return data; -}; - -export const nestedDateObjectResponseTransformer = async (data: any): Promise => { - data = nestedDateObjectSchemaResponseTransformer(data); - return data; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/types.gen.ts deleted file mode 100644 index 3bbe84e0e..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-any-of-null/types.gen.ts +++ /dev/null @@ -1,53 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Object with a nested date structure - */ -export type NestedDateObject = { - foo?: { - bar?: Date; - }; -}; - -export type Foo = { - foo?: Date; - bar?: Date | null; - baz?: Date | null; - requiredQux: Date | null; -}; - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: Array; -}; - -export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; - -export type NestedDateObjectData = { - body?: never; - path?: never; - query?: never; - url: '/api/nested-date-object'; -}; - -export type NestedDateObjectResponses = { - /** - * Object with nested date - */ - 200: NestedDateObject; -}; - -export type NestedDateObjectResponse = NestedDateObjectResponses[keyof NestedDateObjectResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/client.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/client.gen.ts deleted file mode 100644 index 6759c1f28..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/client.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig()); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/transformers.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/transformers.gen.ts deleted file mode 100644 index 5ad0b923d..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/transformers.gen.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { GetFooResponse } from './types.gen'; - -export const getFooResponseTransformer = async (data: any): Promise => { - data.foo = data.foo.map((item: any) => { - item.baz = new Date(item.baz); - return item; - }); - return data; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/types.gen.ts deleted file mode 100644 index 6820b0d90..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/transformers-array/types.gen.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type GetFooData = { - body?: never; - path?: never; - query?: never; - url: '/foo'; -}; - -export type GetFooResponses = { - /** - * OK - */ - 200: { - foo: Array<{ - baz: Date; - }>; - }; -}; - -export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/type-invalid/index.ts b/packages/openapi-ts-tests/test/generated/3.1.x/type-invalid/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/type-invalid/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/type-invalid/types.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/type-invalid/types.gen.ts deleted file mode 100644 index 2589e80df..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/type-invalid/types.gen.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type Foo = unknown; - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/validators/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/validators/zod.gen.ts deleted file mode 100644 index 6ac6de592..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/validators/zod.gen.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { z } from 'zod'; - -export const zBar: z.AnyZodObject = z.object({ - foo: z.lazy(() => { - return zFoo; - }).optional() -}); - -export const zFoo: z.ZodTypeAny = z.union([ - z.object({ - foo: z.string().regex(/^\d{3}-\d{2}-\d{4}$/).optional(), - bar: zBar.optional(), - baz: z.array(z.lazy(() => { - return zFoo; - })).optional(), - qux: z.number().optional().default(0) - }), - z.null() -]).default(null); - -export const zBaz = z.string().regex(/foo\nbar/).readonly().default('baz'); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/zod-bigint-min-max/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/zod-bigint-min-max/zod.gen.ts deleted file mode 100644 index 5cd7bf827..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/zod-bigint-min-max/zod.gen.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { z } from 'zod'; - -export const zFoo = z.object({ - foo: z.coerce.bigint().gte(0).lte(100).optional() -}); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/zod-circular-ref-2/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/zod-circular-ref-2/zod.gen.ts deleted file mode 100644 index fe5c68cc8..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/zod-circular-ref-2/zod.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { z } from 'zod'; - -export const zBar: z.AnyZodObject = z.object({ - bar: z.union([ - z.array(z.lazy(() => { - return zBar; - })), - z.null() - ]) -}); - -export const zFoo: z.AnyZodObject = z.object({ - foo: zBar -}); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/zod-circular-ref/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/zod-circular-ref/zod.gen.ts deleted file mode 100644 index b36b01adf..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/zod-circular-ref/zod.gen.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { z } from 'zod'; - -export const zBar: z.AnyZodObject = z.object({ - bar: z.array(z.lazy(() => { - return zBar; - })).optional() -}); - -export const zFoo: z.AnyZodObject = z.object({ - foo: zBar.optional() -}); - -export const zQux: z.ZodTypeAny = z.lazy(() => { - return zQux; -}); - -export const zBaz: z.ZodTypeAny = zQux; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/3.1.x/zod-union-merge/zod.gen.ts b/packages/openapi-ts-tests/test/generated/3.1.x/zod-union-merge/zod.gen.ts deleted file mode 100644 index 071cc8af9..000000000 --- a/packages/openapi-ts-tests/test/generated/3.1.x/zod-union-merge/zod.gen.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { z } from 'zod'; - -export const zBar = z.union([ - z.object({ - bar: z.string() - }), - z.object({ - baz: z.string() - }) -]); - -export const zFoo = zBar.merge(z.object({ - foo: z.string() -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/perf/client.gen.ts b/packages/openapi-ts-tests/test/generated/perf/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/perf/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/perf/index.ts b/packages/openapi-ts-tests/test/generated/perf/index.ts deleted file mode 100644 index e64537d21..000000000 --- a/packages/openapi-ts-tests/test/generated/perf/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; -export * from './sdk.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/perf/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/perf/sdk.gen.ts deleted file mode 100644 index 7f932711f..000000000 --- a/packages/openapi-ts-tests/test/generated/perf/sdk.gen.ts +++ /dev/null @@ -1,409 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; -import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, CallWithResponsesData, CallWithResponsesResponse, CallWithResponsesError, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; -import { client as _heyApiClient } from './client.gen'; - -export type Options = ClientOptions & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; -}; - -export const export_ = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const patchApiVbyApiVersionNoTag = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const import_ = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/no+tag', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const fooWow = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/no+tag', - ...options - }); -}; - -export const apiVVersionODataControllerCount = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple/$count', - ...options - }); -}; - -export const getApiVbyApiVersionSimpleOperation = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple:operation', - ...options - }); -}; - -export const deleteCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const getCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const headCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).head({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const optionsCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).options({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const patchCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).patch({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const postCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const putCallWithoutParametersAndResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/simple', - ...options - }); -}; - -export const deleteFoo = (options: Options) => { - return (options.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - ...options - }); -}; - -export const callWithDescriptions = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/descriptions', - ...options - }); -}; - -/** - * @deprecated - */ -export const deprecatedCall = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/deprecated', - ...options - }); -}; - -export const callWithParameters = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameterPath}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const callWithWeirdParameterNames = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const getCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postCallWithOptionalParam = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/parameters', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionRequestBody = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/requestBody', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; - -export const postApiVbyApiVersionFormData = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/formData', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const callWithDefaultParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callWithDefaultOptionalParameters = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const callToTestOrderOfParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/defaults', - ...options - }); -}; - -export const duplicateName = (options?: Options) => { - return (options?.client ?? _heyApiClient).delete({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName2 = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName3 = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const duplicateName4 = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/duplicate', - ...options - }); -}; - -export const callWithNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/no-content', - ...options - }); -}; - -export const callWithResponseAndNoContentResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/response-and-no-content', - ...options - }); -}; - -export const dummyA = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/a', - ...options - }); -}; - -export const dummyB = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multiple-tags/b', - ...options - }); -}; - -export const callWithResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithDuplicateResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const callWithResponses = (options?: Options) => { - return (options?.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/response', - ...options - }); -}; - -export const collectionFormat = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/collectionFormat', - ...options - }); -}; - -export const types = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/types', - ...options - }); -}; - -export const uploadFile = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/upload', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; - -export const fileResponse = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/file/{id}', - ...options - }); -}; - -export const complexTypes = (options: Options) => { - return (options.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/complex', - ...options - }); -}; - -export const multipartResponse = (options?: Options) => { - return (options?.client ?? _heyApiClient).get({ - url: '/api/v{api-version}/multipart', - ...options - }); -}; - -export const multipartRequest = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - ...formDataBodySerializer, - url: '/api/v{api-version}/multipart', - ...options, - headers: { - 'Content-Type': null, - ...options?.headers - } - }); -}; - -export const complexParams = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - url: '/api/v{api-version}/complex/{id}', - ...options, - headers: { - 'Content-Type': 'application/json-patch+json', - ...options?.headers - } - }); -}; - -export const callWithResultFromHeader = (options?: Options) => { - return (options?.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/header', - ...options - }); -}; - -export const testErrorCode = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/error', - ...options - }); -}; - -export const nonAsciiæøåÆøÅöôêÊ字符串 = (options: Options) => { - return (options.client ?? _heyApiClient).post({ - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options - }); -}; - -/** - * Login User - */ -export const putWithFormUrlEncoded = (options: Options) => { - return (options.client ?? _heyApiClient).put({ - ...urlSearchParamsBodySerializer, - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - ...options, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - ...options?.headers - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/perf/types.gen.ts b/packages/openapi-ts-tests/test/generated/perf/types.gen.ts deleted file mode 100644 index 70cd1fa23..000000000 --- a/packages/openapi-ts-tests/test/generated/perf/types.gen.ts +++ /dev/null @@ -1,2033 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = Blob | File; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string | null; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: string | null; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceReadable = { - prop?: ModelWithPropertiesReadable; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReferenceWritable = { - prop?: ModelWithPropertiesWritable; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: ({ - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesReadable = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithPropertiesWritable = { - required: string; - requiredAndNullable: string | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedPropertiesReadable = { - readonly first: { - readonly second: { - readonly third: string | null; - } | null; - } | null; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternReadable = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPatternWritable = { - key: string; - name: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type FileReadable = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type FileWritable = { - mime: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number | null; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - string, - string - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnlyReadable = { - foo: string; - readonly bar: string; -}; - -export type ModelWithReadOnlyAndWriteOnlyWritable = { - foo: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | null | string, - number | null | string, - number | null | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number | null; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<{ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }>; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; - -export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; - -export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { - item?: boolean; - error?: string | null; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { - item?: boolean; - error?: string | null; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemStringReadable = { - item?: string | null; - error?: string | null; - readonly hasError?: boolean; -}; - -export type GenericSchemaDuplicateIssue1SystemStringWritable = { - item?: string | null; - error?: string | null; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnlyReadable; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - }; - url: '/api/v{api-version}/descriptions'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - } | null; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string | null; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string | null; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString | null; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string | null; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string | null; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number | null; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string | null; - /** - * This is a simple number with default value - */ - parameterNumber?: number | null; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string | null; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string | null; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName2Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName3Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateName4Data = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array | null; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string | null; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean | null; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is an array parameter - */ - parameterArray: Array | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error' | null; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: Blob | File; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string | null; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: Blob | File; -}; - -export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString | null; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - name: string | null; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array | null; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v2/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v2/core/ApiError.ts deleted file mode 100644 index 36675d288..000000000 --- a/packages/openapi-ts-tests/test/generated/v2/core/ApiError.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: unknown; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v2/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v2/core/ApiRequestOptions.ts deleted file mode 100644 index 939a0aa4c..000000000 --- a/packages/openapi-ts-tests/test/generated/v2/core/ApiRequestOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type ApiRequestOptions = { - readonly body?: any; - readonly cookies?: Record; - readonly errors?: Record; - readonly formData?: Record | any[] | Blob | File; - readonly headers?: Record; - readonly mediaType?: string; - readonly method: - | 'DELETE' - | 'GET' - | 'HEAD' - | 'OPTIONS' - | 'PATCH' - | 'POST' - | 'PUT'; - readonly path?: Record; - readonly query?: Record; - readonly responseHeader?: string; - readonly responseTransformer?: (data: unknown) => Promise; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v2/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v2/core/ApiResult.ts deleted file mode 100644 index 4c58e3913..000000000 --- a/packages/openapi-ts-tests/test/generated/v2/core/ApiResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ApiResult = { - readonly body: TData; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v2/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v2/core/CancelablePromise.ts deleted file mode 100644 index ccc082e8f..000000000 --- a/packages/openapi-ts-tests/test/generated/v2/core/CancelablePromise.ts +++ /dev/null @@ -1,126 +0,0 @@ -export class CancelError extends Error { - constructor(message: string) { - super(message); - this.name = 'CancelError'; - } - - public get isCancelled(): boolean { - return true; - } -} - -export interface OnCancel { - readonly isResolved: boolean; - readonly isRejected: boolean; - readonly isCancelled: boolean; - - (cancelHandler: () => void): void; -} - -export class CancelablePromise implements Promise { - private _isResolved: boolean; - private _isRejected: boolean; - private _isCancelled: boolean; - readonly cancelHandlers: (() => void)[]; - readonly promise: Promise; - private _resolve?: (value: T | PromiseLike) => void; - private _reject?: (reason?: unknown) => void; - - constructor( - executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: unknown) => void, - onCancel: OnCancel - ) => void - ) { - this._isResolved = false; - this._isRejected = false; - this._isCancelled = false; - this.cancelHandlers = []; - this.promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - - const onResolve = (value: T | PromiseLike): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isResolved = true; - if (this._resolve) this._resolve(value); - }; - - const onReject = (reason?: unknown): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isRejected = true; - if (this._reject) this._reject(reason); - }; - - const onCancel = (cancelHandler: () => void): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this.cancelHandlers.push(cancelHandler); - }; - - Object.defineProperty(onCancel, 'isResolved', { - get: (): boolean => this._isResolved, - }); - - Object.defineProperty(onCancel, 'isRejected', { - get: (): boolean => this._isRejected, - }); - - Object.defineProperty(onCancel, 'isCancelled', { - get: (): boolean => this._isCancelled, - }); - - return executor(onResolve, onReject, onCancel as OnCancel); - }); - } - - get [Symbol.toStringTag]() { - return "Cancellable Promise"; - } - - public then( - onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null - ): Promise { - return this.promise.then(onFulfilled, onRejected); - } - - public catch( - onRejected?: ((reason: unknown) => TResult | PromiseLike) | null - ): Promise { - return this.promise.catch(onRejected); - } - - public finally(onFinally?: (() => void) | null): Promise { - return this.promise.finally(onFinally); - } - - public cancel(): void { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isCancelled = true; - if (this.cancelHandlers.length) { - try { - for (const cancelHandler of this.cancelHandlers) { - cancelHandler(); - } - } catch (error) { - console.warn('Cancellation threw an error', error); - return; - } - } - this.cancelHandlers.length = 0; - if (this._reject) this._reject(new CancelError('Request aborted')); - } - - public get isCancelled(): boolean { - return this._isCancelled; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v2/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v2/core/OpenAPI.ts deleted file mode 100644 index 144e25744..000000000 --- a/packages/openapi-ts-tests/test/generated/v2/core/OpenAPI.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; - -type Headers = Record; -type Middleware = (value: T) => T | Promise; -type Resolver = (options: ApiRequestOptions) => Promise; - -export class Interceptors { - _fns: Middleware[]; - - constructor() { - this._fns = []; - } - - eject(fn: Middleware): void { - const index = this._fns.indexOf(fn); - if (index !== -1) { - this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; - } - } - - use(fn: Middleware): void { - this._fns = [...this._fns, fn]; - } -} - -export type OpenAPIConfig = { - BASE: string; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - ENCODE_PATH?: ((path: string) => string) | undefined; - HEADERS?: Headers | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - VERSION: string; - WITH_CREDENTIALS: boolean; - interceptors: { - request: Interceptors; - response: Interceptors; - }; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: 'http://localhost:3000/base', - CREDENTIALS: 'include', - ENCODE_PATH: undefined, - HEADERS: undefined, - PASSWORD: undefined, - TOKEN: undefined, - USERNAME: undefined, - VERSION: '1.0', - WITH_CREDENTIALS: false, - interceptors: { - request: new Interceptors(), - response: new Interceptors(), - }, -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v2/core/request.ts b/packages/openapi-ts-tests/test/generated/v2/core/request.ts deleted file mode 100644 index 5458a2899..000000000 --- a/packages/openapi-ts-tests/test/generated/v2/core/request.ts +++ /dev/null @@ -1,350 +0,0 @@ -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import { CancelablePromise } from './CancelablePromise'; -import type { OnCancel } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const isString = (value: unknown): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: any): value is Blob => { - return value instanceof Blob; -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const encodePair = (key: string, value: unknown) => { - if (value === undefined || value === null) { - return; - } - - if (value instanceof Date) { - append(key, value.toISOString()); - } else if (Array.isArray(value)) { - value.forEach(v => encodePair(key, v)); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); - } else { - append(key, value); - } - }; - - Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - - return qs.length ? `?${qs.join('&')}` : ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = config.BASE + path; - return options.query ? url + getQueryString(options.query) : url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([, value]) => value !== undefined && value !== null) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { - const [token, username, password, additionalHeaders] = await Promise.all([ - // @ts-ignore - resolve(options, config.TOKEN), - // @ts-ignore - resolve(options, config.USERNAME), - // @ts-ignore - resolve(options, config.PASSWORD), - // @ts-ignore - resolve(options, config.HEADERS), - ]); - - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - }) - .filter(([, value]) => value !== undefined && value !== null) - .reduce((headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), {} as Record); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return new Headers(headers); -}; - -export const getRequestBody = (options: ApiRequestOptions): unknown => { - if (options.body !== undefined) { - if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { - return JSON.stringify(options.body); - } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; -}; - -export const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: any, - formData: FormData | undefined, - headers: Headers, - onCancel: OnCancel -): Promise => { - const controller = new AbortController(); - - let request: RequestInit = { - headers, - body: body ?? formData, - method: options.method, - signal: controller.signal, - }; - - if (config.WITH_CREDENTIALS) { - request.credentials = config.CREDENTIALS; - } - - for (const fn of config.interceptors.request._fns) { - request = await fn(request); - } - - onCancel(() => controller.abort()); - - return await fetch(url, request); -}; - -export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { - if (responseHeader) { - const content = response.headers.get(responseHeader); - if (isString(content)) { - return content; - } - } - return undefined; -}; - -export const getResponseBody = async (response: Response): Promise => { - if (response.status !== 204) { - try { - const contentType = response.headers.get('Content-Type'); - if (contentType) { - const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; - if (contentType.includes('application/json') || contentType.includes('+json')) { - return await response.json(); - } else if (binaryTypes.some(type => contentType.includes(type))) { - return await response.blob(); - } else if (contentType.includes('multipart/form-data')) { - return await response.formData(); - } else if (contentType.includes('text/')) { - return await response.text(); - } - } - } catch (error) { - console.error(error); - } - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 405: 'Method Not Allowed', - 406: 'Not Acceptable', - 407: 'Proxy Authentication Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Payload Too Large', - 414: 'URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Range Not Satisfiable', - 417: 'Expectation Failed', - 418: 'Im a teapot', - 421: 'Misdirected Request', - 422: 'Unprocessable Content', - 423: 'Locked', - 424: 'Failed Dependency', - 425: 'Too Early', - 426: 'Upgrade Required', - 428: 'Precondition Required', - 429: 'Too Many Requests', - 431: 'Request Header Fields Too Large', - 451: 'Unavailable For Legal Reasons', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported', - 506: 'Variant Also Negotiates', - 507: 'Insufficient Storage', - 508: 'Loop Detected', - 510: 'Not Extended', - 511: 'Network Authentication Required', - ...options.errors, - } - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError(options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ -export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options); - - if (!onCancel.isCancelled) { - let response = await sendRequest(config, options, url, body, formData, headers, onCancel); - - for (const fn of config.interceptors.response._fns) { - response = await fn(response); - } - - const responseBody = await getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - let transformedBody = responseBody; - if (options.responseTransformer && response.ok) { - transformedBody = await options.responseTransformer(responseBody) - } - - const result: ApiResult = { - url, - ok: response.ok, - status: response.status, - statusText: response.statusText, - body: responseHeader ?? transformedBody, - }; - - catchErrorCodes(options, result); - - resolve(result.body); - } - } catch (error) { - reject(error); - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v2/index.ts b/packages/openapi-ts-tests/test/generated/v2/index.ts deleted file mode 100644 index 50a1dd734..000000000 --- a/packages/openapi-ts-tests/test/generated/v2/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export { ApiError } from './core/ApiError'; -export { CancelablePromise, CancelError } from './core/CancelablePromise'; -export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v2/schemas.gen.ts b/packages/openapi-ts-tests/test/generated/v2/schemas.gen.ts deleted file mode 100644 index 8d4a5df9d..000000000 --- a/packages/openapi-ts-tests/test/generated/v2/schemas.gen.ts +++ /dev/null @@ -1,669 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export const CommentWithBreaksSchema = { - description: `Testing multiline comments in string: First line -Second line - -Fourth line`, - type: 'integer' -} as const; - -export const CommentWithBackticksSchema = { - description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work', - type: 'integer' -} as const; - -export const CommentWithBackticksAndQuotesSchema = { - description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`, - type: 'integer' -} as const; - -export const CommentWithSlashesSchema = { - description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work', - type: 'integer' -} as const; - -export const CommentWithExpressionPlaceholdersSchema = { - description: 'Testing expression placeholders in string: ${expression} should work', - type: 'integer' -} as const; - -export const CommentWithQuotesSchema = { - description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`, - type: 'integer' -} as const; - -export const CommentWithReservedCharactersSchema = { - description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work', - type: 'integer' -} as const; - -export const SimpleIntegerSchema = { - description: 'This is a simple number', - type: 'integer' -} as const; - -export const SimpleBooleanSchema = { - description: 'This is a simple boolean', - type: 'boolean' -} as const; - -export const SimpleStringSchema = { - description: 'This is a simple string', - type: 'string' -} as const; - -export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = { - description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)', - type: 'string' -} as const; - -export const SimpleFileSchema = { - description: 'This is a simple file', - type: 'file' -} as const; - -export const SimpleReferenceSchema = { - description: 'This is a simple reference', - '$ref': '#/definitions/ModelWithString' -} as const; - -export const SimpleStringWithPatternSchema = { - description: 'This is a simple string', - type: 'string', - maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$' -} as const; - -export const EnumWithStringsSchema = { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串'] -} as const; - -export const EnumWithNumbersSchema = { - description: 'This is a simple enum with numbers', - enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3] -} as const; - -export const EnumFromDescriptionSchema = { - description: 'Success=1,Warning=2,Error=3', - type: 'number' -} as const; - -export const EnumWithExtensionsSchema = { - description: 'This is a simple enum with numbers', - enum: [200, 400, 500], - 'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'], - 'x-enum-descriptions': ['Used when the status of something is successful', 'Used when the status of something has a warning', 'Used when the status of something has an error'] -} as const; - -export const ArrayWithNumbersSchema = { - description: 'This is a simple array with numbers', - type: 'array', - items: { - type: 'integer' - } -} as const; - -export const ArrayWithBooleansSchema = { - description: 'This is a simple array with booleans', - type: 'array', - items: { - type: 'boolean' - } -} as const; - -export const ArrayWithStringsSchema = { - description: 'This is a simple array with strings', - type: 'array', - items: { - type: 'string' - } -} as const; - -export const ArrayWithReferencesSchema = { - description: 'This is a simple array with references', - type: 'array', - items: { - '$ref': '#/definitions/ModelWithString' - } -} as const; - -export const ArrayWithArraySchema = { - description: 'This is a simple array containing an array', - type: 'array', - items: { - type: 'array', - items: { - '$ref': '#/definitions/ModelWithString' - } - } -} as const; - -export const ArrayWithPropertiesSchema = { - description: 'This is a simple array with properties', - type: 'array', - items: { - type: 'object', - properties: { - foo: { - type: 'string' - }, - bar: { - type: 'string' - } - } - } -} as const; - -export const DictionaryWithStringSchema = { - description: 'This is a string dictionary', - type: 'object', - additionalProperties: { - type: 'string' - } -} as const; - -export const DictionaryWithReferenceSchema = { - description: 'This is a string reference', - type: 'object', - additionalProperties: { - '$ref': '#/definitions/ModelWithString' - } -} as const; - -export const DictionaryWithArraySchema = { - description: 'This is a complex dictionary', - type: 'object', - additionalProperties: { - type: 'array', - items: { - '$ref': '#/definitions/ModelWithString' - } - } -} as const; - -export const DictionaryWithDictionarySchema = { - description: 'This is a string dictionary', - type: 'object', - additionalProperties: { - type: 'object', - additionalProperties: { - type: 'string' - } - } -} as const; - -export const DictionaryWithPropertiesSchema = { - description: 'This is a complex dictionary', - type: 'object', - additionalProperties: { - type: 'object', - properties: { - foo: { - type: 'string' - }, - bar: { - type: 'string' - } - } - } -} as const; - -export const DateSchema = { - description: 'This is a type-only model that defines Date as a string', - type: 'string' -} as const; - -export const ModelWithIntegerSchema = { - description: 'This is a model with one number property', - type: 'object', - properties: { - prop: { - description: 'This is a simple number property', - type: 'integer' - } - } -} as const; - -export const ModelWithBooleanSchema = { - description: 'This is a model with one boolean property', - type: 'object', - properties: { - prop: { - description: 'This is a simple boolean property', - type: 'boolean' - } - } -} as const; - -export const ModelWithStringSchema = { - description: 'This is a model with one string property', - type: 'object', - properties: { - prop: { - description: 'This is a simple string property', - type: 'string' - } - } -} as const; - -export const ModelWithStringErrorSchema = { - description: 'This is a model with one string property', - type: 'object', - properties: { - prop: { - description: 'This is a simple string property', - type: 'string' - } - } -} as const; - -export const ModelWithNullableStringSchema = { - description: 'This is a model with one string property', - type: 'object', - required: ['nullableRequiredProp'], - properties: { - nullableProp: { - description: 'This is a simple string property', - type: 'string', - 'x-nullable': true - }, - nullableRequiredProp: { - description: 'This is a simple string property', - type: 'string', - 'x-nullable': true - } - } -} as const; - -export const ModelWithEnumSchema = { - description: 'This is a model with one enum', - type: 'object', - properties: { - test: { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] - }, - statusCode: { - description: 'These are the HTTP error code enums', - enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar'] - }, - bool: { - description: 'Simple boolean enum', - type: 'boolean', - enum: [true] - } - } -} as const; - -export const ModelWithEnumFromDescriptionSchema = { - description: 'This is a model with one enum', - type: 'object', - properties: { - test: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' - } - } -} as const; - -export const ModelWithNestedEnumsSchema = { - description: 'This is a model with nested enums', - type: 'object', - properties: { - dictionaryWithEnum: { - type: 'object', - additionalProperties: { - enum: ['Success', 'Warning', 'Error'] - } - }, - dictionaryWithEnumFromDescription: { - type: 'object', - additionalProperties: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' - } - }, - arrayWithEnum: { - type: 'array', - items: { - enum: ['Success', 'Warning', 'Error'] - } - }, - arrayWithDescription: { - type: 'array', - items: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' - } - } - } -} as const; - -export const ModelWithReferenceSchema = { - description: 'This is a model with one property containing a reference', - type: 'object', - properties: { - prop: { - '$ref': '#/definitions/ModelWithProperties' - } - } -} as const; - -export const ModelWithArraySchema = { - description: 'This is a model with one property containing an array', - type: 'object', - properties: { - prop: { - type: 'array', - items: { - '$ref': '#/definitions/ModelWithString' - } - }, - propWithFile: { - type: 'array', - items: { - type: 'file' - } - }, - propWithNumber: { - type: 'array', - items: { - type: 'number' - } - } - } -} as const; - -export const ModelWithDictionarySchema = { - description: 'This is a model with one property containing a dictionary', - type: 'object', - properties: { - prop: { - type: 'object', - additionalProperties: { - type: 'string' - } - } - } -} as const; - -export const ModelWithCircularReferenceSchema = { - description: 'This is a model with one property containing a circular reference', - type: 'object', - properties: { - prop: { - '$ref': '#/definitions/ModelWithCircularReference' - } - } -} as const; - -export const ModelWithPropertiesSchema = { - description: 'This is a model with one nested property', - type: 'object', - required: ['required', 'requiredAndReadOnly'], - properties: { - required: { - type: 'string' - }, - requiredAndReadOnly: { - type: 'string', - readOnly: true - }, - string: { - type: 'string' - }, - number: { - type: 'number' - }, - boolean: { - type: 'boolean' - }, - reference: { - '$ref': '#/definitions/ModelWithString' - }, - 'property with space': { - type: 'string' - }, - default: { - type: 'string' - }, - try: { - type: 'string' - }, - '@namespace.string': { - type: 'string', - readOnly: true - }, - '@namespace.integer': { - type: 'integer', - readOnly: true - } - } -} as const; - -export const ModelWithNestedPropertiesSchema = { - description: 'This is a model with one nested property', - type: 'object', - required: ['first'], - properties: { - first: { - type: 'object', - required: ['second'], - readOnly: true, - properties: { - second: { - type: 'object', - required: ['third'], - readOnly: true, - properties: { - third: { - type: 'string', - readOnly: true - } - } - } - } - } - } -} as const; - -export const ModelWithDuplicatePropertiesSchema = { - description: 'This is a model with duplicated properties', - type: 'object', - properties: { - prop: { - '$ref': '#/definitions/ModelWithString' - } - } -} as const; - -export const ModelWithOrderedPropertiesSchema = { - description: 'This is a model with ordered properties', - type: 'object', - properties: { - zebra: { - type: 'string' - }, - apple: { - type: 'string' - }, - hawaii: { - type: 'string' - } - } -} as const; - -export const ModelWithDuplicateImportsSchema = { - description: 'This is a model with duplicated imports', - type: 'object', - properties: { - propA: { - '$ref': '#/definitions/ModelWithString' - }, - propB: { - '$ref': '#/definitions/ModelWithString' - }, - propC: { - '$ref': '#/definitions/ModelWithString' - } - } -} as const; - -export const ModelThatExtendsSchema = { - description: 'This is a model that extends another model', - type: 'object', - allOf: [ - { - '$ref': '#/definitions/ModelWithString' - }, - { - type: 'object', - properties: { - propExtendsA: { - type: 'string' - }, - propExtendsB: { - '$ref': '#/definitions/ModelWithString' - } - } - } - ] -} as const; - -export const ModelThatExtendsExtendsSchema = { - description: 'This is a model that extends another model', - type: 'object', - allOf: [ - { - '$ref': '#/definitions/ModelWithString' - }, - { - '$ref': '#/definitions/ModelThatExtends' - }, - { - type: 'object', - properties: { - propExtendsC: { - type: 'string' - }, - propExtendsD: { - '$ref': '#/definitions/ModelWithString' - } - } - } - ] -} as const; - -export const defaultSchema = { - type: 'object', - properties: { - name: { - type: 'string' - } - } -} as const; - -export const ModelWithPatternSchema = { - description: 'This is a model that contains a some patterns', - type: 'object', - required: ['key', 'name'], - properties: { - key: { - maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$', - type: 'string' - }, - name: { - maxLength: 255, - type: 'string' - }, - enabled: { - type: 'boolean', - readOnly: true - }, - modified: { - type: 'string', - format: 'date-time', - readOnly: true - }, - id: { - type: 'string', - pattern: '^\\d{2}-\\d{3}-\\d{4}$' - }, - text: { - type: 'string', - pattern: '^\\w+$' - }, - patternWithSingleQuotes: { - type: 'string', - pattern: "^[a-zA-Z0-9']*$" - }, - patternWithNewline: { - type: 'string', - pattern: 'aaa\\nbbb' - }, - patternWithBacktick: { - type: 'string', - pattern: 'aaa`bbb' - } - } -} as const; - -export const parameter_ActivityParamsSchema = { - type: 'object', - properties: { - description: { - type: 'string' - }, - graduate_id: { - type: 'integer' - }, - organization_id: { - type: 'integer' - }, - parent_activity: { - type: 'integer' - }, - post_id: { - type: 'integer' - } - } -} as const; - -export const response_PostActivityResponseSchema = { - type: 'object', - properties: { - description: { - type: 'string' - }, - graduate_id: { - type: 'integer' - }, - organization_id: { - type: 'integer' - }, - parent_activity_id: { - type: 'integer' - }, - post_id: { - type: 'integer' - } - } -} as const; - -export const failure_FailureSchema = { - type: 'object', - properties: { - error: { - type: 'string' - }, - message: { - type: 'string' - }, - reference_code: { - type: 'string' - } - } -} as const; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v2/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v2/sdk.gen.ts deleted file mode 100644 index 4bf5c91f3..000000000 --- a/packages/openapi-ts-tests/test/generated/v2/sdk.gen.ts +++ /dev/null @@ -1,658 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { CancelablePromise } from './core/CancelablePromise'; -import { OpenAPI } from './core/OpenAPI'; -import { request as __request } from './core/request'; -import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, PatchApiNoTagResponse, FooWowResponse, PostApiBodyData, PostApiBodyResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, CallWithResultFromHeaderResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, TypesData, TypesResponse } from './types.gen'; - -export class CollectionFormatService { - /** - * @param data The data for the request. - * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) - * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) - * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) - * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) - * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) - * @throws ApiError - */ - public static collectionFormat(data: CollectionFormatData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/collectionFormat', - query: { - parameterArrayCSV: data.parameterArrayCsv, - parameterArraySSV: data.parameterArraySsv, - parameterArrayTSV: data.parameterArrayTsv, - parameterArrayPipes: data.parameterArrayPipes, - parameterArrayMulti: data.parameterArrayMulti - } - }); - } - -} - -export class ComplexService { - /** - * @param data The data for the request. - * @param data.parameterObject Parameter containing object - * @param data.parameterReference Parameter containing reference - * @returns ModelWithString Successful response - * @throws ApiError - */ - public static complexTypes(data: ComplexTypesData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/complex', - query: { - parameterObject: data.parameterObject, - parameterReference: data.parameterReference - }, - errors: { - 400: '400 server error', - 500: '500 server error' - } - }); - } - -} - -export class DefaultService { - /** - * @throws ApiError - */ - public static serviceWithEmptyTag(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public static patchApiNoTag(): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public static fooWow(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * Body should not be unknown - * Body should not be unknown - * @param data The data for the request. - * @param data.request Body should not be unknown - * @returns response_PostActivityResponse OK - * @throws ApiError - */ - public static postApiBody(data: PostApiBodyData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/body', - body: data.request, - errors: { - 400: 'Bad Request', - 500: 'Internal Server Error' - } - }); - } - -} - -export class DefaultsService { - /** - * @param data The data for the request. - * @param data.parameterString This is a simple string with default value - * @param data.parameterNumber This is a simple number with default value - * @param data.parameterBoolean This is a simple boolean with default value - * @param data.parameterEnum This is a simple enum with default value - * @param data.parameterModel This is a simple model with default value - * @throws ApiError - */ - public static callWithDefaultParameters(data: CallWithDefaultParametersData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterString This is a simple string that is optional with default value - * @param data.parameterNumber This is a simple number that is optional with default value - * @param data.parameterBoolean This is a simple boolean that is optional with default value - * @param data.parameterEnum This is a simple enum that is optional with default value - * @param data.parameterModel This is a simple model that is optional with default value - * @throws ApiError - */ - public static callWithDefaultOptionalParameters(data: CallWithDefaultOptionalParametersData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterStringWithNoDefault This is a string with no default - * @param data.parameterOptionalStringWithDefault This is a optional string with default - * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default - * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default - * @param data.parameterStringWithDefault This is a string with default - * @param data.parameterStringWithEmptyDefault This is a string with empty default - * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default - * @param data.parameterStringNullableWithDefault This is a string that can be null with default - * @throws ApiError - */ - public static callToTestOrderOfParams(data: CallToTestOrderOfParamsData): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/defaults', - query: { - parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, - parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, - parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, - parameterStringWithDefault: data.parameterStringWithDefault, - parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, - parameterStringWithNoDefault: data.parameterStringWithNoDefault, - parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, - parameterStringNullableWithDefault: data.parameterStringNullableWithDefault - } - }); - } - -} - -export class DescriptionsService { - /** - * @param data The data for the request. - * @param data.parameterWithBreaks Testing multiline comments in string: First line - * Second line - * - * Fourth line - * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work - * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work - * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work - * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work - * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work - * @throws ApiError - */ - public static callWithDescriptions(data: CallWithDescriptionsData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/descriptions/', - query: { - parameterWithBreaks: data.parameterWithBreaks, - parameterWithBackticks: data.parameterWithBackticks, - parameterWithSlashes: data.parameterWithSlashes, - parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders, - parameterWithQuotes: data.parameterWithQuotes, - parameterWithReservedCharacters: data.parameterWithReservedCharacters - } - }); - } - -} - -export class DuplicateService { - /** - * @throws ApiError - */ - public static duplicateName(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public static duplicateName1(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public static duplicateName2(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public static duplicateName3(): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/duplicate' - }); - } - -} - -export class ErrorService { - /** - * @param data The data for the request. - * @param data.status Status code to return - * @returns unknown Custom message: Successful response - * @throws ApiError - */ - public static testErrorCode(data: TestErrorCodeData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/error', - query: { - status: data.status - }, - errors: { - 500: 'Custom message: Internal Server Error', - 501: 'Custom message: Not Implemented', - 502: 'Custom message: Bad Gateway', - 503: 'Custom message: Service Unavailable' - } - }); - } - -} - -export class HeaderService { - /** - * @returns string Successful response - * @throws ApiError - */ - public static callWithResultFromHeader(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/header', - responseHeader: 'operation-location', - errors: { - 400: '400 server error', - 500: '500 server error' - } - }); - } - -} - -export class MultipleTags1Service { - /** - * @returns void Success - * @throws ApiError - */ - public static dummyA(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/a' - }); - } - - /** - * @returns void Success - * @throws ApiError - */ - public static dummyB(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class MultipleTags2Service { - /** - * @returns void Success - * @throws ApiError - */ - public static dummyA(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/a' - }); - } - - /** - * @returns void Success - * @throws ApiError - */ - public static dummyB(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class MultipleTags3Service { - /** - * @returns void Success - * @throws ApiError - */ - public static dummyB(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class NoContentService { - /** - * @returns void Success - * @throws ApiError - */ - public static callWithNoContentResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/no-content' - }); - } - - /** - * @returns unknown Response is a simple number - * @returns void Success - * @throws ApiError - */ - public static callWithResponseAndNoContentResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/response-and-no-content' - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - /** - * @param data The data for the request. - * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param - * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response - * @throws ApiError - */ - public static nonAsciiæøåÆøÅöôêÊ字符串(data: NonAsciiæøåÆøÅöôêÊ字符串Data): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - query: { - 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ - } - }); - } - -} - -export class ParametersService { - /** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the header - * @param data.parameterQuery This is the parameter that goes into the query params - * @param data.parameterForm This is the parameter that goes into the form data - * @param data.parameterBody This is the parameter that is sent as request body - * @param data.parameterPath This is the parameter that goes into the path - * @throws ApiError - */ - public static callWithParameters(data: CallWithParametersData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/{parameterPath}', - path: { - parameterPath: data.parameterPath - }, - headers: { - parameterHeader: data.parameterHeader - }, - query: { - parameterQuery: data.parameterQuery - }, - formData: { - parameterForm: data.parameterForm - }, - body: data.parameterBody - }); - } - - /** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the request header - * @param data.parameterQuery This is the parameter that goes into the request query params - * @param data.parameterForm This is the parameter that goes into the request form data - * @param data.parameterBody This is the parameter that is sent as request body - * @param data.parameterPath1 This is the parameter that goes into the path - * @param data.parameterPath2 This is the parameter that goes into the path - * @param data.parameterPath3 This is the parameter that goes into the path - * @param data._default This is the parameter with a reserved keyword - * @throws ApiError - */ - public static callWithWeirdParameterNames(data: CallWithWeirdParameterNamesData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - path: { - 'parameter.path.1': data.parameterPath1, - 'parameter-path-2': data.parameterPath2, - 'PARAMETER-PATH-3': data.parameterPath3 - }, - headers: { - 'parameter.header': data.parameterHeader - }, - query: { - default: data._default, - 'parameter-query': data.parameterQuery - }, - formData: { - parameter_form: data.parameterForm - }, - body: data.parameterBody - }); - } - -} - -export class ResponseService { - /** - * @returns unknown Response is a simple number - * @returns void Success - * @throws ApiError - */ - public static callWithResponseAndNoContentResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/response-and-no-content' - }); - } - - /** - * @returns ModelWithString Message for default response - * @throws ApiError - */ - public static callWithResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/response' - }); - } - - /** - * @returns ModelWithString Message for 201 response - * @returns ModelWithString Message for 202 response - * @throws ApiError - */ - public static callWithDuplicateResponses(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/response', - errors: { - 500: 'Message for 500 error', - 501: 'Message for 501 error', - 502: 'Message for 502 error', - default: 'Message for default response' - } - }); - } - - /** - * @returns unknown Message for 200 response - * @returns ModelThatExtends Message for 201 response - * @returns ModelThatExtendsExtends Message for 202 response - * @throws ApiError - */ - public static callWithResponses(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/response', - errors: { - 500: 'Message for 500 error', - 501: 'Message for 501 error', - 502: 'Message for 502 error', - default: 'Message for default response' - } - }); - } - -} - -export class SimpleService { - /** - * @throws ApiError - */ - public static getCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static putCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static postCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static deleteCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static optionsCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'OPTIONS', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static headCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'HEAD', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static patchCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v{api-version}/simple' - }); - } - -} - -export class TypesService { - /** - * @param data The data for the request. - * @param data.parameterArray This is an array parameter - * @param data.parameterDictionary This is a dictionary parameter - * @param data.parameterEnum This is an enum parameter - * @param data.parameterNumber This is a number parameter - * @param data.parameterString This is a string parameter - * @param data.parameterBoolean This is a boolean parameter - * @param data.parameterObject This is an object parameter - * @param data.id This is a number parameter - * @returns number Response is a simple number - * @returns string Response is a simple string - * @returns boolean Response is a simple boolean - * @returns unknown Response is a simple object - * @throws ApiError - */ - public static types(data: TypesData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/types', - path: { - id: data.id - }, - query: { - parameterNumber: data.parameterNumber, - parameterString: data.parameterString, - parameterBoolean: data.parameterBoolean, - parameterObject: data.parameterObject, - parameterArray: data.parameterArray, - parameterDictionary: data.parameterDictionary, - parameterEnum: data.parameterEnum - } - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v2/types.gen.ts b/packages/openapi-ts-tests/test/generated/v2/types.gen.ts deleted file mode 100644 index bf8b547d5..000000000 --- a/packages/openapi-ts-tests/test/generated/v2/types.gen.ts +++ /dev/null @@ -1,762 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _default = { - name?: string; -}; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array<(boolean)>; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array<(number)>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - foo?: string; - bar?: string; -}>; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array<(string)>; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * This is a type-only model that defines Date as a string - */ -export type Date = string; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: (string); - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: (string); -}; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple enum with numbers - */ -export const EnumWithExtensions = { - /** - * Used when the status of something is successful - */ - CUSTOM_SUCCESS: 200, - /** - * Used when the status of something has a warning - */ - CUSTOM_WARNING: 400, - /** - * Used when the status of something has an error - */ - CUSTOM_ERROR: 500 -} as const; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * This is a simple enum with numbers - */ -export const EnumWithNumbers = { - '_1': 1, - '_2': 2, - '_3': 3, - '_1.1': 1.1, - '_1.2': 1.2, - '_1.3': 1.3, - '_100': 100, - '_200': 200, - '_300': 300, - '_-100': -100, - '_-200': -200, - '_-300': -300, - '_-1.1': -1.1, - '_-1.2': -1.2, - '_-1.3': -1.3 -} as const; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with strings - */ -export const EnumWithStrings = { - SUCCESS: 'Success', - WARNING: 'Warning', - ERROR: 'Error', - _SINGLE_QUOTE_: "'Single Quote'", - _DOUBLE_QUOTES_: '"Double Quotes"', - 'NON_ASCII__ØÆÅÔÖ_ØÆÅÔÖ字符串': 'Non-ascii: øæåôöØÆÅÔÖ字符串' -} as const; - -export type failure_Failure = { - error?: string; - message?: string; - reference_code?: string; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: (string); - }; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: boolean; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: ('Success' | 'Warning' | 'Error'); - }; - dictionaryWithEnumFromDescription?: { - [key: string]: (number); - }; - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; - arrayWithDescription?: Array<(number)>; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedProperties = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp: (string) | null; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPattern = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithProperties = { - required: string; - readonly requiredAndReadOnly: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReference = { - prop?: ModelWithProperties; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; - -export type parameter_ActivityParams = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity?: number; - post_id?: number; -}; - -export type response_PostActivityResponse = { - description?: string; - graduate_id?: number; - organization_id?: number; - parent_activity_id?: number; - post_id?: number; -}; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple file - */ -export type SimpleFile = (Blob | File); - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -export type CollectionFormatData = { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCsv: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySsv: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTsv: Array; -}; - -export type ComplexTypesData = { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; -}; - -export type ComplexTypesResponse = (Array); - -export type PatchApiNoTagResponse = (unknown); - -export type FooWowResponse = (unknown); - -export type PostApiBodyData = { - /** - * Body should not be unknown - */ - request: parameter_ActivityParams; -}; - -export type PostApiBodyResponse = (response_PostActivityResponse); - -export type CallWithDefaultParametersData = { - /** - * This is a simple boolean with default value - */ - parameterBoolean: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel: ModelWithString; - /** - * This is a simple number with default value - */ - parameterNumber: number; - /** - * This is a simple string with default value - */ - parameterString: string; -}; - -export type CallWithDefaultOptionalParametersData = { - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; -}; - -export type CallToTestOrderOfParamsData = { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: (string) | null; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: (string) | null; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; -}; - -export type CallWithDescriptionsData = { - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: string; - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: string; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: string; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: string; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: string; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: string; -}; - -export type TestErrorCodeData = { - /** - * Status code to return - */ - status: string; -}; - -export type TestErrorCodeResponse = (unknown); - -export type CallWithResultFromHeaderResponse = (string); - -export type DummyAResponse = (void); - -export type DummyBResponse = (void); - -export type CallWithNoContentResponseResponse = (void); - -export type CallWithResponseAndNoContentResponseResponse = (unknown | void); - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - /** - * Dummy input param - */ - nonAsciiParamæøåÆøÅöôêÊ: number; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = (NonAsciiStringæøåÆØÅöôêÊ字符串); - -export type CallWithParametersData = { - /** - * This is the parameter that is sent as request body - */ - parameterBody: string; - /** - * This is the parameter that goes into the form data - */ - parameterForm: string; - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * This is the parameter that goes into the query params - */ - parameterQuery: string; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter with a reserved keyword - */ - _default?: string; - /** - * This is the parameter that is sent as request body - */ - parameterBody: string; - /** - * This is the parameter that goes into the request form data - */ - parameterForm: string; - /** - * This is the parameter that goes into the request header - */ - parameterHeader: string; - /** - * This is the parameter that goes into the path - */ - parameterPath1?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath2?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath3?: string; - /** - * This is the parameter that goes into the request query params - */ - parameterQuery: string; -}; - -export type CallWithResponseResponse = (ModelWithString); - -export type CallWithDuplicateResponsesResponse = (ModelWithString); - -export type CallWithResponsesResponse = ({ - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; -} | ModelThatExtends | ModelThatExtendsExtends); - -export type TypesData = { - /** - * This is a number parameter - */ - id?: number; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: string; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is an object parameter - */ - parameterObject: unknown; - /** - * This is a string parameter - */ - parameterString: string; -}; - -export type TypesResponse = (number | string | boolean | unknown); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3-schemas-form/schemas.gen.ts b/packages/openapi-ts-tests/test/generated/v3-schemas-form/schemas.gen.ts deleted file mode 100644 index d3a5b2a23..000000000 --- a/packages/openapi-ts-tests/test/generated/v3-schemas-form/schemas.gen.ts +++ /dev/null @@ -1,1834 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export const _400Schema = { - type: 'string' -} as const; - -export const camelCaseCommentWithBreaksSchema = { - type: 'integer' -} as const; - -export const CommentWithBreaksSchema = { - type: 'integer' -} as const; - -export const CommentWithBackticksSchema = { - type: 'integer' -} as const; - -export const CommentWithBackticksAndQuotesSchema = { - type: 'integer' -} as const; - -export const CommentWithSlashesSchema = { - type: 'integer' -} as const; - -export const CommentWithExpressionPlaceholdersSchema = { - type: 'integer' -} as const; - -export const CommentWithQuotesSchema = { - type: 'integer' -} as const; - -export const CommentWithReservedCharactersSchema = { - type: 'integer' -} as const; - -export const SimpleIntegerSchema = { - type: 'integer' -} as const; - -export const SimpleBooleanSchema = { - type: 'boolean' -} as const; - -export const SimpleStringSchema = { - type: 'string' -} as const; - -export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = { - type: 'string' -} as const; - -export const SimpleFileSchema = { - type: 'file' -} as const; - -export const SimpleReferenceSchema = { - '$ref': '#/components/schemas/ModelWithString' -} as const; - -export const SimpleStringWithPatternSchema = { - type: 'string', - nullable: true, - maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$' -} as const; - -export const EnumWithStringsSchema = { - enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串'] -} as const; - -export const EnumWithReplacedCharactersSchema = { - enum: ["'Single Quote'", '"Double Quotes"', 'øæåôöØÆÅÔÖ字符串', 3.1, ''], - type: 'string' -} as const; - -export const EnumWithNumbersSchema = { - enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3], - default: 200 -} as const; - -export const EnumFromDescriptionSchema = { - type: 'number' -} as const; - -export const EnumWithExtensionsSchema = { - enum: [200, 400, 500] -} as const; - -export const EnumWithXEnumNamesSchema = { - enum: [0, 1, 2] -} as const; - -export const ArrayWithNumbersSchema = { - type: 'array', - items: { - type: 'integer' - } -} as const; - -export const ArrayWithBooleansSchema = { - type: 'array', - items: { - type: 'boolean' - } -} as const; - -export const ArrayWithStringsSchema = { - type: 'array', - items: { - type: 'string' - }, - default: ['test'] -} as const; - -export const ArrayWithReferencesSchema = { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithString' - } -} as const; - -export const ArrayWithArraySchema = { - type: 'array', - items: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithString' - } - } -} as const; - -export const ArrayWithPropertiesSchema = { - type: 'array', - items: { - type: 'object', - properties: { - '16x16': { - '$ref': '#/components/schemas/camelCaseCommentWithBreaks' - }, - bar: { - type: 'string' - } - } - } -} as const; - -export const ArrayWithAnyOfPropertiesSchema = { - type: 'array', - items: { - anyOf: [ - { - type: 'object', - properties: { - foo: { - type: 'string', - default: 'test' - } - } - }, - { - type: 'object', - properties: { - bar: { - type: 'string' - } - } - } - ] - } -} as const; - -export const AnyOfAnyAndNullSchema = { - type: 'object', - properties: { - data: { - anyOf: [ - {}, - { - type: 'null' - } - ] - } - } -} as const; - -export const AnyOfArraysSchema = { - type: 'object', - properties: { - results: { - items: { - anyOf: [ - { - type: 'object', - properties: { - foo: { - type: 'string' - } - } - }, - { - type: 'object', - properties: { - bar: { - type: 'string' - } - } - } - ] - }, - type: 'array' - } - } -} as const; - -export const DictionaryWithStringSchema = { - type: 'object', - additionalProperties: { - type: 'string' - } -} as const; - -export const DictionaryWithPropertiesAndAdditionalPropertiesSchema = { - type: 'object', - properties: { - foo: { - type: 'number' - }, - bar: { - type: 'boolean' - } - }, - additionalProperties: { - type: 'string' - } -} as const; - -export const DictionaryWithReferenceSchema = { - type: 'object', - additionalProperties: { - '$ref': '#/components/schemas/ModelWithString' - } -} as const; - -export const DictionaryWithArraySchema = { - type: 'object', - additionalProperties: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithString' - } - } -} as const; - -export const DictionaryWithDictionarySchema = { - type: 'object', - additionalProperties: { - type: 'object', - additionalProperties: { - type: 'string' - } - } -} as const; - -export const DictionaryWithPropertiesSchema = { - type: 'object', - additionalProperties: { - type: 'object', - properties: { - foo: { - type: 'string' - }, - bar: { - type: 'string' - } - } - } -} as const; - -export const ModelWithIntegerSchema = { - type: 'object', - properties: { - prop: { - type: 'integer' - } - } -} as const; - -export const ModelWithBooleanSchema = { - type: 'object', - properties: { - prop: { - type: 'boolean' - } - } -} as const; - -export const ModelWithStringSchema = { - type: 'object', - properties: { - prop: { - type: 'string' - } - } -} as const; - -export const ModelWithStringErrorSchema = { - type: 'object', - properties: { - prop: { - type: 'string' - } - } -} as const; - -export const Model_From_ZendeskSchema = { - type: 'string' -} as const; - -export const ModelWithNullableStringSchema = { - type: 'object', - required: ['nullableRequiredProp1', 'nullableRequiredProp2'], - properties: { - nullableProp1: { - type: 'string', - nullable: true - }, - nullableRequiredProp1: { - type: 'string', - nullable: true - }, - nullableProp2: { - type: ['string', 'null'] - }, - nullableRequiredProp2: { - type: ['string', 'null'] - }, - 'foo_bar-enum': { - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] - } - } -} as const; - -export const ModelWithEnumSchema = { - type: 'object', - properties: { - 'foo_bar-enum': { - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] - }, - statusCode: { - enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar'] - }, - bool: { - type: 'boolean', - enum: [true] - } - } -} as const; - -export const ModelWithEnumWithHyphenSchema = { - type: 'object', - properties: { - 'foo-bar-baz-qux': { - type: 'string', - enum: ['3.0'], - default: '3.0' - } - } -} as const; - -export const ModelWithEnumFromDescriptionSchema = { - type: 'object', - properties: { - test: { - type: 'integer' - } - } -} as const; - -export const ModelWithNestedEnumsSchema = { - type: 'object', - properties: { - dictionaryWithEnum: { - type: 'object', - additionalProperties: { - enum: ['Success', 'Warning', 'Error'] - } - }, - dictionaryWithEnumFromDescription: { - type: 'object', - additionalProperties: { - type: 'integer' - } - }, - arrayWithEnum: { - type: 'array', - items: { - enum: ['Success', 'Warning', 'Error'] - } - }, - arrayWithDescription: { - type: 'array', - items: { - type: 'integer' - } - }, - 'foo_bar-enum': { - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] - } - } -} as const; - -export const ModelWithReferenceSchema = { - type: 'object', - properties: { - prop: { - '$ref': '#/components/schemas/ModelWithProperties' - } - } -} as const; - -export const ModelWithArrayReadOnlyAndWriteOnlySchema = { - type: 'object', - properties: { - prop: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnly' - } - }, - propWithFile: { - type: 'array', - items: { - type: 'file' - } - }, - propWithNumber: { - type: 'array', - items: { - type: 'number' - } - } - } -} as const; - -export const ModelWithArraySchema = { - type: 'object', - properties: { - prop: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithString' - } - }, - propWithFile: { - type: 'array', - items: { - type: 'file' - } - }, - propWithNumber: { - type: 'array', - items: { - type: 'number' - } - } - } -} as const; - -export const ModelWithDictionarySchema = { - type: 'object', - properties: { - prop: { - type: 'object', - additionalProperties: { - type: 'string' - } - } - } -} as const; - -export const DeprecatedModelSchema = { - deprecated: true, - type: 'object', - properties: { - prop: { - deprecated: true, - type: 'string' - } - } -} as const; - -export const ModelWithCircularReferenceSchema = { - type: 'object', - properties: { - prop: { - '$ref': '#/components/schemas/ModelWithCircularReference' - } - } -} as const; - -export const CompositionWithOneOfSchema = { - type: 'object', - properties: { - propA: { - type: 'object', - oneOf: [ - { - '$ref': '#/components/schemas/ModelWithString' - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const CompositionWithOneOfAnonymousSchema = { - type: 'object', - properties: { - propA: { - type: 'object', - oneOf: [ - { - type: 'object', - properties: { - propA: { - type: 'string' - } - } - }, - { - type: 'string' - }, - { - type: 'integer' - } - ] - } - } -} as const; - -export const ModelCircleSchema = { - type: 'object', - required: ['kind'], - properties: { - kind: { - type: 'string' - }, - radius: { - type: 'number' - } - } -} as const; - -export const ModelSquareSchema = { - type: 'object', - required: ['kind'], - properties: { - kind: { - type: 'string' - }, - sideLength: { - type: 'number' - } - } -} as const; - -export const CompositionWithOneOfDiscriminatorSchema = { - type: 'object', - oneOf: [ - { - '$ref': '#/components/schemas/ModelCircle' - }, - { - '$ref': '#/components/schemas/ModelSquare' - } - ], - discriminator: { - propertyName: 'kind', - mapping: { - circle: '#/components/schemas/ModelCircle', - square: '#/components/schemas/ModelSquare' - } - } -} as const; - -export const CompositionWithAnyOfSchema = { - type: 'object', - properties: { - propA: { - type: 'object', - anyOf: [ - { - '$ref': '#/components/schemas/ModelWithString' - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const CompositionWithAnyOfAnonymousSchema = { - type: 'object', - properties: { - propA: { - type: 'object', - anyOf: [ - { - type: 'object', - properties: { - propA: { - type: 'string' - } - } - }, - { - type: 'string' - }, - { - type: 'integer' - } - ] - } - } -} as const; - -export const CompositionWithNestedAnyAndTypeNullSchema = { - type: 'object', - properties: { - propA: { - type: 'object', - anyOf: [ - { - items: { - anyOf: [ - { - '$ref': '#/components/schemas/ModelWithDictionary' - }, - { - type: 'null' - } - ] - }, - type: 'array' - }, - { - items: { - anyOf: [ - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - type: 'null' - } - ] - }, - type: 'array' - } - ] - } - } -} as const; - -export const _3e_num_1ПериодSchema = { - enum: ['Bird', 'Dog'], - type: 'string' -} as const; - -export const ConstValueSchema = { - type: 'string', - const: 'ConstValue' -} as const; - -export const CompositionWithNestedAnyOfAndNullSchema = { - type: 'object', - properties: { - propA: { - anyOf: [ - { - items: { - anyOf: [ - { - '$ref': '#/components/schemas/3e-num_1Период' - }, - { - '$ref': '#/components/schemas/ConstValue' - } - ] - }, - type: 'array' - }, - { - type: 'null' - } - ] - } - } -} as const; - -export const CompositionWithOneOfAndNullableSchema = { - type: 'object', - properties: { - propA: { - nullable: true, - type: 'object', - oneOf: [ - { - type: 'object', - properties: { - boolean: { - type: 'boolean' - } - } - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const CompositionWithOneOfAndSimpleDictionarySchema = { - type: 'object', - properties: { - propA: { - oneOf: [ - { - type: 'boolean' - }, - { - type: 'object', - additionalProperties: { - type: 'number' - } - } - ] - } - } -} as const; - -export const CompositionWithOneOfAndSimpleArrayDictionarySchema = { - type: 'object', - properties: { - propA: { - oneOf: [ - { - type: 'boolean' - }, - { - type: 'object', - additionalProperties: { - type: 'array', - items: { - type: 'boolean' - } - } - } - ] - } - } -} as const; - -export const CompositionWithOneOfAndComplexArrayDictionarySchema = { - type: 'object', - properties: { - propA: { - oneOf: [ - { - type: 'boolean' - }, - { - type: 'object', - additionalProperties: { - type: 'array', - items: { - oneOf: [ - { - type: 'number' - }, - { - type: 'string' - } - ] - } - } - } - ] - } - } -} as const; - -export const CompositionWithAllOfAndNullableSchema = { - type: 'object', - properties: { - propA: { - nullable: true, - type: 'object', - allOf: [ - { - type: 'object', - properties: { - boolean: { - type: 'boolean' - } - } - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const CompositionWithAnyOfAndNullableSchema = { - type: 'object', - properties: { - propA: { - nullable: true, - type: 'object', - anyOf: [ - { - type: 'object', - properties: { - boolean: { - type: 'boolean' - } - } - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const CompositionBaseModelSchema = { - type: 'object', - properties: { - firstName: { - type: 'string' - }, - lastname: { - type: 'string' - } - } -} as const; - -export const CompositionExtendedModelSchema = { - type: 'object', - allOf: [ - { - '$ref': '#/components/schemas/CompositionBaseModel' - } - ], - properties: { - age: { - type: 'number' - } - }, - required: ['firstName', 'lastname', 'age'] -} as const; - -export const ModelWithPropertiesSchema = { - type: 'object', - required: ['required', 'requiredAndReadOnly', 'requiredAndNullable'], - properties: { - required: { - type: 'string' - }, - requiredAndReadOnly: { - type: 'string', - readOnly: true - }, - requiredAndNullable: { - type: 'string', - nullable: true - }, - string: { - type: 'string' - }, - number: { - type: 'number' - }, - boolean: { - type: 'boolean' - }, - reference: { - '$ref': '#/components/schemas/ModelWithString' - }, - 'property with space': { - type: 'string' - }, - default: { - type: 'string' - }, - try: { - type: 'string' - }, - '@namespace.string': { - type: 'string', - readOnly: true - }, - '@namespace.integer': { - type: 'integer', - readOnly: true - } - } -} as const; - -export const ModelWithNestedPropertiesSchema = { - type: 'object', - required: ['first'], - properties: { - first: { - type: 'object', - required: ['second'], - readOnly: true, - nullable: true, - properties: { - second: { - type: 'object', - required: ['third'], - readOnly: true, - nullable: true, - properties: { - third: { - type: 'string', - required: true, - readOnly: true, - nullable: true - } - } - } - } - } - } -} as const; - -export const ModelWithDuplicatePropertiesSchema = { - type: 'object', - properties: { - prop: { - '$ref': '#/components/schemas/ModelWithString' - } - } -} as const; - -export const ModelWithOrderedPropertiesSchema = { - type: 'object', - properties: { - zebra: { - type: 'string' - }, - apple: { - type: 'string' - }, - hawaii: { - type: 'string' - } - } -} as const; - -export const ModelWithDuplicateImportsSchema = { - type: 'object', - properties: { - propA: { - '$ref': '#/components/schemas/ModelWithString' - }, - propB: { - '$ref': '#/components/schemas/ModelWithString' - }, - propC: { - '$ref': '#/components/schemas/ModelWithString' - } - } -} as const; - -export const ModelThatExtendsSchema = { - type: 'object', - allOf: [ - { - '$ref': '#/components/schemas/ModelWithString' - }, - { - type: 'object', - properties: { - propExtendsA: { - type: 'string' - }, - propExtendsB: { - '$ref': '#/components/schemas/ModelWithString' - } - } - } - ] -} as const; - -export const ModelThatExtendsExtendsSchema = { - type: 'object', - allOf: [ - { - '$ref': '#/components/schemas/ModelWithString' - }, - { - '$ref': '#/components/schemas/ModelThatExtends' - }, - { - type: 'object', - properties: { - propExtendsC: { - type: 'string' - }, - propExtendsD: { - '$ref': '#/components/schemas/ModelWithString' - } - } - } - ] -} as const; - -export const ModelWithPatternSchema = { - type: 'object', - required: ['key', 'name'], - properties: { - key: { - maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$', - type: 'string' - }, - name: { - maxLength: 255, - type: 'string' - }, - enabled: { - type: 'boolean', - readOnly: true - }, - modified: { - type: 'string', - format: 'date-time', - readOnly: true - }, - id: { - type: 'string', - pattern: '^\\d{2}-\\d{3}-\\d{4}$' - }, - text: { - type: 'string', - pattern: '^\\w+$' - }, - patternWithSingleQuotes: { - type: 'string', - pattern: "^[a-zA-Z0-9']*$" - }, - patternWithNewline: { - type: 'string', - pattern: 'aaa\\nbbb' - }, - patternWithBacktick: { - type: 'string', - pattern: 'aaa`bbb' - } - } -} as const; - -export const FileSchema = { - required: ['mime'], - type: 'object', - properties: { - id: { - type: 'string', - readOnly: true, - minLength: 1 - }, - updated_at: { - type: 'string', - format: 'date-time', - readOnly: true - }, - created_at: { - type: 'string', - format: 'date-time', - readOnly: true - }, - mime: { - type: 'string', - maxLength: 24, - minLength: 1 - }, - file: { - type: 'string', - readOnly: true, - format: 'uri' - } - } -} as const; - -export const defaultSchema = { - type: 'object', - properties: { - name: { - type: 'string' - } - } -} as const; - -export const PageableSchema = { - type: 'object', - properties: { - page: { - minimum: 0, - type: 'integer', - format: 'int32', - default: 0 - }, - size: { - minimum: 1, - type: 'integer', - format: 'int32' - }, - sort: { - type: 'array', - items: { - type: 'string' - } - } - } -} as const; - -export const FreeFormObjectWithoutAdditionalPropertiesSchema = { - type: 'object' -} as const; - -export const FreeFormObjectWithAdditionalPropertiesEqTrueSchema = { - type: 'object', - additionalProperties: true -} as const; - -export const FreeFormObjectWithAdditionalPropertiesEqEmptyObjectSchema = { - type: 'object', - additionalProperties: {} -} as const; - -export const ModelWithConstSchema = { - type: 'object', - properties: { - String: { - const: 'String' - }, - number: { - const: 0 - }, - null: { - const: null - }, - withType: { - type: 'string', - const: 'Some string' - } - } -} as const; - -export const ModelWithAdditionalPropertiesEqTrueSchema = { - type: 'object', - properties: { - prop: { - type: 'string' - } - }, - additionalProperties: true -} as const; - -export const NestedAnyOfArraysNullableSchema = { - properties: { - nullableArray: { - anyOf: [ - { - items: { - anyOf: [ - { - type: 'string' - }, - { - type: 'boolean' - } - ] - }, - type: 'array' - }, - { - type: 'null' - } - ] - } - }, - type: 'object' -} as const; - -export const CompositionWithOneOfAndPropertiesSchema = { - type: 'object', - oneOf: [ - { - type: 'object', - required: ['foo'], - properties: { - foo: { - '$ref': '#/components/parameters/SimpleParameter' - } - }, - additionalProperties: false - }, - { - type: 'object', - required: ['bar'], - properties: { - bar: { - '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' - } - }, - additionalProperties: false - } - ], - required: ['baz', 'qux'], - properties: { - baz: { - type: 'integer', - format: 'uint16', - minimum: 0, - nullable: true - }, - qux: { - type: 'integer', - format: 'uint8', - minimum: 0 - } - } -} as const; - -export const NullableObjectSchema = { - type: ['object', 'null'], - properties: { - foo: { - type: 'string' - } - }, - default: null -} as const; - -export const CharactersInDescriptionSchema = { - type: 'string' -} as const; - -export const ModelWithNullableObjectSchema = { - type: 'object', - properties: { - data: { - '$ref': '#/components/schemas/NullableObject' - } - } -} as const; - -export const ModelWithOneOfEnumSchema = { - oneOf: [ - { - type: 'object', - required: ['foo'], - properties: { - foo: { - type: 'string', - enum: ['Bar'] - } - } - }, - { - type: 'object', - required: ['foo'], - properties: { - foo: { - type: 'string', - enum: ['Baz'] - } - } - }, - { - type: 'object', - required: ['foo'], - properties: { - foo: { - type: 'string', - enum: ['Qux'] - } - } - }, - { - type: 'object', - required: ['content', 'foo'], - properties: { - content: { - type: 'string', - format: 'date-time' - }, - foo: { - type: 'string', - enum: ['Quux'] - } - } - }, - { - type: 'object', - required: ['content', 'foo'], - properties: { - content: { - type: 'array', - items: [ - { - type: 'string', - format: 'date-time' - }, - { - type: 'string' - } - ], - maxItems: 2, - minItems: 2 - }, - foo: { - type: 'string', - enum: ['Corge'] - } - } - } - ] -} as const; - -export const ModelWithNestedArrayEnumsDataFooSchema = { - enum: ['foo', 'bar'], - type: 'string' -} as const; - -export const ModelWithNestedArrayEnumsDataBarSchema = { - enum: ['baz', 'qux'], - type: 'string' -} as const; - -export const ModelWithNestedArrayEnumsDataSchema = { - type: 'object', - properties: { - foo: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' - } - }, - bar: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataBar' - } - } - } -} as const; - -export const ModelWithNestedArrayEnumsSchema = { - type: 'object', - properties: { - array_strings: { - type: 'array', - items: { - type: 'string' - } - }, - data: { - allOf: [ - { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsData' - } - ] - } - } -} as const; - -export const ModelWithNestedCompositionEnumsSchema = { - type: 'object', - properties: { - foo: { - allOf: [ - { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' - } - ] - } - } -} as const; - -export const ModelWithReadOnlyAndWriteOnlySchema = { - type: 'object', - required: ['foo', 'bar', 'baz'], - properties: { - foo: { - type: 'string' - }, - bar: { - readOnly: true, - type: 'string' - }, - baz: { - type: 'string', - writeOnly: true - } - } -} as const; - -export const ModelWithConstantSizeArraySchema = { - type: 'array', - items: { - type: 'number' - }, - minItems: 2, - maxItems: 2 -} as const; - -export const ModelWithAnyOfConstantSizeArraySchema = { - type: 'array', - items: { - oneOf: [ - { - type: 'number' - }, - { - type: 'string' - } - ] - }, - minItems: 3, - maxItems: 3 -} as const; - -export const ModelWithPrefixItemsConstantSizeArraySchema = { - type: 'array', - prefixItems: [ - { - '$ref': '#/components/schemas/ModelWithInteger' - }, - { - oneOf: [ - { - type: 'number' - }, - { - type: 'string' - } - ] - }, - { - type: 'string' - } - ] -} as const; - -export const ModelWithAnyOfConstantSizeArrayNullableSchema = { - type: ['array'], - items: { - oneOf: [ - { - type: 'number', - nullable: true - }, - { - type: 'string' - } - ] - }, - minItems: 3, - maxItems: 3 -} as const; - -export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsSchema = { - type: 'array', - items: { - oneOf: [ - { - type: 'number' - }, - { - '$ref': '#/components/schemas/import' - } - ] - }, - minItems: 2, - maxItems: 2 -} as const; - -export const ModelWithAnyOfConstantSizeArrayAndIntersectSchema = { - type: 'array', - items: { - allOf: [ - { - type: 'number' - }, - { - type: 'string' - } - ] - }, - minItems: 2, - maxItems: 2 -} as const; - -export const ModelWithNumericEnumUnionSchema = { - type: 'object', - properties: { - value: { - type: 'number', - enum: [-10, -1, 0, 1, 3, 6, 12] - } - } -} as const; - -export const ModelWithBackticksInDescriptionSchema = { - type: 'object', - properties: { - template: { - type: 'string' - } - } -} as const; - -export const ModelWithOneOfAndPropertiesSchema = { - type: 'object', - oneOf: [ - { - '$ref': '#/components/parameters/SimpleParameter' - }, - { - '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' - } - ], - required: ['baz', 'qux'], - properties: { - baz: { - type: 'integer', - format: 'uint16', - minimum: 0, - nullable: true - }, - qux: { - type: 'integer', - format: 'uint8', - minimum: 0 - } - } -} as const; - -export const ParameterSimpleParameterUnusedSchema = { - type: 'string' -} as const; - -export const PostServiceWithEmptyTagResponseSchema = { - type: 'string' -} as const; - -export const PostServiceWithEmptyTagResponse2Schema = { - type: 'string' -} as const; - -export const DeleteFooDataSchema = { - type: 'string' -} as const; - -export const DeleteFooData2Schema = { - type: 'string' -} as const; - -export const importSchema = { - type: 'string' -} as const; - -export const SchemaWithFormRestrictedKeysSchema = { - properties: { - description: { - type: 'string' - }, - 'x-enum-descriptions': { - type: 'string' - }, - 'x-enum-varnames': { - type: 'string' - }, - 'x-enumNames': { - type: 'string' - }, - title: { - type: 'string' - }, - object: { - type: 'object', - properties: { - description: { - type: 'string' - }, - 'x-enum-descriptions': { - type: 'string' - }, - 'x-enum-varnames': { - type: 'string' - }, - 'x-enumNames': { - type: 'string' - }, - title: { - type: 'string' - } - } - }, - array: { - type: 'array', - items: [ - { - type: 'object', - properties: { - description: { - type: 'string' - }, - 'x-enum-descriptions': { - type: 'string' - }, - 'x-enum-varnames': { - type: 'string' - }, - 'x-enumNames': { - type: 'string' - }, - title: { - type: 'string' - } - } - } - ] - } - } -} as const; - -export const io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptionsSchema = { - properties: { - preconditions: { - allOf: [ - { - '$ref': '#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions' - } - ] - } - }, - type: 'object' -} as const; - -export const io_k8s_apimachinery_pkg_apis_meta_v1_PreconditionsSchema = { - properties: { - resourceVersion: { - type: 'string' - }, - uid: { - type: 'string' - } - }, - type: 'object' -} as const; - -export const AdditionalPropertiesUnknownIssueSchema = { - type: 'object', - properties: {}, - additionalProperties: { - anyOf: [ - { - type: 'string' - }, - { - type: 'number' - } - ] - } -} as const; - -export const AdditionalPropertiesUnknownIssue2Schema = { - type: 'object', - additionalProperties: { - anyOf: [ - { - type: 'string' - }, - { - type: 'number' - } - ] - } -} as const; - -export const AdditionalPropertiesUnknownIssue3Schema = { - type: 'object', - allOf: [ - { - type: 'string' - }, - { - type: 'object', - required: ['entries'], - properties: { - entries: { - additionalProperties: { - '$ref': '#/components/schemas/AdditionalPropertiesUnknownIssue' - } - } - } - } - ] -} as const; - -export const AdditionalPropertiesIntegerIssueSchema = { - type: 'object', - required: ['value'], - properties: { - value: { - type: 'integer' - } - }, - additionalProperties: { - type: 'integer' - } -} as const; - -export const OneOfAllOfIssueSchema = { - oneOf: [ - { - allOf: [ - { - oneOf: [ - { - '$ref': '#/components/schemas/ConstValue' - }, - { - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]' - } - ] - }, - { - '$ref': '#/components/schemas/3e-num_1Период' - } - ] - }, - { - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]' - } - ] -} as const; - -export const Generic_Schema_Duplicate_Issue_1_System_Boolean_Schema = { - type: 'object', - properties: { - item: { - type: 'boolean' - }, - error: { - type: 'string', - nullable: true - }, - hasError: { - type: 'boolean', - readOnly: true - }, - data: { - type: 'object', - properties: {}, - additionalProperties: false - } - }, - additionalProperties: false -} as const; - -export const Generic_Schema_Duplicate_Issue_1_System_String_Schema = { - type: 'object', - properties: { - item: { - type: 'string', - nullable: true - }, - error: { - type: 'string', - nullable: true - }, - hasError: { - type: 'boolean', - readOnly: true - } - }, - additionalProperties: false -} as const; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3-schemas-json/schemas.gen.ts b/packages/openapi-ts-tests/test/generated/v3-schemas-json/schemas.gen.ts deleted file mode 100644 index 5f65189a2..000000000 --- a/packages/openapi-ts-tests/test/generated/v3-schemas-json/schemas.gen.ts +++ /dev/null @@ -1,1994 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export const _400Schema = { - description: 'Model with number-only name', - type: 'string' -} as const; - -export const camelCaseCommentWithBreaksSchema = { - description: `Testing multiline comments in string: First line -Second line - -Fourth line`, - type: 'integer' -} as const; - -export const CommentWithBreaksSchema = { - description: `Testing multiline comments in string: First line -Second line - -Fourth line`, - type: 'integer' -} as const; - -export const CommentWithBackticksSchema = { - description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work', - type: 'integer' -} as const; - -export const CommentWithBackticksAndQuotesSchema = { - description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`, - type: 'integer' -} as const; - -export const CommentWithSlashesSchema = { - description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work', - type: 'integer' -} as const; - -export const CommentWithExpressionPlaceholdersSchema = { - description: 'Testing expression placeholders in string: ${expression} should work', - type: 'integer' -} as const; - -export const CommentWithQuotesSchema = { - description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`, - type: 'integer' -} as const; - -export const CommentWithReservedCharactersSchema = { - description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work', - type: 'integer' -} as const; - -export const SimpleIntegerSchema = { - description: 'This is a simple number', - type: 'integer' -} as const; - -export const SimpleBooleanSchema = { - description: 'This is a simple boolean', - type: 'boolean' -} as const; - -export const SimpleStringSchema = { - description: 'This is a simple string', - type: 'string' -} as const; - -export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = { - description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)', - type: 'string' -} as const; - -export const SimpleFileSchema = { - description: 'This is a simple file', - type: 'file' -} as const; - -export const SimpleReferenceSchema = { - description: 'This is a simple reference', - '$ref': '#/components/schemas/ModelWithString' -} as const; - -export const SimpleStringWithPatternSchema = { - description: 'This is a simple string', - type: 'string', - nullable: true, - maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$' -} as const; - -export const EnumWithStringsSchema = { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串'] -} as const; - -export const EnumWithReplacedCharactersSchema = { - enum: ["'Single Quote'", '"Double Quotes"', 'øæåôöØÆÅÔÖ字符串', 3.1, ''], - type: 'string' -} as const; - -export const EnumWithNumbersSchema = { - description: 'This is a simple enum with numbers', - enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3], - default: 200 -} as const; - -export const EnumFromDescriptionSchema = { - description: 'Success=1,Warning=2,Error=3', - type: 'number' -} as const; - -export const EnumWithExtensionsSchema = { - description: 'This is a simple enum with numbers', - enum: [200, 400, 500], - 'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'], - 'x-enum-descriptions': ['Used when the status of something is successful', 'Used when the status of something has a warning', 'Used when the status of something has an error'] -} as const; - -export const EnumWithXEnumNamesSchema = { - enum: [0, 1, 2], - 'x-enumNames': ['zero', 'one', 'two'] -} as const; - -export const ArrayWithNumbersSchema = { - description: 'This is a simple array with numbers', - type: 'array', - items: { - type: 'integer' - } -} as const; - -export const ArrayWithBooleansSchema = { - description: 'This is a simple array with booleans', - type: 'array', - items: { - type: 'boolean' - } -} as const; - -export const ArrayWithStringsSchema = { - description: 'This is a simple array with strings', - type: 'array', - items: { - type: 'string' - }, - default: ['test'] -} as const; - -export const ArrayWithReferencesSchema = { - description: 'This is a simple array with references', - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithString' - } -} as const; - -export const ArrayWithArraySchema = { - description: 'This is a simple array containing an array', - type: 'array', - items: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithString' - } - } -} as const; - -export const ArrayWithPropertiesSchema = { - description: 'This is a simple array with properties', - type: 'array', - items: { - type: 'object', - properties: { - '16x16': { - '$ref': '#/components/schemas/camelCaseCommentWithBreaks' - }, - bar: { - type: 'string' - } - } - } -} as const; - -export const ArrayWithAnyOfPropertiesSchema = { - description: 'This is a simple array with any of properties', - type: 'array', - items: { - anyOf: [ - { - type: 'object', - properties: { - foo: { - type: 'string', - default: 'test' - } - } - }, - { - type: 'object', - properties: { - bar: { - type: 'string' - } - } - } - ] - } -} as const; - -export const AnyOfAnyAndNullSchema = { - type: 'object', - properties: { - data: { - anyOf: [ - {}, - { - type: 'null' - } - ] - } - } -} as const; - -export const AnyOfArraysSchema = { - description: 'This is a simple array with any of properties', - type: 'object', - properties: { - results: { - items: { - anyOf: [ - { - type: 'object', - properties: { - foo: { - type: 'string' - } - } - }, - { - type: 'object', - properties: { - bar: { - type: 'string' - } - } - } - ] - }, - type: 'array' - } - } -} as const; - -export const DictionaryWithStringSchema = { - description: 'This is a string dictionary', - type: 'object', - additionalProperties: { - type: 'string' - } -} as const; - -export const DictionaryWithPropertiesAndAdditionalPropertiesSchema = { - type: 'object', - properties: { - foo: { - type: 'number' - }, - bar: { - type: 'boolean' - } - }, - additionalProperties: { - type: 'string' - } -} as const; - -export const DictionaryWithReferenceSchema = { - description: 'This is a string reference', - type: 'object', - additionalProperties: { - '$ref': '#/components/schemas/ModelWithString' - } -} as const; - -export const DictionaryWithArraySchema = { - description: 'This is a complex dictionary', - type: 'object', - additionalProperties: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithString' - } - } -} as const; - -export const DictionaryWithDictionarySchema = { - description: 'This is a string dictionary', - type: 'object', - additionalProperties: { - type: 'object', - additionalProperties: { - type: 'string' - } - } -} as const; - -export const DictionaryWithPropertiesSchema = { - description: 'This is a complex dictionary', - type: 'object', - additionalProperties: { - type: 'object', - properties: { - foo: { - type: 'string' - }, - bar: { - type: 'string' - } - } - } -} as const; - -export const ModelWithIntegerSchema = { - description: 'This is a model with one number property', - type: 'object', - properties: { - prop: { - description: 'This is a simple number property', - type: 'integer' - } - } -} as const; - -export const ModelWithBooleanSchema = { - description: 'This is a model with one boolean property', - type: 'object', - properties: { - prop: { - description: 'This is a simple boolean property', - type: 'boolean' - } - } -} as const; - -export const ModelWithStringSchema = { - description: 'This is a model with one string property', - type: 'object', - properties: { - prop: { - description: 'This is a simple string property', - type: 'string' - } - } -} as const; - -export const ModelWithStringErrorSchema = { - description: 'This is a model with one string property', - type: 'object', - properties: { - prop: { - description: 'This is a simple string property', - type: 'string' - } - } -} as const; - -export const Model_From_ZendeskSchema = { - description: `\`Comment\` or \`VoiceComment\`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets)`, - type: 'string' -} as const; - -export const ModelWithNullableStringSchema = { - description: 'This is a model with one string property', - type: 'object', - required: ['nullableRequiredProp1', 'nullableRequiredProp2'], - properties: { - nullableProp1: { - description: 'This is a simple string property', - type: 'string', - nullable: true - }, - nullableRequiredProp1: { - description: 'This is a simple string property', - type: 'string', - nullable: true - }, - nullableProp2: { - description: 'This is a simple string property', - type: ['string', 'null'] - }, - nullableRequiredProp2: { - description: 'This is a simple string property', - type: ['string', 'null'] - }, - 'foo_bar-enum': { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] - } - } -} as const; - -export const ModelWithEnumSchema = { - description: 'This is a model with one enum', - type: 'object', - properties: { - 'foo_bar-enum': { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] - }, - statusCode: { - description: 'These are the HTTP error code enums', - enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar'] - }, - bool: { - description: 'Simple boolean enum', - type: 'boolean', - enum: [true] - } - } -} as const; - -export const ModelWithEnumWithHyphenSchema = { - description: 'This is a model with one enum with escaped name', - type: 'object', - properties: { - 'foo-bar-baz-qux': { - type: 'string', - enum: ['3.0'], - title: 'Foo-Bar-Baz-Qux', - default: '3.0' - } - } -} as const; - -export const ModelWithEnumFromDescriptionSchema = { - description: 'This is a model with one enum', - type: 'object', - properties: { - test: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' - } - } -} as const; - -export const ModelWithNestedEnumsSchema = { - description: 'This is a model with nested enums', - type: 'object', - properties: { - dictionaryWithEnum: { - type: 'object', - additionalProperties: { - enum: ['Success', 'Warning', 'Error'] - } - }, - dictionaryWithEnumFromDescription: { - type: 'object', - additionalProperties: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' - } - }, - arrayWithEnum: { - type: 'array', - items: { - enum: ['Success', 'Warning', 'Error'] - } - }, - arrayWithDescription: { - type: 'array', - items: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' - } - }, - 'foo_bar-enum': { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] - } - } -} as const; - -export const ModelWithReferenceSchema = { - description: 'This is a model with one property containing a reference', - type: 'object', - properties: { - prop: { - '$ref': '#/components/schemas/ModelWithProperties' - } - } -} as const; - -export const ModelWithArrayReadOnlyAndWriteOnlySchema = { - description: 'This is a model with one property containing an array', - type: 'object', - properties: { - prop: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnly' - } - }, - propWithFile: { - type: 'array', - items: { - type: 'file' - } - }, - propWithNumber: { - type: 'array', - items: { - type: 'number' - } - } - } -} as const; - -export const ModelWithArraySchema = { - description: 'This is a model with one property containing an array', - type: 'object', - properties: { - prop: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithString' - } - }, - propWithFile: { - type: 'array', - items: { - type: 'file' - } - }, - propWithNumber: { - type: 'array', - items: { - type: 'number' - } - } - } -} as const; - -export const ModelWithDictionarySchema = { - description: 'This is a model with one property containing a dictionary', - type: 'object', - properties: { - prop: { - type: 'object', - additionalProperties: { - type: 'string' - } - } - } -} as const; - -export const DeprecatedModelSchema = { - deprecated: true, - description: 'This is a deprecated model with a deprecated property', - type: 'object', - properties: { - prop: { - deprecated: true, - description: 'This is a deprecated property', - type: 'string' - } - } -} as const; - -export const ModelWithCircularReferenceSchema = { - description: 'This is a model with one property containing a circular reference', - type: 'object', - properties: { - prop: { - '$ref': '#/components/schemas/ModelWithCircularReference' - } - } -} as const; - -export const CompositionWithOneOfSchema = { - description: "This is a model with one property with a 'one of' relationship", - type: 'object', - properties: { - propA: { - type: 'object', - oneOf: [ - { - '$ref': '#/components/schemas/ModelWithString' - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const CompositionWithOneOfAnonymousSchema = { - description: "This is a model with one property with a 'one of' relationship where the options are not $ref", - type: 'object', - properties: { - propA: { - type: 'object', - oneOf: [ - { - description: 'Anonymous object type', - type: 'object', - properties: { - propA: { - type: 'string' - } - } - }, - { - description: 'Anonymous string type', - type: 'string' - }, - { - description: 'Anonymous integer type', - type: 'integer' - } - ] - } - } -} as const; - -export const ModelCircleSchema = { - description: 'Circle', - type: 'object', - required: ['kind'], - properties: { - kind: { - type: 'string' - }, - radius: { - type: 'number' - } - } -} as const; - -export const ModelSquareSchema = { - description: 'Square', - type: 'object', - required: ['kind'], - properties: { - kind: { - type: 'string' - }, - sideLength: { - type: 'number' - } - } -} as const; - -export const CompositionWithOneOfDiscriminatorSchema = { - description: "This is a model with one property with a 'one of' relationship where the options are not $ref", - type: 'object', - oneOf: [ - { - '$ref': '#/components/schemas/ModelCircle' - }, - { - '$ref': '#/components/schemas/ModelSquare' - } - ], - discriminator: { - propertyName: 'kind', - mapping: { - circle: '#/components/schemas/ModelCircle', - square: '#/components/schemas/ModelSquare' - } - } -} as const; - -export const CompositionWithAnyOfSchema = { - description: "This is a model with one property with a 'any of' relationship", - type: 'object', - properties: { - propA: { - type: 'object', - anyOf: [ - { - '$ref': '#/components/schemas/ModelWithString' - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const CompositionWithAnyOfAnonymousSchema = { - description: "This is a model with one property with a 'any of' relationship where the options are not $ref", - type: 'object', - properties: { - propA: { - type: 'object', - anyOf: [ - { - description: 'Anonymous object type', - type: 'object', - properties: { - propA: { - type: 'string' - } - } - }, - { - description: 'Anonymous string type', - type: 'string' - }, - { - description: 'Anonymous integer type', - type: 'integer' - } - ] - } - } -} as const; - -export const CompositionWithNestedAnyAndTypeNullSchema = { - description: "This is a model with nested 'any of' property with a type null", - type: 'object', - properties: { - propA: { - type: 'object', - anyOf: [ - { - items: { - anyOf: [ - { - '$ref': '#/components/schemas/ModelWithDictionary' - }, - { - type: 'null' - } - ] - }, - type: 'array' - }, - { - items: { - anyOf: [ - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - type: 'null' - } - ] - }, - type: 'array' - } - ] - } - } -} as const; - -export const _3e_num_1ПериодSchema = { - enum: ['Bird', 'Dog'], - type: 'string' -} as const; - -export const ConstValueSchema = { - type: 'string', - const: 'ConstValue' -} as const; - -export const CompositionWithNestedAnyOfAndNullSchema = { - description: "This is a model with one property with a 'any of' relationship where the options are not $ref", - type: 'object', - properties: { - propA: { - anyOf: [ - { - items: { - anyOf: [ - { - '$ref': '#/components/schemas/3e-num_1Период' - }, - { - '$ref': '#/components/schemas/ConstValue' - } - ] - }, - type: 'array' - }, - { - type: 'null' - } - ], - title: 'Scopes' - } - } -} as const; - -export const CompositionWithOneOfAndNullableSchema = { - description: "This is a model with one property with a 'one of' relationship", - type: 'object', - properties: { - propA: { - nullable: true, - type: 'object', - oneOf: [ - { - type: 'object', - properties: { - boolean: { - type: 'boolean' - } - } - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const CompositionWithOneOfAndSimpleDictionarySchema = { - description: 'This is a model that contains a simple dictionary within composition', - type: 'object', - properties: { - propA: { - oneOf: [ - { - type: 'boolean' - }, - { - type: 'object', - additionalProperties: { - type: 'number' - } - } - ] - } - } -} as const; - -export const CompositionWithOneOfAndSimpleArrayDictionarySchema = { - description: 'This is a model that contains a dictionary of simple arrays within composition', - type: 'object', - properties: { - propA: { - oneOf: [ - { - type: 'boolean' - }, - { - type: 'object', - additionalProperties: { - type: 'array', - items: { - type: 'boolean' - } - } - } - ] - } - } -} as const; - -export const CompositionWithOneOfAndComplexArrayDictionarySchema = { - description: 'This is a model that contains a dictionary of complex arrays (composited) within composition', - type: 'object', - properties: { - propA: { - oneOf: [ - { - type: 'boolean' - }, - { - type: 'object', - additionalProperties: { - type: 'array', - items: { - oneOf: [ - { - type: 'number' - }, - { - type: 'string' - } - ] - } - } - } - ] - } - } -} as const; - -export const CompositionWithAllOfAndNullableSchema = { - description: "This is a model with one property with a 'all of' relationship", - type: 'object', - properties: { - propA: { - nullable: true, - type: 'object', - allOf: [ - { - type: 'object', - properties: { - boolean: { - type: 'boolean' - } - } - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const CompositionWithAnyOfAndNullableSchema = { - description: "This is a model with one property with a 'any of' relationship", - type: 'object', - properties: { - propA: { - nullable: true, - type: 'object', - anyOf: [ - { - type: 'object', - properties: { - boolean: { - type: 'boolean' - } - } - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const CompositionBaseModelSchema = { - description: 'This is a base model with two simple optional properties', - type: 'object', - properties: { - firstName: { - type: 'string' - }, - lastname: { - type: 'string' - } - } -} as const; - -export const CompositionExtendedModelSchema = { - description: 'This is a model that extends the base model', - type: 'object', - allOf: [ - { - '$ref': '#/components/schemas/CompositionBaseModel' - } - ], - properties: { - age: { - type: 'number' - } - }, - required: ['firstName', 'lastname', 'age'] -} as const; - -export const ModelWithPropertiesSchema = { - description: 'This is a model with one nested property', - type: 'object', - required: ['required', 'requiredAndReadOnly', 'requiredAndNullable'], - properties: { - required: { - type: 'string' - }, - requiredAndReadOnly: { - type: 'string', - readOnly: true - }, - requiredAndNullable: { - type: 'string', - nullable: true - }, - string: { - type: 'string' - }, - number: { - type: 'number' - }, - boolean: { - type: 'boolean' - }, - reference: { - '$ref': '#/components/schemas/ModelWithString' - }, - 'property with space': { - type: 'string' - }, - default: { - type: 'string' - }, - try: { - type: 'string' - }, - '@namespace.string': { - type: 'string', - readOnly: true - }, - '@namespace.integer': { - type: 'integer', - readOnly: true - } - } -} as const; - -export const ModelWithNestedPropertiesSchema = { - description: 'This is a model with one nested property', - type: 'object', - required: ['first'], - properties: { - first: { - type: 'object', - required: ['second'], - readOnly: true, - nullable: true, - properties: { - second: { - type: 'object', - required: ['third'], - readOnly: true, - nullable: true, - properties: { - third: { - type: 'string', - required: true, - readOnly: true, - nullable: true - } - } - } - } - } - } -} as const; - -export const ModelWithDuplicatePropertiesSchema = { - description: 'This is a model with duplicated properties', - type: 'object', - properties: { - prop: { - '$ref': '#/components/schemas/ModelWithString' - } - } -} as const; - -export const ModelWithOrderedPropertiesSchema = { - description: 'This is a model with ordered properties', - type: 'object', - properties: { - zebra: { - type: 'string' - }, - apple: { - type: 'string' - }, - hawaii: { - type: 'string' - } - } -} as const; - -export const ModelWithDuplicateImportsSchema = { - description: 'This is a model with duplicated imports', - type: 'object', - properties: { - propA: { - '$ref': '#/components/schemas/ModelWithString' - }, - propB: { - '$ref': '#/components/schemas/ModelWithString' - }, - propC: { - '$ref': '#/components/schemas/ModelWithString' - } - } -} as const; - -export const ModelThatExtendsSchema = { - description: 'This is a model that extends another model', - type: 'object', - allOf: [ - { - '$ref': '#/components/schemas/ModelWithString' - }, - { - type: 'object', - properties: { - propExtendsA: { - type: 'string' - }, - propExtendsB: { - '$ref': '#/components/schemas/ModelWithString' - } - } - } - ] -} as const; - -export const ModelThatExtendsExtendsSchema = { - description: 'This is a model that extends another model', - type: 'object', - allOf: [ - { - '$ref': '#/components/schemas/ModelWithString' - }, - { - '$ref': '#/components/schemas/ModelThatExtends' - }, - { - type: 'object', - properties: { - propExtendsC: { - type: 'string' - }, - propExtendsD: { - '$ref': '#/components/schemas/ModelWithString' - } - } - } - ] -} as const; - -export const ModelWithPatternSchema = { - description: 'This is a model that contains a some patterns', - type: 'object', - required: ['key', 'name'], - properties: { - key: { - maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$', - type: 'string' - }, - name: { - maxLength: 255, - type: 'string' - }, - enabled: { - type: 'boolean', - readOnly: true - }, - modified: { - type: 'string', - format: 'date-time', - readOnly: true - }, - id: { - type: 'string', - pattern: '^\\d{2}-\\d{3}-\\d{4}$' - }, - text: { - type: 'string', - pattern: '^\\w+$' - }, - patternWithSingleQuotes: { - type: 'string', - pattern: "^[a-zA-Z0-9']*$" - }, - patternWithNewline: { - type: 'string', - pattern: 'aaa\\nbbb' - }, - patternWithBacktick: { - type: 'string', - pattern: 'aaa`bbb' - } - } -} as const; - -export const FileSchema = { - required: ['mime'], - type: 'object', - properties: { - id: { - title: 'Id', - type: 'string', - readOnly: true, - minLength: 1 - }, - updated_at: { - title: 'Updated at', - type: 'string', - format: 'date-time', - readOnly: true - }, - created_at: { - title: 'Created at', - type: 'string', - format: 'date-time', - readOnly: true - }, - mime: { - title: 'Mime', - type: 'string', - maxLength: 24, - minLength: 1 - }, - file: { - title: 'File', - type: 'string', - readOnly: true, - format: 'uri' - } - } -} as const; - -export const defaultSchema = { - type: 'object', - properties: { - name: { - type: 'string' - } - } -} as const; - -export const PageableSchema = { - type: 'object', - properties: { - page: { - minimum: 0, - type: 'integer', - format: 'int32', - default: 0 - }, - size: { - minimum: 1, - type: 'integer', - format: 'int32' - }, - sort: { - type: 'array', - items: { - type: 'string' - } - } - } -} as const; - -export const FreeFormObjectWithoutAdditionalPropertiesSchema = { - description: 'This is a free-form object without additionalProperties.', - type: 'object' -} as const; - -export const FreeFormObjectWithAdditionalPropertiesEqTrueSchema = { - description: 'This is a free-form object with additionalProperties: true.', - type: 'object', - additionalProperties: true -} as const; - -export const FreeFormObjectWithAdditionalPropertiesEqEmptyObjectSchema = { - description: 'This is a free-form object with additionalProperties: {}.', - type: 'object', - additionalProperties: {} -} as const; - -export const ModelWithConstSchema = { - type: 'object', - properties: { - String: { - const: 'String' - }, - number: { - const: 0 - }, - null: { - const: null - }, - withType: { - type: 'string', - const: 'Some string' - } - } -} as const; - -export const ModelWithAdditionalPropertiesEqTrueSchema = { - description: 'This is a model with one property and additionalProperties: true', - type: 'object', - properties: { - prop: { - description: 'This is a simple string property', - type: 'string' - } - }, - additionalProperties: true -} as const; - -export const NestedAnyOfArraysNullableSchema = { - properties: { - nullableArray: { - anyOf: [ - { - items: { - anyOf: [ - { - type: 'string' - }, - { - type: 'boolean' - } - ] - }, - type: 'array' - }, - { - type: 'null' - } - ] - } - }, - type: 'object' -} as const; - -export const CompositionWithOneOfAndPropertiesSchema = { - type: 'object', - oneOf: [ - { - type: 'object', - required: ['foo'], - properties: { - foo: { - '$ref': '#/components/parameters/SimpleParameter' - } - }, - additionalProperties: false - }, - { - type: 'object', - required: ['bar'], - properties: { - bar: { - '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' - } - }, - additionalProperties: false - } - ], - required: ['baz', 'qux'], - properties: { - baz: { - type: 'integer', - format: 'uint16', - minimum: 0, - nullable: true - }, - qux: { - type: 'integer', - format: 'uint8', - minimum: 0 - } - } -} as const; - -export const NullableObjectSchema = { - type: ['object', 'null'], - description: 'An object that can be null', - properties: { - foo: { - type: 'string' - } - }, - default: null -} as const; - -export const CharactersInDescriptionSchema = { - type: 'string', - description: 'Some % character' -} as const; - -export const ModelWithNullableObjectSchema = { - type: 'object', - properties: { - data: { - '$ref': '#/components/schemas/NullableObject' - } - } -} as const; - -export const ModelWithOneOfEnumSchema = { - oneOf: [ - { - type: 'object', - required: ['foo'], - properties: { - foo: { - type: 'string', - enum: ['Bar'] - } - } - }, - { - type: 'object', - required: ['foo'], - properties: { - foo: { - type: 'string', - enum: ['Baz'] - } - } - }, - { - type: 'object', - required: ['foo'], - properties: { - foo: { - type: 'string', - enum: ['Qux'] - } - } - }, - { - type: 'object', - required: ['content', 'foo'], - properties: { - content: { - type: 'string', - format: 'date-time' - }, - foo: { - type: 'string', - enum: ['Quux'] - } - } - }, - { - type: 'object', - required: ['content', 'foo'], - properties: { - content: { - type: 'array', - items: [ - { - type: 'string', - format: 'date-time' - }, - { - type: 'string' - } - ], - maxItems: 2, - minItems: 2 - }, - foo: { - type: 'string', - enum: ['Corge'] - } - } - } - ] -} as const; - -export const ModelWithNestedArrayEnumsDataFooSchema = { - enum: ['foo', 'bar'], - type: 'string' -} as const; - -export const ModelWithNestedArrayEnumsDataBarSchema = { - enum: ['baz', 'qux'], - type: 'string' -} as const; - -export const ModelWithNestedArrayEnumsDataSchema = { - type: 'object', - properties: { - foo: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' - } - }, - bar: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataBar' - } - } - } -} as const; - -export const ModelWithNestedArrayEnumsSchema = { - type: 'object', - properties: { - array_strings: { - type: 'array', - items: { - type: 'string' - } - }, - data: { - allOf: [ - { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsData' - } - ] - } - } -} as const; - -export const ModelWithNestedCompositionEnumsSchema = { - type: 'object', - properties: { - foo: { - allOf: [ - { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' - } - ] - } - } -} as const; - -export const ModelWithReadOnlyAndWriteOnlySchema = { - type: 'object', - required: ['foo', 'bar', 'baz'], - properties: { - foo: { - type: 'string' - }, - bar: { - readOnly: true, - type: 'string' - }, - baz: { - type: 'string', - writeOnly: true - } - } -} as const; - -export const ModelWithConstantSizeArraySchema = { - type: 'array', - items: { - type: 'number' - }, - minItems: 2, - maxItems: 2 -} as const; - -export const ModelWithAnyOfConstantSizeArraySchema = { - type: 'array', - items: { - oneOf: [ - { - type: 'number' - }, - { - type: 'string' - } - ] - }, - minItems: 3, - maxItems: 3 -} as const; - -export const ModelWithPrefixItemsConstantSizeArraySchema = { - type: 'array', - prefixItems: [ - { - '$ref': '#/components/schemas/ModelWithInteger' - }, - { - oneOf: [ - { - type: 'number' - }, - { - type: 'string' - } - ] - }, - { - type: 'string' - } - ] -} as const; - -export const ModelWithAnyOfConstantSizeArrayNullableSchema = { - type: ['array'], - items: { - oneOf: [ - { - type: 'number', - nullable: true - }, - { - type: 'string' - } - ] - }, - minItems: 3, - maxItems: 3 -} as const; - -export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsSchema = { - type: 'array', - items: { - oneOf: [ - { - type: 'number' - }, - { - '$ref': '#/components/schemas/import' - } - ] - }, - minItems: 2, - maxItems: 2 -} as const; - -export const ModelWithAnyOfConstantSizeArrayAndIntersectSchema = { - type: 'array', - items: { - allOf: [ - { - type: 'number' - }, - { - type: 'string' - } - ] - }, - minItems: 2, - maxItems: 2 -} as const; - -export const ModelWithNumericEnumUnionSchema = { - type: 'object', - properties: { - value: { - type: 'number', - description: 'Период', - enum: [-10, -1, 0, 1, 3, 6, 12] - } - } -} as const; - -export const ModelWithBackticksInDescriptionSchema = { - description: 'Some description with `back ticks`', - type: 'object', - properties: { - template: { - type: 'string', - description: `The template \`that\` should be used for parsing and importing the contents of the CSV file. - -

There is one placeholder currently supported:

  • \${x} - refers to the n-th column in the CSV file, e.g. \${1}, \${2}, ...)

Example of a correct JSON template:

-
-[
-  {
-    "resourceType": "Asset",
-    "identifier": {
-      "name": "\${1}",
-      "domain": {
-        "name": "\${2}",
-        "community": {
-          "name": "Some Community"
-        }
-      }
-    },
-    "attributes" : {
-      "00000000-0000-0000-0000-000000003115" : [ {
-        "value" : "\${3}" 
-      } ],
-      "00000000-0000-0000-0000-000000000222" : [ {
-        "value" : "\${4}"
-      } ]
-    }
-  }
-]
-
` - } - } -} as const; - -export const ModelWithOneOfAndPropertiesSchema = { - type: 'object', - oneOf: [ - { - '$ref': '#/components/parameters/SimpleParameter' - }, - { - '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' - } - ], - required: ['baz', 'qux'], - properties: { - baz: { - type: 'integer', - format: 'uint16', - minimum: 0, - nullable: true - }, - qux: { - type: 'integer', - format: 'uint8', - minimum: 0 - } - } -} as const; - -export const ParameterSimpleParameterUnusedSchema = { - description: 'Model used to test deduplication strategy (unused)', - type: 'string' -} as const; - -export const PostServiceWithEmptyTagResponseSchema = { - description: 'Model used to test deduplication strategy', - type: 'string' -} as const; - -export const PostServiceWithEmptyTagResponse2Schema = { - description: 'Model used to test deduplication strategy', - type: 'string' -} as const; - -export const DeleteFooDataSchema = { - description: 'Model used to test deduplication strategy', - type: 'string' -} as const; - -export const DeleteFooData2Schema = { - description: 'Model used to test deduplication strategy', - type: 'string' -} as const; - -export const importSchema = { - description: 'Model with restricted keyword name', - type: 'string' -} as const; - -export const SchemaWithFormRestrictedKeysSchema = { - properties: { - description: { - type: 'string' - }, - 'x-enum-descriptions': { - type: 'string' - }, - 'x-enum-varnames': { - type: 'string' - }, - 'x-enumNames': { - type: 'string' - }, - title: { - type: 'string' - }, - object: { - type: 'object', - properties: { - description: { - type: 'string' - }, - 'x-enum-descriptions': { - type: 'string' - }, - 'x-enum-varnames': { - type: 'string' - }, - 'x-enumNames': { - type: 'string' - }, - title: { - type: 'string' - } - } - }, - array: { - type: 'array', - items: [ - { - type: 'object', - properties: { - description: { - type: 'string' - }, - 'x-enum-descriptions': { - type: 'string' - }, - 'x-enum-varnames': { - type: 'string' - }, - 'x-enumNames': { - type: 'string' - }, - title: { - type: 'string' - } - } - } - ] - } - } -} as const; - -export const io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptionsSchema = { - description: 'This schema was giving PascalCase transformations a hard time', - properties: { - preconditions: { - allOf: [ - { - '$ref': '#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions' - } - ], - description: 'Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.' - } - }, - type: 'object' -} as const; - -export const io_k8s_apimachinery_pkg_apis_meta_v1_PreconditionsSchema = { - description: 'This schema was giving PascalCase transformations a hard time', - properties: { - resourceVersion: { - description: 'Specifies the target ResourceVersion', - type: 'string' - }, - uid: { - description: 'Specifies the target UID.', - type: 'string' - } - }, - type: 'object' -} as const; - -export const AdditionalPropertiesUnknownIssueSchema = { - type: 'object', - properties: {}, - additionalProperties: { - anyOf: [ - { - type: 'string' - }, - { - type: 'number' - } - ] - } -} as const; - -export const AdditionalPropertiesUnknownIssue2Schema = { - type: 'object', - additionalProperties: { - anyOf: [ - { - type: 'string' - }, - { - type: 'number' - } - ] - } -} as const; - -export const AdditionalPropertiesUnknownIssue3Schema = { - type: 'object', - allOf: [ - { - type: 'string' - }, - { - type: 'object', - required: ['entries'], - properties: { - entries: { - additionalProperties: { - '$ref': '#/components/schemas/AdditionalPropertiesUnknownIssue' - } - } - } - } - ] -} as const; - -export const AdditionalPropertiesIntegerIssueSchema = { - type: 'object', - required: ['value'], - properties: { - value: { - type: 'integer' - } - }, - additionalProperties: { - type: 'integer' - } -} as const; - -export const OneOfAllOfIssueSchema = { - oneOf: [ - { - allOf: [ - { - oneOf: [ - { - '$ref': '#/components/schemas/ConstValue' - }, - { - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]' - } - ] - }, - { - '$ref': '#/components/schemas/3e-num_1Период' - } - ] - }, - { - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]' - } - ] -} as const; - -export const Generic_Schema_Duplicate_Issue_1_System_Boolean_Schema = { - type: 'object', - properties: { - item: { - type: 'boolean' - }, - error: { - type: 'string', - nullable: true - }, - hasError: { - type: 'boolean', - readOnly: true - }, - data: { - type: 'object', - properties: {}, - additionalProperties: false - } - }, - additionalProperties: false -} as const; - -export const Generic_Schema_Duplicate_Issue_1_System_String_Schema = { - type: 'object', - properties: { - item: { - type: 'string', - nullable: true - }, - error: { - type: 'string', - nullable: true - }, - hasError: { - type: 'boolean', - readOnly: true - } - }, - additionalProperties: false -} as const; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3-schemas-name/schemas.gen.ts b/packages/openapi-ts-tests/test/generated/v3-schemas-name/schemas.gen.ts deleted file mode 100644 index b45a3bbae..000000000 --- a/packages/openapi-ts-tests/test/generated/v3-schemas-name/schemas.gen.ts +++ /dev/null @@ -1,1994 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export const $400 = { - description: 'Model with number-only name', - type: 'string' -} as const; - -export const $camelCaseCommentWithBreaks = { - description: `Testing multiline comments in string: First line -Second line - -Fourth line`, - type: 'integer' -} as const; - -export const $CommentWithBreaks = { - description: `Testing multiline comments in string: First line -Second line - -Fourth line`, - type: 'integer' -} as const; - -export const $CommentWithBackticks = { - description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work', - type: 'integer' -} as const; - -export const $CommentWithBackticksAndQuotes = { - description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`, - type: 'integer' -} as const; - -export const $CommentWithSlashes = { - description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work', - type: 'integer' -} as const; - -export const $CommentWithExpressionPlaceholders = { - description: 'Testing expression placeholders in string: ${expression} should work', - type: 'integer' -} as const; - -export const $CommentWithQuotes = { - description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`, - type: 'integer' -} as const; - -export const $CommentWithReservedCharacters = { - description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work', - type: 'integer' -} as const; - -export const $SimpleInteger = { - description: 'This is a simple number', - type: 'integer' -} as const; - -export const $SimpleBoolean = { - description: 'This is a simple boolean', - type: 'boolean' -} as const; - -export const $SimpleString = { - description: 'This is a simple string', - type: 'string' -} as const; - -export const $NonAsciiStringæøåÆØÅöôêÊ字符串 = { - description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)', - type: 'string' -} as const; - -export const $SimpleFile = { - description: 'This is a simple file', - type: 'file' -} as const; - -export const $SimpleReference = { - description: 'This is a simple reference', - '$ref': '#/components/schemas/ModelWithString' -} as const; - -export const $SimpleStringWithPattern = { - description: 'This is a simple string', - type: 'string', - nullable: true, - maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$' -} as const; - -export const $EnumWithStrings = { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串'] -} as const; - -export const $EnumWithReplacedCharacters = { - enum: ["'Single Quote'", '"Double Quotes"', 'øæåôöØÆÅÔÖ字符串', 3.1, ''], - type: 'string' -} as const; - -export const $EnumWithNumbers = { - description: 'This is a simple enum with numbers', - enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3], - default: 200 -} as const; - -export const $EnumFromDescription = { - description: 'Success=1,Warning=2,Error=3', - type: 'number' -} as const; - -export const $EnumWithExtensions = { - description: 'This is a simple enum with numbers', - enum: [200, 400, 500], - 'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'], - 'x-enum-descriptions': ['Used when the status of something is successful', 'Used when the status of something has a warning', 'Used when the status of something has an error'] -} as const; - -export const $EnumWithXEnumNames = { - enum: [0, 1, 2], - 'x-enumNames': ['zero', 'one', 'two'] -} as const; - -export const $ArrayWithNumbers = { - description: 'This is a simple array with numbers', - type: 'array', - items: { - type: 'integer' - } -} as const; - -export const $ArrayWithBooleans = { - description: 'This is a simple array with booleans', - type: 'array', - items: { - type: 'boolean' - } -} as const; - -export const $ArrayWithStrings = { - description: 'This is a simple array with strings', - type: 'array', - items: { - type: 'string' - }, - default: ['test'] -} as const; - -export const $ArrayWithReferences = { - description: 'This is a simple array with references', - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithString' - } -} as const; - -export const $ArrayWithArray = { - description: 'This is a simple array containing an array', - type: 'array', - items: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithString' - } - } -} as const; - -export const $ArrayWithProperties = { - description: 'This is a simple array with properties', - type: 'array', - items: { - type: 'object', - properties: { - '16x16': { - '$ref': '#/components/schemas/camelCaseCommentWithBreaks' - }, - bar: { - type: 'string' - } - } - } -} as const; - -export const $ArrayWithAnyOfProperties = { - description: 'This is a simple array with any of properties', - type: 'array', - items: { - anyOf: [ - { - type: 'object', - properties: { - foo: { - type: 'string', - default: 'test' - } - } - }, - { - type: 'object', - properties: { - bar: { - type: 'string' - } - } - } - ] - } -} as const; - -export const $AnyOfAnyAndNull = { - type: 'object', - properties: { - data: { - anyOf: [ - {}, - { - type: 'null' - } - ] - } - } -} as const; - -export const $AnyOfArrays = { - description: 'This is a simple array with any of properties', - type: 'object', - properties: { - results: { - items: { - anyOf: [ - { - type: 'object', - properties: { - foo: { - type: 'string' - } - } - }, - { - type: 'object', - properties: { - bar: { - type: 'string' - } - } - } - ] - }, - type: 'array' - } - } -} as const; - -export const $DictionaryWithString = { - description: 'This is a string dictionary', - type: 'object', - additionalProperties: { - type: 'string' - } -} as const; - -export const $DictionaryWithPropertiesAndAdditionalProperties = { - type: 'object', - properties: { - foo: { - type: 'number' - }, - bar: { - type: 'boolean' - } - }, - additionalProperties: { - type: 'string' - } -} as const; - -export const $DictionaryWithReference = { - description: 'This is a string reference', - type: 'object', - additionalProperties: { - '$ref': '#/components/schemas/ModelWithString' - } -} as const; - -export const $DictionaryWithArray = { - description: 'This is a complex dictionary', - type: 'object', - additionalProperties: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithString' - } - } -} as const; - -export const $DictionaryWithDictionary = { - description: 'This is a string dictionary', - type: 'object', - additionalProperties: { - type: 'object', - additionalProperties: { - type: 'string' - } - } -} as const; - -export const $DictionaryWithProperties = { - description: 'This is a complex dictionary', - type: 'object', - additionalProperties: { - type: 'object', - properties: { - foo: { - type: 'string' - }, - bar: { - type: 'string' - } - } - } -} as const; - -export const $ModelWithInteger = { - description: 'This is a model with one number property', - type: 'object', - properties: { - prop: { - description: 'This is a simple number property', - type: 'integer' - } - } -} as const; - -export const $ModelWithBoolean = { - description: 'This is a model with one boolean property', - type: 'object', - properties: { - prop: { - description: 'This is a simple boolean property', - type: 'boolean' - } - } -} as const; - -export const $ModelWithString = { - description: 'This is a model with one string property', - type: 'object', - properties: { - prop: { - description: 'This is a simple string property', - type: 'string' - } - } -} as const; - -export const $ModelWithStringError = { - description: 'This is a model with one string property', - type: 'object', - properties: { - prop: { - description: 'This is a simple string property', - type: 'string' - } - } -} as const; - -export const $Model_From_Zendesk = { - description: `\`Comment\` or \`VoiceComment\`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets)`, - type: 'string' -} as const; - -export const $ModelWithNullableString = { - description: 'This is a model with one string property', - type: 'object', - required: ['nullableRequiredProp1', 'nullableRequiredProp2'], - properties: { - nullableProp1: { - description: 'This is a simple string property', - type: 'string', - nullable: true - }, - nullableRequiredProp1: { - description: 'This is a simple string property', - type: 'string', - nullable: true - }, - nullableProp2: { - description: 'This is a simple string property', - type: ['string', 'null'] - }, - nullableRequiredProp2: { - description: 'This is a simple string property', - type: ['string', 'null'] - }, - 'foo_bar-enum': { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] - } - } -} as const; - -export const $ModelWithEnum = { - description: 'This is a model with one enum', - type: 'object', - properties: { - 'foo_bar-enum': { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] - }, - statusCode: { - description: 'These are the HTTP error code enums', - enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar'] - }, - bool: { - description: 'Simple boolean enum', - type: 'boolean', - enum: [true] - } - } -} as const; - -export const $ModelWithEnumWithHyphen = { - description: 'This is a model with one enum with escaped name', - type: 'object', - properties: { - 'foo-bar-baz-qux': { - type: 'string', - enum: ['3.0'], - title: 'Foo-Bar-Baz-Qux', - default: '3.0' - } - } -} as const; - -export const $ModelWithEnumFromDescription = { - description: 'This is a model with one enum', - type: 'object', - properties: { - test: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' - } - } -} as const; - -export const $ModelWithNestedEnums = { - description: 'This is a model with nested enums', - type: 'object', - properties: { - dictionaryWithEnum: { - type: 'object', - additionalProperties: { - enum: ['Success', 'Warning', 'Error'] - } - }, - dictionaryWithEnumFromDescription: { - type: 'object', - additionalProperties: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' - } - }, - arrayWithEnum: { - type: 'array', - items: { - enum: ['Success', 'Warning', 'Error'] - } - }, - arrayWithDescription: { - type: 'array', - items: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' - } - }, - 'foo_bar-enum': { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] - } - } -} as const; - -export const $ModelWithReference = { - description: 'This is a model with one property containing a reference', - type: 'object', - properties: { - prop: { - '$ref': '#/components/schemas/ModelWithProperties' - } - } -} as const; - -export const $ModelWithArrayReadOnlyAndWriteOnly = { - description: 'This is a model with one property containing an array', - type: 'object', - properties: { - prop: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnly' - } - }, - propWithFile: { - type: 'array', - items: { - type: 'file' - } - }, - propWithNumber: { - type: 'array', - items: { - type: 'number' - } - } - } -} as const; - -export const $ModelWithArray = { - description: 'This is a model with one property containing an array', - type: 'object', - properties: { - prop: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithString' - } - }, - propWithFile: { - type: 'array', - items: { - type: 'file' - } - }, - propWithNumber: { - type: 'array', - items: { - type: 'number' - } - } - } -} as const; - -export const $ModelWithDictionary = { - description: 'This is a model with one property containing a dictionary', - type: 'object', - properties: { - prop: { - type: 'object', - additionalProperties: { - type: 'string' - } - } - } -} as const; - -export const $DeprecatedModel = { - deprecated: true, - description: 'This is a deprecated model with a deprecated property', - type: 'object', - properties: { - prop: { - deprecated: true, - description: 'This is a deprecated property', - type: 'string' - } - } -} as const; - -export const $ModelWithCircularReference = { - description: 'This is a model with one property containing a circular reference', - type: 'object', - properties: { - prop: { - '$ref': '#/components/schemas/ModelWithCircularReference' - } - } -} as const; - -export const $CompositionWithOneOf = { - description: "This is a model with one property with a 'one of' relationship", - type: 'object', - properties: { - propA: { - type: 'object', - oneOf: [ - { - '$ref': '#/components/schemas/ModelWithString' - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const $CompositionWithOneOfAnonymous = { - description: "This is a model with one property with a 'one of' relationship where the options are not $ref", - type: 'object', - properties: { - propA: { - type: 'object', - oneOf: [ - { - description: 'Anonymous object type', - type: 'object', - properties: { - propA: { - type: 'string' - } - } - }, - { - description: 'Anonymous string type', - type: 'string' - }, - { - description: 'Anonymous integer type', - type: 'integer' - } - ] - } - } -} as const; - -export const $ModelCircle = { - description: 'Circle', - type: 'object', - required: ['kind'], - properties: { - kind: { - type: 'string' - }, - radius: { - type: 'number' - } - } -} as const; - -export const $ModelSquare = { - description: 'Square', - type: 'object', - required: ['kind'], - properties: { - kind: { - type: 'string' - }, - sideLength: { - type: 'number' - } - } -} as const; - -export const $CompositionWithOneOfDiscriminator = { - description: "This is a model with one property with a 'one of' relationship where the options are not $ref", - type: 'object', - oneOf: [ - { - '$ref': '#/components/schemas/ModelCircle' - }, - { - '$ref': '#/components/schemas/ModelSquare' - } - ], - discriminator: { - propertyName: 'kind', - mapping: { - circle: '#/components/schemas/ModelCircle', - square: '#/components/schemas/ModelSquare' - } - } -} as const; - -export const $CompositionWithAnyOf = { - description: "This is a model with one property with a 'any of' relationship", - type: 'object', - properties: { - propA: { - type: 'object', - anyOf: [ - { - '$ref': '#/components/schemas/ModelWithString' - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const $CompositionWithAnyOfAnonymous = { - description: "This is a model with one property with a 'any of' relationship where the options are not $ref", - type: 'object', - properties: { - propA: { - type: 'object', - anyOf: [ - { - description: 'Anonymous object type', - type: 'object', - properties: { - propA: { - type: 'string' - } - } - }, - { - description: 'Anonymous string type', - type: 'string' - }, - { - description: 'Anonymous integer type', - type: 'integer' - } - ] - } - } -} as const; - -export const $CompositionWithNestedAnyAndTypeNull = { - description: "This is a model with nested 'any of' property with a type null", - type: 'object', - properties: { - propA: { - type: 'object', - anyOf: [ - { - items: { - anyOf: [ - { - '$ref': '#/components/schemas/ModelWithDictionary' - }, - { - type: 'null' - } - ] - }, - type: 'array' - }, - { - items: { - anyOf: [ - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - type: 'null' - } - ] - }, - type: 'array' - } - ] - } - } -} as const; - -export const $3e_num_1Период = { - enum: ['Bird', 'Dog'], - type: 'string' -} as const; - -export const $ConstValue = { - type: 'string', - const: 'ConstValue' -} as const; - -export const $CompositionWithNestedAnyOfAndNull = { - description: "This is a model with one property with a 'any of' relationship where the options are not $ref", - type: 'object', - properties: { - propA: { - anyOf: [ - { - items: { - anyOf: [ - { - '$ref': '#/components/schemas/3e-num_1Период' - }, - { - '$ref': '#/components/schemas/ConstValue' - } - ] - }, - type: 'array' - }, - { - type: 'null' - } - ], - title: 'Scopes' - } - } -} as const; - -export const $CompositionWithOneOfAndNullable = { - description: "This is a model with one property with a 'one of' relationship", - type: 'object', - properties: { - propA: { - nullable: true, - type: 'object', - oneOf: [ - { - type: 'object', - properties: { - boolean: { - type: 'boolean' - } - } - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const $CompositionWithOneOfAndSimpleDictionary = { - description: 'This is a model that contains a simple dictionary within composition', - type: 'object', - properties: { - propA: { - oneOf: [ - { - type: 'boolean' - }, - { - type: 'object', - additionalProperties: { - type: 'number' - } - } - ] - } - } -} as const; - -export const $CompositionWithOneOfAndSimpleArrayDictionary = { - description: 'This is a model that contains a dictionary of simple arrays within composition', - type: 'object', - properties: { - propA: { - oneOf: [ - { - type: 'boolean' - }, - { - type: 'object', - additionalProperties: { - type: 'array', - items: { - type: 'boolean' - } - } - } - ] - } - } -} as const; - -export const $CompositionWithOneOfAndComplexArrayDictionary = { - description: 'This is a model that contains a dictionary of complex arrays (composited) within composition', - type: 'object', - properties: { - propA: { - oneOf: [ - { - type: 'boolean' - }, - { - type: 'object', - additionalProperties: { - type: 'array', - items: { - oneOf: [ - { - type: 'number' - }, - { - type: 'string' - } - ] - } - } - } - ] - } - } -} as const; - -export const $CompositionWithAllOfAndNullable = { - description: "This is a model with one property with a 'all of' relationship", - type: 'object', - properties: { - propA: { - nullable: true, - type: 'object', - allOf: [ - { - type: 'object', - properties: { - boolean: { - type: 'boolean' - } - } - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const $CompositionWithAnyOfAndNullable = { - description: "This is a model with one property with a 'any of' relationship", - type: 'object', - properties: { - propA: { - nullable: true, - type: 'object', - anyOf: [ - { - type: 'object', - properties: { - boolean: { - type: 'boolean' - } - } - }, - { - '$ref': '#/components/schemas/ModelWithEnum' - }, - { - '$ref': '#/components/schemas/ModelWithArray' - }, - { - '$ref': '#/components/schemas/ModelWithDictionary' - } - ] - } - } -} as const; - -export const $CompositionBaseModel = { - description: 'This is a base model with two simple optional properties', - type: 'object', - properties: { - firstName: { - type: 'string' - }, - lastname: { - type: 'string' - } - } -} as const; - -export const $CompositionExtendedModel = { - description: 'This is a model that extends the base model', - type: 'object', - allOf: [ - { - '$ref': '#/components/schemas/CompositionBaseModel' - } - ], - properties: { - age: { - type: 'number' - } - }, - required: ['firstName', 'lastname', 'age'] -} as const; - -export const $ModelWithProperties = { - description: 'This is a model with one nested property', - type: 'object', - required: ['required', 'requiredAndReadOnly', 'requiredAndNullable'], - properties: { - required: { - type: 'string' - }, - requiredAndReadOnly: { - type: 'string', - readOnly: true - }, - requiredAndNullable: { - type: 'string', - nullable: true - }, - string: { - type: 'string' - }, - number: { - type: 'number' - }, - boolean: { - type: 'boolean' - }, - reference: { - '$ref': '#/components/schemas/ModelWithString' - }, - 'property with space': { - type: 'string' - }, - default: { - type: 'string' - }, - try: { - type: 'string' - }, - '@namespace.string': { - type: 'string', - readOnly: true - }, - '@namespace.integer': { - type: 'integer', - readOnly: true - } - } -} as const; - -export const $ModelWithNestedProperties = { - description: 'This is a model with one nested property', - type: 'object', - required: ['first'], - properties: { - first: { - type: 'object', - required: ['second'], - readOnly: true, - nullable: true, - properties: { - second: { - type: 'object', - required: ['third'], - readOnly: true, - nullable: true, - properties: { - third: { - type: 'string', - required: true, - readOnly: true, - nullable: true - } - } - } - } - } - } -} as const; - -export const $ModelWithDuplicateProperties = { - description: 'This is a model with duplicated properties', - type: 'object', - properties: { - prop: { - '$ref': '#/components/schemas/ModelWithString' - } - } -} as const; - -export const $ModelWithOrderedProperties = { - description: 'This is a model with ordered properties', - type: 'object', - properties: { - zebra: { - type: 'string' - }, - apple: { - type: 'string' - }, - hawaii: { - type: 'string' - } - } -} as const; - -export const $ModelWithDuplicateImports = { - description: 'This is a model with duplicated imports', - type: 'object', - properties: { - propA: { - '$ref': '#/components/schemas/ModelWithString' - }, - propB: { - '$ref': '#/components/schemas/ModelWithString' - }, - propC: { - '$ref': '#/components/schemas/ModelWithString' - } - } -} as const; - -export const $ModelThatExtends = { - description: 'This is a model that extends another model', - type: 'object', - allOf: [ - { - '$ref': '#/components/schemas/ModelWithString' - }, - { - type: 'object', - properties: { - propExtendsA: { - type: 'string' - }, - propExtendsB: { - '$ref': '#/components/schemas/ModelWithString' - } - } - } - ] -} as const; - -export const $ModelThatExtendsExtends = { - description: 'This is a model that extends another model', - type: 'object', - allOf: [ - { - '$ref': '#/components/schemas/ModelWithString' - }, - { - '$ref': '#/components/schemas/ModelThatExtends' - }, - { - type: 'object', - properties: { - propExtendsC: { - type: 'string' - }, - propExtendsD: { - '$ref': '#/components/schemas/ModelWithString' - } - } - } - ] -} as const; - -export const $ModelWithPattern = { - description: 'This is a model that contains a some patterns', - type: 'object', - required: ['key', 'name'], - properties: { - key: { - maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$', - type: 'string' - }, - name: { - maxLength: 255, - type: 'string' - }, - enabled: { - type: 'boolean', - readOnly: true - }, - modified: { - type: 'string', - format: 'date-time', - readOnly: true - }, - id: { - type: 'string', - pattern: '^\\d{2}-\\d{3}-\\d{4}$' - }, - text: { - type: 'string', - pattern: '^\\w+$' - }, - patternWithSingleQuotes: { - type: 'string', - pattern: "^[a-zA-Z0-9']*$" - }, - patternWithNewline: { - type: 'string', - pattern: 'aaa\\nbbb' - }, - patternWithBacktick: { - type: 'string', - pattern: 'aaa`bbb' - } - } -} as const; - -export const $File = { - required: ['mime'], - type: 'object', - properties: { - id: { - title: 'Id', - type: 'string', - readOnly: true, - minLength: 1 - }, - updated_at: { - title: 'Updated at', - type: 'string', - format: 'date-time', - readOnly: true - }, - created_at: { - title: 'Created at', - type: 'string', - format: 'date-time', - readOnly: true - }, - mime: { - title: 'Mime', - type: 'string', - maxLength: 24, - minLength: 1 - }, - file: { - title: 'File', - type: 'string', - readOnly: true, - format: 'uri' - } - } -} as const; - -export const $default = { - type: 'object', - properties: { - name: { - type: 'string' - } - } -} as const; - -export const $Pageable = { - type: 'object', - properties: { - page: { - minimum: 0, - type: 'integer', - format: 'int32', - default: 0 - }, - size: { - minimum: 1, - type: 'integer', - format: 'int32' - }, - sort: { - type: 'array', - items: { - type: 'string' - } - } - } -} as const; - -export const $FreeFormObjectWithoutAdditionalProperties = { - description: 'This is a free-form object without additionalProperties.', - type: 'object' -} as const; - -export const $FreeFormObjectWithAdditionalPropertiesEqTrue = { - description: 'This is a free-form object with additionalProperties: true.', - type: 'object', - additionalProperties: true -} as const; - -export const $FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { - description: 'This is a free-form object with additionalProperties: {}.', - type: 'object', - additionalProperties: {} -} as const; - -export const $ModelWithConst = { - type: 'object', - properties: { - String: { - const: 'String' - }, - number: { - const: 0 - }, - null: { - const: null - }, - withType: { - type: 'string', - const: 'Some string' - } - } -} as const; - -export const $ModelWithAdditionalPropertiesEqTrue = { - description: 'This is a model with one property and additionalProperties: true', - type: 'object', - properties: { - prop: { - description: 'This is a simple string property', - type: 'string' - } - }, - additionalProperties: true -} as const; - -export const $NestedAnyOfArraysNullable = { - properties: { - nullableArray: { - anyOf: [ - { - items: { - anyOf: [ - { - type: 'string' - }, - { - type: 'boolean' - } - ] - }, - type: 'array' - }, - { - type: 'null' - } - ] - } - }, - type: 'object' -} as const; - -export const $CompositionWithOneOfAndProperties = { - type: 'object', - oneOf: [ - { - type: 'object', - required: ['foo'], - properties: { - foo: { - '$ref': '#/components/parameters/SimpleParameter' - } - }, - additionalProperties: false - }, - { - type: 'object', - required: ['bar'], - properties: { - bar: { - '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' - } - }, - additionalProperties: false - } - ], - required: ['baz', 'qux'], - properties: { - baz: { - type: 'integer', - format: 'uint16', - minimum: 0, - nullable: true - }, - qux: { - type: 'integer', - format: 'uint8', - minimum: 0 - } - } -} as const; - -export const $NullableObject = { - type: ['object', 'null'], - description: 'An object that can be null', - properties: { - foo: { - type: 'string' - } - }, - default: null -} as const; - -export const $CharactersInDescription = { - type: 'string', - description: 'Some % character' -} as const; - -export const $ModelWithNullableObject = { - type: 'object', - properties: { - data: { - '$ref': '#/components/schemas/NullableObject' - } - } -} as const; - -export const $ModelWithOneOfEnum = { - oneOf: [ - { - type: 'object', - required: ['foo'], - properties: { - foo: { - type: 'string', - enum: ['Bar'] - } - } - }, - { - type: 'object', - required: ['foo'], - properties: { - foo: { - type: 'string', - enum: ['Baz'] - } - } - }, - { - type: 'object', - required: ['foo'], - properties: { - foo: { - type: 'string', - enum: ['Qux'] - } - } - }, - { - type: 'object', - required: ['content', 'foo'], - properties: { - content: { - type: 'string', - format: 'date-time' - }, - foo: { - type: 'string', - enum: ['Quux'] - } - } - }, - { - type: 'object', - required: ['content', 'foo'], - properties: { - content: { - type: 'array', - items: [ - { - type: 'string', - format: 'date-time' - }, - { - type: 'string' - } - ], - maxItems: 2, - minItems: 2 - }, - foo: { - type: 'string', - enum: ['Corge'] - } - } - } - ] -} as const; - -export const $ModelWithNestedArrayEnumsDataFoo = { - enum: ['foo', 'bar'], - type: 'string' -} as const; - -export const $ModelWithNestedArrayEnumsDataBar = { - enum: ['baz', 'qux'], - type: 'string' -} as const; - -export const $ModelWithNestedArrayEnumsData = { - type: 'object', - properties: { - foo: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' - } - }, - bar: { - type: 'array', - items: { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataBar' - } - } - } -} as const; - -export const $ModelWithNestedArrayEnums = { - type: 'object', - properties: { - array_strings: { - type: 'array', - items: { - type: 'string' - } - }, - data: { - allOf: [ - { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsData' - } - ] - } - } -} as const; - -export const $ModelWithNestedCompositionEnums = { - type: 'object', - properties: { - foo: { - allOf: [ - { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' - } - ] - } - } -} as const; - -export const $ModelWithReadOnlyAndWriteOnly = { - type: 'object', - required: ['foo', 'bar', 'baz'], - properties: { - foo: { - type: 'string' - }, - bar: { - readOnly: true, - type: 'string' - }, - baz: { - type: 'string', - writeOnly: true - } - } -} as const; - -export const $ModelWithConstantSizeArray = { - type: 'array', - items: { - type: 'number' - }, - minItems: 2, - maxItems: 2 -} as const; - -export const $ModelWithAnyOfConstantSizeArray = { - type: 'array', - items: { - oneOf: [ - { - type: 'number' - }, - { - type: 'string' - } - ] - }, - minItems: 3, - maxItems: 3 -} as const; - -export const $ModelWithPrefixItemsConstantSizeArray = { - type: 'array', - prefixItems: [ - { - '$ref': '#/components/schemas/ModelWithInteger' - }, - { - oneOf: [ - { - type: 'number' - }, - { - type: 'string' - } - ] - }, - { - type: 'string' - } - ] -} as const; - -export const $ModelWithAnyOfConstantSizeArrayNullable = { - type: ['array'], - items: { - oneOf: [ - { - type: 'number', - nullable: true - }, - { - type: 'string' - } - ] - }, - minItems: 3, - maxItems: 3 -} as const; - -export const $ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = { - type: 'array', - items: { - oneOf: [ - { - type: 'number' - }, - { - '$ref': '#/components/schemas/import' - } - ] - }, - minItems: 2, - maxItems: 2 -} as const; - -export const $ModelWithAnyOfConstantSizeArrayAndIntersect = { - type: 'array', - items: { - allOf: [ - { - type: 'number' - }, - { - type: 'string' - } - ] - }, - minItems: 2, - maxItems: 2 -} as const; - -export const $ModelWithNumericEnumUnion = { - type: 'object', - properties: { - value: { - type: 'number', - description: 'Период', - enum: [-10, -1, 0, 1, 3, 6, 12] - } - } -} as const; - -export const $ModelWithBackticksInDescription = { - description: 'Some description with `back ticks`', - type: 'object', - properties: { - template: { - type: 'string', - description: `The template \`that\` should be used for parsing and importing the contents of the CSV file. - -

There is one placeholder currently supported:

  • \${x} - refers to the n-th column in the CSV file, e.g. \${1}, \${2}, ...)

Example of a correct JSON template:

-
-[
-  {
-    "resourceType": "Asset",
-    "identifier": {
-      "name": "\${1}",
-      "domain": {
-        "name": "\${2}",
-        "community": {
-          "name": "Some Community"
-        }
-      }
-    },
-    "attributes" : {
-      "00000000-0000-0000-0000-000000003115" : [ {
-        "value" : "\${3}" 
-      } ],
-      "00000000-0000-0000-0000-000000000222" : [ {
-        "value" : "\${4}"
-      } ]
-    }
-  }
-]
-
` - } - } -} as const; - -export const $ModelWithOneOfAndProperties = { - type: 'object', - oneOf: [ - { - '$ref': '#/components/parameters/SimpleParameter' - }, - { - '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' - } - ], - required: ['baz', 'qux'], - properties: { - baz: { - type: 'integer', - format: 'uint16', - minimum: 0, - nullable: true - }, - qux: { - type: 'integer', - format: 'uint8', - minimum: 0 - } - } -} as const; - -export const $ParameterSimpleParameterUnused = { - description: 'Model used to test deduplication strategy (unused)', - type: 'string' -} as const; - -export const $PostServiceWithEmptyTagResponse = { - description: 'Model used to test deduplication strategy', - type: 'string' -} as const; - -export const $PostServiceWithEmptyTagResponse2 = { - description: 'Model used to test deduplication strategy', - type: 'string' -} as const; - -export const $DeleteFooData = { - description: 'Model used to test deduplication strategy', - type: 'string' -} as const; - -export const $DeleteFooData2 = { - description: 'Model used to test deduplication strategy', - type: 'string' -} as const; - -export const $import = { - description: 'Model with restricted keyword name', - type: 'string' -} as const; - -export const $SchemaWithFormRestrictedKeys = { - properties: { - description: { - type: 'string' - }, - 'x-enum-descriptions': { - type: 'string' - }, - 'x-enum-varnames': { - type: 'string' - }, - 'x-enumNames': { - type: 'string' - }, - title: { - type: 'string' - }, - object: { - type: 'object', - properties: { - description: { - type: 'string' - }, - 'x-enum-descriptions': { - type: 'string' - }, - 'x-enum-varnames': { - type: 'string' - }, - 'x-enumNames': { - type: 'string' - }, - title: { - type: 'string' - } - } - }, - array: { - type: 'array', - items: [ - { - type: 'object', - properties: { - description: { - type: 'string' - }, - 'x-enum-descriptions': { - type: 'string' - }, - 'x-enum-varnames': { - type: 'string' - }, - 'x-enumNames': { - type: 'string' - }, - title: { - type: 'string' - } - } - } - ] - } - } -} as const; - -export const $io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { - description: 'This schema was giving PascalCase transformations a hard time', - properties: { - preconditions: { - allOf: [ - { - '$ref': '#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions' - } - ], - description: 'Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.' - } - }, - type: 'object' -} as const; - -export const $io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { - description: 'This schema was giving PascalCase transformations a hard time', - properties: { - resourceVersion: { - description: 'Specifies the target ResourceVersion', - type: 'string' - }, - uid: { - description: 'Specifies the target UID.', - type: 'string' - } - }, - type: 'object' -} as const; - -export const $AdditionalPropertiesUnknownIssue = { - type: 'object', - properties: {}, - additionalProperties: { - anyOf: [ - { - type: 'string' - }, - { - type: 'number' - } - ] - } -} as const; - -export const $AdditionalPropertiesUnknownIssue2 = { - type: 'object', - additionalProperties: { - anyOf: [ - { - type: 'string' - }, - { - type: 'number' - } - ] - } -} as const; - -export const $AdditionalPropertiesUnknownIssue3 = { - type: 'object', - allOf: [ - { - type: 'string' - }, - { - type: 'object', - required: ['entries'], - properties: { - entries: { - additionalProperties: { - '$ref': '#/components/schemas/AdditionalPropertiesUnknownIssue' - } - } - } - } - ] -} as const; - -export const $AdditionalPropertiesIntegerIssue = { - type: 'object', - required: ['value'], - properties: { - value: { - type: 'integer' - } - }, - additionalProperties: { - type: 'integer' - } -} as const; - -export const $OneOfAllOfIssue = { - oneOf: [ - { - allOf: [ - { - oneOf: [ - { - '$ref': '#/components/schemas/ConstValue' - }, - { - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]' - } - ] - }, - { - '$ref': '#/components/schemas/3e-num_1Период' - } - ] - }, - { - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]' - } - ] -} as const; - -export const $Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { - type: 'object', - properties: { - item: { - type: 'boolean' - }, - error: { - type: 'string', - nullable: true - }, - hasError: { - type: 'boolean', - readOnly: true - }, - data: { - type: 'object', - properties: {}, - additionalProperties: false - } - }, - additionalProperties: false -} as const; - -export const $Generic_Schema_Duplicate_Issue_1_System_String_ = { - type: 'object', - properties: { - item: { - type: 'string', - nullable: true - }, - error: { - type: 'string', - nullable: true - }, - hasError: { - type: 'boolean', - readOnly: true - } - }, - additionalProperties: false -} as const; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3-types-PascalCase/index.ts b/packages/openapi-ts-tests/test/generated/v3-types-PascalCase/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/v3-types-PascalCase/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3-types-PascalCase/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3-types-PascalCase/types.gen.ts deleted file mode 100644 index f6a6095e3..000000000 --- a/packages/openapi-ts-tests/test/generated/v3-types-PascalCase/types.gen.ts +++ /dev/null @@ -1,1970 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = unknown; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string; - /** - * This is a simple string property - */ - nullableRequiredProp1: string; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReference = { - prop?: ModelWithProperties; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnly = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: { - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithProperties = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedProperties = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPattern = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type File = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - unknown, - unknown - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnly = { - foo: string; - readonly bar: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | string, - number | string, - number | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: unknown; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssue = ((ConstValue | GenericSchemaDuplicateIssue1SystemBoolean) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemString; - -export type GenericSchemaDuplicateIssue1SystemBoolean = { - item?: boolean; - error?: string; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemString = { - item?: string; - error?: string; - readonly hasError?: boolean; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnly; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: unknown; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: unknown; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: unknown; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: unknown; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: unknown; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: unknown; - }; - url: '/api/v{api-version}/descriptions/'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - }; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters/'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters/'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody/'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData/'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string; - /** - * This is a simple number with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - }; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - /** - * This is tuple parameter - */ - parameterTuple: [ - number, - number, - number, - number - ]; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: unknown; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: unknown; -}; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - readonly key: string; - name: string; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array; - listOfStrings?: Array; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - readonly user?: { - readonly id?: number; - readonly name?: string; - }; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3/core/ApiError.ts deleted file mode 100644 index 36675d288..000000000 --- a/packages/openapi-ts-tests/test/generated/v3/core/ApiError.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: unknown; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3/core/ApiRequestOptions.ts deleted file mode 100644 index 939a0aa4c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3/core/ApiRequestOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type ApiRequestOptions = { - readonly body?: any; - readonly cookies?: Record; - readonly errors?: Record; - readonly formData?: Record | any[] | Blob | File; - readonly headers?: Record; - readonly mediaType?: string; - readonly method: - | 'DELETE' - | 'GET' - | 'HEAD' - | 'OPTIONS' - | 'PATCH' - | 'POST' - | 'PUT'; - readonly path?: Record; - readonly query?: Record; - readonly responseHeader?: string; - readonly responseTransformer?: (data: unknown) => Promise; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3/core/ApiResult.ts deleted file mode 100644 index 4c58e3913..000000000 --- a/packages/openapi-ts-tests/test/generated/v3/core/ApiResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ApiResult = { - readonly body: TData; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3/core/CancelablePromise.ts deleted file mode 100644 index ccc082e8f..000000000 --- a/packages/openapi-ts-tests/test/generated/v3/core/CancelablePromise.ts +++ /dev/null @@ -1,126 +0,0 @@ -export class CancelError extends Error { - constructor(message: string) { - super(message); - this.name = 'CancelError'; - } - - public get isCancelled(): boolean { - return true; - } -} - -export interface OnCancel { - readonly isResolved: boolean; - readonly isRejected: boolean; - readonly isCancelled: boolean; - - (cancelHandler: () => void): void; -} - -export class CancelablePromise implements Promise { - private _isResolved: boolean; - private _isRejected: boolean; - private _isCancelled: boolean; - readonly cancelHandlers: (() => void)[]; - readonly promise: Promise; - private _resolve?: (value: T | PromiseLike) => void; - private _reject?: (reason?: unknown) => void; - - constructor( - executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: unknown) => void, - onCancel: OnCancel - ) => void - ) { - this._isResolved = false; - this._isRejected = false; - this._isCancelled = false; - this.cancelHandlers = []; - this.promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - - const onResolve = (value: T | PromiseLike): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isResolved = true; - if (this._resolve) this._resolve(value); - }; - - const onReject = (reason?: unknown): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isRejected = true; - if (this._reject) this._reject(reason); - }; - - const onCancel = (cancelHandler: () => void): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this.cancelHandlers.push(cancelHandler); - }; - - Object.defineProperty(onCancel, 'isResolved', { - get: (): boolean => this._isResolved, - }); - - Object.defineProperty(onCancel, 'isRejected', { - get: (): boolean => this._isRejected, - }); - - Object.defineProperty(onCancel, 'isCancelled', { - get: (): boolean => this._isCancelled, - }); - - return executor(onResolve, onReject, onCancel as OnCancel); - }); - } - - get [Symbol.toStringTag]() { - return "Cancellable Promise"; - } - - public then( - onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null - ): Promise { - return this.promise.then(onFulfilled, onRejected); - } - - public catch( - onRejected?: ((reason: unknown) => TResult | PromiseLike) | null - ): Promise { - return this.promise.catch(onRejected); - } - - public finally(onFinally?: (() => void) | null): Promise { - return this.promise.finally(onFinally); - } - - public cancel(): void { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isCancelled = true; - if (this.cancelHandlers.length) { - try { - for (const cancelHandler of this.cancelHandlers) { - cancelHandler(); - } - } catch (error) { - console.warn('Cancellation threw an error', error); - return; - } - } - this.cancelHandlers.length = 0; - if (this._reject) this._reject(new CancelError('Request aborted')); - } - - public get isCancelled(): boolean { - return this._isCancelled; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3/core/OpenAPI.ts deleted file mode 100644 index 144e25744..000000000 --- a/packages/openapi-ts-tests/test/generated/v3/core/OpenAPI.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; - -type Headers = Record; -type Middleware = (value: T) => T | Promise; -type Resolver = (options: ApiRequestOptions) => Promise; - -export class Interceptors { - _fns: Middleware[]; - - constructor() { - this._fns = []; - } - - eject(fn: Middleware): void { - const index = this._fns.indexOf(fn); - if (index !== -1) { - this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; - } - } - - use(fn: Middleware): void { - this._fns = [...this._fns, fn]; - } -} - -export type OpenAPIConfig = { - BASE: string; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - ENCODE_PATH?: ((path: string) => string) | undefined; - HEADERS?: Headers | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - VERSION: string; - WITH_CREDENTIALS: boolean; - interceptors: { - request: Interceptors; - response: Interceptors; - }; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: 'http://localhost:3000/base', - CREDENTIALS: 'include', - ENCODE_PATH: undefined, - HEADERS: undefined, - PASSWORD: undefined, - TOKEN: undefined, - USERNAME: undefined, - VERSION: '1.0', - WITH_CREDENTIALS: false, - interceptors: { - request: new Interceptors(), - response: new Interceptors(), - }, -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3/core/request.ts b/packages/openapi-ts-tests/test/generated/v3/core/request.ts deleted file mode 100644 index 5458a2899..000000000 --- a/packages/openapi-ts-tests/test/generated/v3/core/request.ts +++ /dev/null @@ -1,350 +0,0 @@ -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import { CancelablePromise } from './CancelablePromise'; -import type { OnCancel } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const isString = (value: unknown): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: any): value is Blob => { - return value instanceof Blob; -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const encodePair = (key: string, value: unknown) => { - if (value === undefined || value === null) { - return; - } - - if (value instanceof Date) { - append(key, value.toISOString()); - } else if (Array.isArray(value)) { - value.forEach(v => encodePair(key, v)); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); - } else { - append(key, value); - } - }; - - Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - - return qs.length ? `?${qs.join('&')}` : ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = config.BASE + path; - return options.query ? url + getQueryString(options.query) : url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([, value]) => value !== undefined && value !== null) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { - const [token, username, password, additionalHeaders] = await Promise.all([ - // @ts-ignore - resolve(options, config.TOKEN), - // @ts-ignore - resolve(options, config.USERNAME), - // @ts-ignore - resolve(options, config.PASSWORD), - // @ts-ignore - resolve(options, config.HEADERS), - ]); - - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - }) - .filter(([, value]) => value !== undefined && value !== null) - .reduce((headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), {} as Record); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return new Headers(headers); -}; - -export const getRequestBody = (options: ApiRequestOptions): unknown => { - if (options.body !== undefined) { - if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { - return JSON.stringify(options.body); - } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; -}; - -export const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: any, - formData: FormData | undefined, - headers: Headers, - onCancel: OnCancel -): Promise => { - const controller = new AbortController(); - - let request: RequestInit = { - headers, - body: body ?? formData, - method: options.method, - signal: controller.signal, - }; - - if (config.WITH_CREDENTIALS) { - request.credentials = config.CREDENTIALS; - } - - for (const fn of config.interceptors.request._fns) { - request = await fn(request); - } - - onCancel(() => controller.abort()); - - return await fetch(url, request); -}; - -export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { - if (responseHeader) { - const content = response.headers.get(responseHeader); - if (isString(content)) { - return content; - } - } - return undefined; -}; - -export const getResponseBody = async (response: Response): Promise => { - if (response.status !== 204) { - try { - const contentType = response.headers.get('Content-Type'); - if (contentType) { - const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; - if (contentType.includes('application/json') || contentType.includes('+json')) { - return await response.json(); - } else if (binaryTypes.some(type => contentType.includes(type))) { - return await response.blob(); - } else if (contentType.includes('multipart/form-data')) { - return await response.formData(); - } else if (contentType.includes('text/')) { - return await response.text(); - } - } - } catch (error) { - console.error(error); - } - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 405: 'Method Not Allowed', - 406: 'Not Acceptable', - 407: 'Proxy Authentication Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Payload Too Large', - 414: 'URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Range Not Satisfiable', - 417: 'Expectation Failed', - 418: 'Im a teapot', - 421: 'Misdirected Request', - 422: 'Unprocessable Content', - 423: 'Locked', - 424: 'Failed Dependency', - 425: 'Too Early', - 426: 'Upgrade Required', - 428: 'Precondition Required', - 429: 'Too Many Requests', - 431: 'Request Header Fields Too Large', - 451: 'Unavailable For Legal Reasons', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported', - 506: 'Variant Also Negotiates', - 507: 'Insufficient Storage', - 508: 'Loop Detected', - 510: 'Not Extended', - 511: 'Network Authentication Required', - ...options.errors, - } - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError(options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ -export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options); - - if (!onCancel.isCancelled) { - let response = await sendRequest(config, options, url, body, formData, headers, onCancel); - - for (const fn of config.interceptors.response._fns) { - response = await fn(response); - } - - const responseBody = await getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - let transformedBody = responseBody; - if (options.responseTransformer && response.ok) { - transformedBody = await options.responseTransformer(responseBody) - } - - const result: ApiResult = { - url, - ok: response.ok, - status: response.status, - statusText: response.statusText, - body: responseHeader ?? transformedBody, - }; - - catchErrorCodes(options, result); - - resolve(result.body); - } - } catch (error) { - reject(error); - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3/index.ts b/packages/openapi-ts-tests/test/generated/v3/index.ts deleted file mode 100644 index 50a1dd734..000000000 --- a/packages/openapi-ts-tests/test/generated/v3/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export { ApiError } from './core/ApiError'; -export { CancelablePromise, CancelError } from './core/CancelablePromise'; -export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3/sdk.gen.ts deleted file mode 100644 index f62288bcf..000000000 --- a/packages/openapi-ts-tests/test/generated/v3/sdk.gen.ts +++ /dev/null @@ -1,913 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { CancelablePromise } from './core/CancelablePromise'; -import { OpenAPI } from './core/OpenAPI'; -import { request as __request } from './core/request'; -import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; - -export class CollectionFormatService { - /** - * @param data The data for the request. - * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) - * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) - * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) - * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) - * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) - * @throws ApiError - */ - public static collectionFormat(data: CollectionFormatData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/collectionFormat', - query: { - parameterArrayCSV: data.parameterArrayCsv, - parameterArraySSV: data.parameterArraySsv, - parameterArrayTSV: data.parameterArrayTsv, - parameterArrayPipes: data.parameterArrayPipes, - parameterArrayMulti: data.parameterArrayMulti - } - }); - } - -} - -export class ComplexService { - /** - * @param data The data for the request. - * @param data.parameterObject Parameter containing object - * @param data.parameterReference Parameter containing reference - * @returns ModelWithString Successful response - * @throws ApiError - */ - public static complexTypes(data: ComplexTypesData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/complex', - query: { - parameterObject: data.parameterObject, - parameterReference: data.parameterReference - }, - errors: { - 400: '400 `server` error', - 500: '500 server error' - } - }); - } - - /** - * @param data The data for the request. - * @param data.id - * @param data.requestBody - * @returns ModelWithString Success - * @throws ApiError - */ - public static complexParams(data: ComplexParamsData): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/complex/{id}', - path: { - id: data.id - }, - body: data.requestBody, - mediaType: 'application/json-patch+json' - }); - } - -} - -export class DefaultService { - /** - * @throws ApiError - */ - public static export(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public static patchApiNoTag(): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @param data The data for the request. - * @param data.requestBody - * @returns Model_From_Zendesk Success - * @returns ModelWithReadOnlyAndWriteOnly Default success response - * @throws ApiError - */ - public static import(data: ImportData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/no+tag', - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public static fooWow(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @param data The data for the request. - * @param data.fooParam foo in method - * @returns number Response is a simple number - * @throws ApiError - */ - public static getApiSimpleOperation(data: GetApiSimpleOperationData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple:operation', - path: { - foo_param: data.fooParam - }, - errors: { - default: 'Default error response' - } - }); - } - -} - -export class DefaultsService { - /** - * @param data The data for the request. - * @param data.parameterString This is a simple string with default value - * @param data.parameterNumber This is a simple number with default value - * @param data.parameterBoolean This is a simple boolean with default value - * @param data.parameterEnum This is a simple enum with default value - * @param data.parameterModel This is a simple model with default value - * @throws ApiError - */ - public static callWithDefaultParameters(data: CallWithDefaultParametersData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterString This is a simple string that is optional with default value - * @param data.parameterNumber This is a simple number that is optional with default value - * @param data.parameterBoolean This is a simple boolean that is optional with default value - * @param data.parameterEnum This is a simple enum that is optional with default value - * @param data.parameterModel This is a simple model that is optional with default value - * @throws ApiError - */ - public static callWithDefaultOptionalParameters(data: CallWithDefaultOptionalParametersData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterStringWithNoDefault This is a string with no default - * @param data.parameterOptionalStringWithDefault This is a optional string with default - * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default - * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default - * @param data.parameterStringWithDefault This is a string with default - * @param data.parameterStringWithEmptyDefault This is a string with empty default - * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default - * @param data.parameterStringNullableWithDefault This is a string that can be null with default - * @throws ApiError - */ - public static callToTestOrderOfParams(data: CallToTestOrderOfParamsData): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/defaults', - query: { - parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, - parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, - parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, - parameterStringWithDefault: data.parameterStringWithDefault, - parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, - parameterStringWithNoDefault: data.parameterStringWithNoDefault, - parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, - parameterStringNullableWithDefault: data.parameterStringNullableWithDefault - } - }); - } - -} - -export class DeprecatedService { - /** - * @deprecated - * @param data The data for the request. - * @param data.parameter This parameter is deprecated - * @throws ApiError - */ - public static deprecatedCall(data: DeprecatedCallData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/deprecated', - headers: { - parameter: data.parameter - } - }); - } - -} - -export class DescriptionsService { - /** - * @param data The data for the request. - * @param data.parameterWithBreaks Testing multiline comments in string: First line - * Second line - * - * Fourth line - * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work - * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work - * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work - * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work - * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work - * @throws ApiError - */ - public static callWithDescriptions(data: CallWithDescriptionsData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/descriptions/', - query: { - parameterWithBreaks: data.parameterWithBreaks, - parameterWithBackticks: data.parameterWithBackticks, - parameterWithSlashes: data.parameterWithSlashes, - parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders, - parameterWithQuotes: data.parameterWithQuotes, - parameterWithReservedCharacters: data.parameterWithReservedCharacters - } - }); - } - -} - -export class DuplicateService { - /** - * @throws ApiError - */ - public static duplicateName(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public static duplicateName1(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public static duplicateName2(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public static duplicateName3(): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/duplicate' - }); - } - -} - -export class ErrorService { - /** - * @param data The data for the request. - * @param data.status Status code to return - * @returns unknown Custom message: Successful response - * @throws ApiError - */ - public static testErrorCode(data: TestErrorCodeData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/error', - query: { - status: data.status - }, - errors: { - 500: 'Custom message: Internal Server Error', - 501: 'Custom message: Not Implemented', - 502: 'Custom message: Bad Gateway', - 503: 'Custom message: Service Unavailable' - } - }); - } - -} - -export class FileResponseService { - /** - * @param data The data for the request. - * @param data.id - * @returns binary Success - * @throws ApiError - */ - public static fileResponse(data: FileResponseData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/file/{id}', - path: { - id: data.id - } - }); - } - -} - -export class FormDataService { - /** - * @param data The data for the request. - * @param data.parameter This is a reusable parameter - * @param data.formData A reusable request body - * @throws ApiError - */ - public static postApiFormData(data: PostApiFormDataData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/formData/', - query: { - parameter: data.parameter - }, - formData: data.formData, - mediaType: 'multipart/form-data' - }); - } - -} - -export class HeaderService { - /** - * @returns string Successful response - * @throws ApiError - */ - public static callWithResultFromHeader(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/header', - responseHeader: 'operation-location', - errors: { - 400: '400 server error', - 500: '500 server error' - } - }); - } - -} - -export class MultipartService { - /** - * @param data The data for the request. - * @param data.formData - * @throws ApiError - */ - public static multipartRequest(data: MultipartRequestData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/multipart', - formData: data.formData, - mediaType: 'multipart/form-data' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public static multipartResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multipart' - }); - } - -} - -export class MultipleTags1Service { - /** - * @returns _400 - * @throws ApiError - */ - public static dummyA(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/a' - }); - } - - /** - * @returns void Success - * @throws ApiError - */ - public static dummyB(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class MultipleTags2Service { - /** - * @returns _400 - * @throws ApiError - */ - public static dummyA(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/a' - }); - } - - /** - * @returns void Success - * @throws ApiError - */ - public static dummyB(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class MultipleTags3Service { - /** - * @returns void Success - * @throws ApiError - */ - public static dummyB(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class NoContentService { - /** - * @returns void Success - * @throws ApiError - */ - public static callWithNoContentResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/no-content' - }); - } - - /** - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public static callWithResponseAndNoContentResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/response-and-no-content' - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - /** - * @param data The data for the request. - * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param - * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response - * @throws ApiError - */ - public static nonAsciiæøåÆøÅöôêÊ字符串(data: NonAsciiæøåÆøÅöôêÊ字符串Data): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - query: { - 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ - } - }); - } - - /** - * Login User - * @param data The data for the request. - * @param data.formData - * @throws ApiError - */ - public static putWithFormUrlEncoded(data: PutWithFormUrlEncodedData): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - formData: data.formData, - mediaType: 'application/x-www-form-urlencoded' - }); - } - -} - -export class ParametersService { - /** - * @param data The data for the request. - * @param data.fooParam foo in method - * @param data.barParam bar in method - * @param data.xFooBar Parameter with illegal characters - * @throws ApiError - */ - public static deleteFoo(data: DeleteFooData3): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - path: { - foo_param: data.fooParam, - BarParam: data.barParam - }, - headers: { - 'x-Foo-Bar': data.xFooBar - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the header - * @param data.fooAllOfEnum - * @param data.cursor This is the parameter that goes into the query params - * @param data.parameterCookie This is the parameter that goes into the cookie - * @param data.parameterPath This is the parameter that goes into the path - * @param data.requestBody This is the parameter that goes into the body - * @param data.fooRefEnum - * @throws ApiError - */ - public static callWithParameters(data: CallWithParametersData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/{parameterPath}', - path: { - parameterPath: data.parameterPath - }, - cookies: { - parameterCookie: data.parameterCookie - }, - headers: { - parameterHeader: data.parameterHeader - }, - query: { - foo_ref_enum: data.fooRefEnum, - foo_all_of_enum: data.fooAllOfEnum, - cursor: data.cursor - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the request header - * @param data.parameterQuery This is the parameter that goes into the request query params - * @param data.parameterCookie This is the parameter that goes into the cookie - * @param data.requestBody This is the parameter that goes into the body - * @param data.parameterPath1 This is the parameter that goes into the path - * @param data.parameterPath2 This is the parameter that goes into the path - * @param data.parameterPath3 This is the parameter that goes into the path - * @param data._default This is the parameter with a reserved keyword - * @throws ApiError - */ - public static callWithWeirdParameterNames(data: CallWithWeirdParameterNamesData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - path: { - 'parameter.path.1': data.parameterPath1, - 'parameter-path-2': data.parameterPath2, - 'PARAMETER-PATH-3': data.parameterPath3 - }, - cookies: { - 'PARAMETER-COOKIE': data.parameterCookie - }, - headers: { - 'parameter.header': data.parameterHeader - }, - query: { - default: data._default, - 'parameter-query': data.parameterQuery - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.requestBody This is a required parameter - * @param data.page This is an optional parameter - * @throws ApiError - */ - public static getCallWithOptionalParam(data: GetCallWithOptionalParamData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/parameters/', - query: { - page: data.page - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.parameter This is a required parameter - * @param data.requestBody This is an optional parameter - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public static postCallWithOptionalParam(data: PostCallWithOptionalParamData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/', - query: { - parameter: data.parameter - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - -} - -export class RequestBodyService { - /** - * @param data The data for the request. - * @param data.parameter This is a reusable parameter - * @param data.foo A reusable request body - * @throws ApiError - */ - public static postApiRequestBody(data: PostApiRequestBodyData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/requestBody/', - query: { - parameter: data.parameter - }, - body: data.foo, - mediaType: 'application/json' - }); - } - -} - -export class ResponseService { - /** - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public static callWithResponseAndNoContentResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/response-and-no-content' - }); - } - - /** - * @returns import - * @throws ApiError - */ - public static callWithResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/response' - }); - } - - /** - * @returns unknown Message for 200 response - * @returns ModelWithString Message for 201 response - * @returns ModelWithString Message for 202 response - * @throws ApiError - */ - public static callWithDuplicateResponses(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/response', - errors: { - 500: 'Message for 500 error', - 501: 'Message for 501 error', - 502: 'Message for 502 error', - '4XX': 'Message for 4XX errors', - default: 'Default error response' - } - }); - } - - /** - * @returns unknown Message for 200 response - * @returns ModelThatExtends Message for 201 response - * @returns ModelThatExtendsExtends Message for 202 response - * @throws ApiError - */ - public static callWithResponses(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/response', - errors: { - 500: 'Message for 500 error', - 501: 'Message for 501 error', - 502: 'Message for 502 error', - default: 'Message for default response' - } - }); - } - -} - -export class SimpleService { - /** - * @returns Model_From_Zendesk Success - * @throws ApiError - */ - public static apiVVersionODataControllerCount(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple/$count' - }); - } - - /** - * @throws ApiError - */ - public static getCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static putCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static postCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static deleteCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static optionsCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'OPTIONS', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static headCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'HEAD', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static patchCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v{api-version}/simple' - }); - } - -} - -export class TypesService { - /** - * @param data The data for the request. - * @param data.parameterArray This is an array parameter - * @param data.parameterDictionary This is a dictionary parameter - * @param data.parameterEnum This is an enum parameter - * @param data.parameterTuple This is tuple parameter - * @param data.parameterNumber This is a number parameter - * @param data.parameterString This is a string parameter - * @param data.parameterBoolean This is a boolean parameter - * @param data.parameterObject This is an object parameter - * @param data.id This is a number parameter - * @returns number Response is a simple number - * @returns string Response is a simple string - * @returns boolean Response is a simple boolean - * @returns unknown Response is a simple object - * @throws ApiError - */ - public static types(data: TypesData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/types', - path: { - id: data.id - }, - query: { - parameterNumber: data.parameterNumber, - parameterString: data.parameterString, - parameterBoolean: data.parameterBoolean, - parameterObject: data.parameterObject, - parameterArray: data.parameterArray, - parameterDictionary: data.parameterDictionary, - parameterEnum: data.parameterEnum, - parameterTuple: data.parameterTuple - } - }); - } - -} - -export class UploadService { - /** - * @param data The data for the request. - * @param data.formData - * @returns boolean - * @throws ApiError - */ - public static uploadFile(data: UploadFileData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/upload', - formData: data.formData, - mediaType: 'application/x-www-form-urlencoded' - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3/types.gen.ts deleted file mode 100644 index d20c92660..000000000 --- a/packages/openapi-ts-tests/test/generated/v3/types.gen.ts +++ /dev/null @@ -1,1537 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _3e_num_1Период = 'Bird' | 'Dog'; - -export const _3e_num_1Период = { - BIRD: 'Bird', - DOG: 'Dog' -} as const; - -/** - * Model with number-only name - */ -export type _400 = string; - -export type _default = { - name?: string; -}; - -/** - * Model with restricted keyword name - */ -export type _import = string; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: (number) | undefined; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AnyOfAnyAndNull = { - data?: (unknown | null); -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<({ - foo?: string; -} | { - bar?: string; -})>; -}; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<({ - foo?: string; -} | { - bar?: string; -})>; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array<(boolean)>; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array<(number)>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: camelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array<(string)>; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type camelCaseCommentWithBreaks = number; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - firstName: string; - lastname: string; - age: number; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: (({ - boolean?: boolean; -} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: (Array<(_3e_num_1Период | ConstValue)> | null); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(number | string)>; -}); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: ParameterSimpleParameter; -} | { - bar: NonAsciiStringæøåÆØÅöôêÊ字符串; -}) & { - baz: (number) | null; - qux: number; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(boolean)>; -}); -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: (boolean | { - [key: string]: (number); -}); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; - -export type ConstValue = "ConstValue"; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: (string); - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: (string | number | boolean) | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: (string); -}; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple enum with numbers - */ -export const EnumWithExtensions = { - /** - * Used when the status of something is successful - */ - CUSTOM_SUCCESS: 200, - /** - * Used when the status of something has a warning - */ - CUSTOM_WARNING: 400, - /** - * Used when the status of something has an error - */ - CUSTOM_ERROR: 500 -} as const; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * This is a simple enum with numbers - */ -export const EnumWithNumbers = { - '_1': 1, - '_2': 2, - '_3': 3, - '_1.1': 1.1, - '_1.2': 1.2, - '_1.3': 1.3, - '_100': 100, - '_200': 200, - '_300': 300, - '_-100': -100, - '_-200': -200, - '_-300': -300, - '_-1.1': -1.1, - '_-1.2': -1.2, - '_-1.3': -1.3 -} as const; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -export const EnumWithReplacedCharacters = { - _SINGLE_QUOTE_: "'Single Quote'", - _DOUBLE_QUOTES_: '"Double Quotes"', - 'ØÆÅÔÖ_ØÆÅÔÖ字符串': 'øæåôöØÆÅÔÖ字符串', - '_3.1': 3.1, - EMPTY_STRING: '' -} as const; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with strings - */ -export const EnumWithStrings = { - SUCCESS: 'Success', - WARNING: 'Warning', - ERROR: 'Error', - _SINGLE_QUOTE_: "'Single Quote'", - _DOUBLE_QUOTES_: '"Double Quotes"', - 'NON_ASCII__ØÆÅÔÖ_ØÆÅÔÖ字符串': 'Non-ascii: øæåôöØÆÅÔÖ字符串' -} as const; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -export const EnumWithXEnumNames = { - zero: 0, - one: 1, - two: 2 -} as const; - -export type File = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { - item?: boolean; - error?: (string) | null; - readonly hasError?: boolean; - data?: { - [key: string]: unknown; - }; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_String_ = { - item?: (string) | null; - error?: (string) | null; - readonly hasError?: boolean; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type Model_From_Zendesk = string; - -/** - * Circle - */ -export type ModelCircle = { - kind: 'circle'; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: 'square'; - sideLength?: number; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string; -}; - -export type ModelWithAnyOfConstantSizeArray = [ - (number | string), - (number | string), - (number | string) -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - (number & string), - (number & string) -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - ((number) | null | string), - ((number) | null | string), - ((number) | null | string) -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - (number | _import), - (number | _import) -]; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnly = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -export type ModelWithConst = { - String?: "String"; - number?: 0; - null?: null; - withType?: "Some string"; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: (string); - }; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: boolean; -}; - -/** - * This is a simple enum with strings - */ -export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - -/** - * This is a simple enum with strings - */ -export const foo_bar_enum = { - SUCCESS: 'Success', - WARNING: 'Warning', - ERROR: 'Error', - 'ØÆÅ字符串': 'ØÆÅ字符串' -} as const; - -/** - * These are the HTTP error code enums - */ -export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - -/** - * These are the HTTP error code enums - */ -export const statusCode = { - _100: '100', - _200_FOO: '200 FOO', - _300_FOO_BAR: '300 FOO_BAR', - _400_FOO_BAR: '400 foo-bar', - _500_FOO_BAR: '500 foo.bar', - _600_FOO_BAR: '600 foo&bar' -} as const; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -export type foo_bar_baz_qux = '3.0'; - -export const foo_bar_baz_qux = { - _3_0: '3.0' -} as const; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array<(string)>; - data?: (ModelWithNestedArrayEnumsData); -}; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export const ModelWithNestedArrayEnumsDataBar = { - BAZ: 'baz', - QUX: 'qux' -} as const; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export const ModelWithNestedArrayEnumsDataFoo = { - FOO: 'foo', - BAR: 'bar' -} as const; - -export type ModelWithNestedCompositionEnums = { - foo?: (ModelWithNestedArrayEnumsDataFoo); -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: ('Success' | 'Warning' | 'Error'); - }; - dictionaryWithEnumFromDescription?: { - [key: string]: (number); - }; - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; - arrayWithDescription?: Array<(number)>; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedProperties = { - readonly first: { - readonly second: { - readonly third: (string) | null; - } | null; - } | null; -}; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: (string) | null; - /** - * This is a simple string property - */ - nullableProp2?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: (string) | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Период - */ -export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; - -/** - * Период - */ -export const value = { - '_-10': -10, - '_-1': -1, - '_0': 0, - '_1': 1, - '_3': 3, - '_6': 6, - '_12': 12 -} as const; - -export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { - baz: (number) | null; - qux: number; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - (string), - (string) - ]; - foo: 'Corge'; -}; - -export type foo = 'Bar'; - -export const foo = { - BAR: 'Bar' -} as const; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPattern = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - (number | string), - string -]; - -/** - * This is a model with one nested property - */ -export type ModelWithProperties = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: (string) | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -export type ModelWithReadOnlyAndWriteOnly = { - foo: string; - readonly bar: string; - baz: string; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReference = { - prop?: ModelWithProperties; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: (Array<(string | boolean)> | null); -}; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array<(string)>; -}; - -/** - * This is a reusable parameter - */ -export type ParameterSimpleParameter = string; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Parameter with illegal characters - */ -export type Parameterx_Foo_Bar = ModelWithString; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<({ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; -})>; -}; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple file - */ -export type SimpleFile = (Blob | File); - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = (string) | null; - -export type CollectionFormatData = { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCsv: Array<(string)> | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array<(string)> | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array<(string)> | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySsv: Array<(string)> | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTsv: Array<(string)> | null; -}; - -export type ComplexTypesData = { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; -}; - -export type ComplexTypesResponse = (Array); - -export type ComplexParamsData = { - id: number; - requestBody?: { - readonly key: (string) | null; - name: (string) | null; - enabled?: boolean; - readonly type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array<(string)> | null; - parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); - readonly user?: { - readonly id?: number; - readonly name?: (string) | null; - }; - }; -}; - -export type ComplexParamsResponse = (ModelWithString); - -export type PatchApiNoTagResponse = (unknown); - -export type ImportData = { - requestBody: (ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly); -}; - -export type ImportResponse = (Model_From_Zendesk | ModelWithReadOnlyAndWriteOnly); - -export type FooWowResponse = (unknown); - -export type GetApiSimpleOperationData = { - /** - * foo in method - */ - fooParam: string; -}; - -export type GetApiSimpleOperationResponse = (number); - -export type CallWithDefaultParametersData = { - /** - * This is a simple boolean with default value - */ - parameterBoolean?: (boolean) | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: (ModelWithString) | null; - /** - * This is a simple number with default value - */ - parameterNumber?: (number) | null; - /** - * This is a simple string with default value - */ - parameterString?: (string) | null; -}; - -export type CallWithDefaultOptionalParametersData = { - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; -}; - -export type CallToTestOrderOfParamsData = { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: (string) | null; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: (string) | null; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; -}; - -export type DeprecatedCallData = { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: (DeprecatedModel) | null; -}; - -export type CallWithDescriptionsData = { - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: unknown; - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: unknown; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: unknown; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: unknown; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: unknown; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: unknown; -}; - -export type TestErrorCodeData = { - /** - * Status code to return - */ - status: number; -}; - -export type TestErrorCodeResponse = (unknown); - -export type FileResponseData = { - id: string; -}; - -export type FileResponseResponse = ((Blob | File)); - -export type PostApiFormDataData = { - /** - * A reusable request body - */ - formData?: ModelWithString; - /** - * This is a reusable parameter - */ - parameter?: string; -}; - -export type CallWithResultFromHeaderResponse = (string); - -export type MultipartRequestData = { - formData?: { - content?: (Blob | File); - data?: ((ModelWithString) | null); - }; -}; - -export type MultipartResponseResponse = ({ - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; -}); - -export type DummyAResponse = (_400); - -export type DummyBResponse = (void); - -export type CallWithNoContentResponseResponse = (void); - -export type CallWithResponseAndNoContentResponseResponse = (number | void); - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - /** - * Dummy input param - */ - nonAsciiParamæøåÆøÅöôêÊ: number; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = (Array); - -export type PutWithFormUrlEncodedData = { - formData: ArrayWithStrings; -}; - -export type DeleteFooData3 = { - /** - * bar in method - */ - barParam: string; - /** - * foo in method - */ - fooParam: string; - /** - * Parameter with illegal characters - */ - xFooBar: ModelWithString; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the query params - */ - cursor: (string) | null; - fooAllOfEnum: (ModelWithNestedArrayEnumsDataFoo); - fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the cookie - */ - parameterCookie: (string) | null; - /** - * This is the parameter that goes into the header - */ - parameterHeader: (string) | null; - /** - * This is the parameter that goes into the path - */ - parameterPath: (string) | null; - /** - * This is the parameter that goes into the body - */ - requestBody: { - [key: string]: unknown; - } | null; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter with a reserved keyword - */ - _default?: string; - /** - * This is the parameter that goes into the cookie - */ - parameterCookie: (string) | null; - /** - * This is the parameter that goes into the request header - */ - parameterHeader: (string) | null; - /** - * This is the parameter that goes into the path - */ - parameterPath1?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath2?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath3?: string; - /** - * This is the parameter that goes into the request query params - */ - parameterQuery: (string) | null; - /** - * This is the parameter that goes into the body - */ - requestBody: (ModelWithString) | null; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - page?: number; - /** - * This is a required parameter - */ - requestBody: ModelWithOneOfEnum; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is a required parameter - */ - parameter: Pageable; - /** - * This is an optional parameter - */ - requestBody?: { - offset?: (number) | null; - }; -}; - -export type PostCallWithOptionalParamResponse = (number | void); - -export type PostApiRequestBodyData = { - /** - * A reusable request body - */ - foo?: ModelWithString; - /** - * This is a reusable parameter - */ - parameter?: string; -}; - -export type CallWithResponseResponse = (_import); - -export type CallWithDuplicateResponsesResponse = ((ModelWithBoolean & ModelWithInteger) | ModelWithString); - -export type CallWithResponsesResponse = ({ - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; -} | ModelThatExtends | ModelThatExtendsExtends); - -export type ApiVVersionODataControllerCountResponse = (Model_From_Zendesk); - -export type TypesData = { - /** - * This is a number parameter - */ - id?: number; - /** - * This is an array parameter - */ - parameterArray: Array<(string)> | null; - /** - * This is a boolean parameter - */ - parameterBoolean: (boolean) | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: ('Success' | 'Warning' | 'Error') | null; - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is a string parameter - */ - parameterString: (string) | null; - /** - * This is tuple parameter - */ - parameterTuple: [ - number, - number, - number, - number - ]; -}; - -export type TypesResponse = (number | string | boolean | { - [key: string]: unknown; -}); - -export type UploadFileData = { - formData: (Blob | File); -}; - -export type UploadFileResponse = (boolean); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_angular/core/ApiError.ts deleted file mode 100644 index 36675d288..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular/core/ApiError.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: unknown; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_angular/core/ApiRequestOptions.ts deleted file mode 100644 index 939a0aa4c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular/core/ApiRequestOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type ApiRequestOptions = { - readonly body?: any; - readonly cookies?: Record; - readonly errors?: Record; - readonly formData?: Record | any[] | Blob | File; - readonly headers?: Record; - readonly mediaType?: string; - readonly method: - | 'DELETE' - | 'GET' - | 'HEAD' - | 'OPTIONS' - | 'PATCH' - | 'POST' - | 'PUT'; - readonly path?: Record; - readonly query?: Record; - readonly responseHeader?: string; - readonly responseTransformer?: (data: unknown) => Promise; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_angular/core/ApiResult.ts deleted file mode 100644 index 4c58e3913..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular/core/ApiResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ApiResult = { - readonly body: TData; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_angular/core/OpenAPI.ts deleted file mode 100644 index 9fafe8d52..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular/core/OpenAPI.ts +++ /dev/null @@ -1,55 +0,0 @@ -import type { HttpResponse } from '@angular/common/http'; -import type { ApiRequestOptions } from './ApiRequestOptions'; - -type Headers = Record; -type Middleware = (value: T) => T | Promise; -type Resolver = (options: ApiRequestOptions) => Promise; - -export class Interceptors { - _fns: Middleware[]; - - constructor() { - this._fns = []; - } - - eject(fn: Middleware): void { - const index = this._fns.indexOf(fn); - if (index !== -1) { - this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; - } - } - - use(fn: Middleware): void { - this._fns = [...this._fns, fn]; - } -} - -export type OpenAPIConfig = { - BASE: string; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - ENCODE_PATH?: ((path: string) => string) | undefined; - HEADERS?: Headers | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - VERSION: string; - WITH_CREDENTIALS: boolean; - interceptors: { - response: Interceptors>; - }; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: 'http://localhost:3000/base', - CREDENTIALS: 'include', - ENCODE_PATH: undefined, - HEADERS: undefined, - PASSWORD: undefined, - TOKEN: undefined, - USERNAME: undefined, - VERSION: '1.0', - WITH_CREDENTIALS: false, - interceptors: { - response: new Interceptors(), - }, -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_angular/core/request.ts deleted file mode 100644 index 4eab34ab6..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular/core/request.ts +++ /dev/null @@ -1,337 +0,0 @@ -import { HttpClient, HttpHeaders } from '@angular/common/http'; -import type { HttpResponse, HttpErrorResponse } from '@angular/common/http'; -import { forkJoin, of, throwError } from 'rxjs'; -import { catchError, map, switchMap } from 'rxjs/operators'; -import type { Observable } from 'rxjs'; - -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const isString = (value: unknown): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: any): value is Blob => { - return value instanceof Blob; -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const encodePair = (key: string, value: unknown) => { - if (value === undefined || value === null) { - return; - } - - if (value instanceof Date) { - append(key, value.toISOString()); - } else if (Array.isArray(value)) { - value.forEach(v => encodePair(key, v)); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); - } else { - append(key, value); - } - }; - - Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - - return qs.length ? `?${qs.join('&')}` : ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = config.BASE + path; - return options.query ? url + getQueryString(options.query) : url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([, value]) => value !== undefined && value !== null) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = (config: OpenAPIConfig, options: ApiRequestOptions): Observable => { - return forkJoin({ - // @ts-ignore - token: resolve(options, config.TOKEN), - // @ts-ignore - username: resolve(options, config.USERNAME), - // @ts-ignore - password: resolve(options, config.PASSWORD), - // @ts-ignore - additionalHeaders: resolve(options, config.HEADERS), - }).pipe( - map(({ token, username, password, additionalHeaders }) => { - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - }) - .filter(([, value]) => value !== undefined && value !== null) - .reduce((headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), {} as Record); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return new HttpHeaders(headers); - }), - ); -}; - -export const getRequestBody = (options: ApiRequestOptions): unknown => { - if (options.body) { - if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { - return JSON.stringify(options.body); - } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; -}; - -export const sendRequest = ( - config: OpenAPIConfig, - options: ApiRequestOptions, - http: HttpClient, - url: string, - body: unknown, - formData: FormData | undefined, - headers: HttpHeaders -): Observable> => { - return http.request(options.method, url, { - headers, - body: body ?? formData, - withCredentials: config.WITH_CREDENTIALS, - observe: 'response', - }); -}; - -export const getResponseHeader = (response: HttpResponse, responseHeader?: string): string | undefined => { - if (responseHeader) { - const value = response.headers.get(responseHeader); - if (isString(value)) { - return value; - } - } - return undefined; -}; - -export const getResponseBody = (response: HttpResponse): T | undefined => { - if (response.status !== 204 && response.body !== null) { - return response.body; - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 405: 'Method Not Allowed', - 406: 'Not Acceptable', - 407: 'Proxy Authentication Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Payload Too Large', - 414: 'URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Range Not Satisfiable', - 417: 'Expectation Failed', - 418: 'Im a teapot', - 421: 'Misdirected Request', - 422: 'Unprocessable Content', - 423: 'Locked', - 424: 'Failed Dependency', - 425: 'Too Early', - 426: 'Upgrade Required', - 428: 'Precondition Required', - 429: 'Too Many Requests', - 431: 'Request Header Fields Too Large', - 451: 'Unavailable For Legal Reasons', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported', - 506: 'Variant Also Negotiates', - 507: 'Insufficient Storage', - 508: 'Loop Detected', - 510: 'Not Extended', - 511: 'Network Authentication Required', - ...options.errors, - } - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError(options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param http The Angular HTTP client - * @param options The request options from the service - * @returns Observable - * @throws ApiError - */ -export const request = (config: OpenAPIConfig, http: HttpClient, options: ApiRequestOptions): Observable => { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - - return getHeaders(config, options).pipe( - switchMap(headers => { - return sendRequest(config, options, http, url, body, formData, headers); - }), - switchMap(async response => { - for (const fn of config.interceptors.response._fns) { - response = await fn(response); - } - const responseBody = getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - let transformedBody = responseBody; - if (options.responseTransformer && response.ok) { - transformedBody = await options.responseTransformer(responseBody) - } - - return { - url, - ok: response.ok, - status: response.status, - statusText: response.statusText, - body: responseHeader ?? transformedBody, - } as ApiResult; - }), - catchError((error: HttpErrorResponse) => { - if (!error.status) { - return throwError(() => error); - } - return of({ - url, - ok: error.ok, - status: error.status, - statusText: error.statusText, - body: error.error ?? error.statusText, - } as ApiResult); - }), - map(result => { - catchErrorCodes(options, result); - return result.body as T; - }), - catchError((error: ApiError) => { - return throwError(() => error); - }), - ); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular/index.ts b/packages/openapi-ts-tests/test/generated/v3_angular/index.ts deleted file mode 100644 index 3f555f4f1..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export { ApiError } from './core/ApiError'; -export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_angular/sdk.gen.ts deleted file mode 100644 index 033cabb6e..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular/sdk.gen.ts +++ /dev/null @@ -1,1030 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import type { Observable } from 'rxjs'; -import { OpenAPI } from './core/OpenAPI'; -import { request as __request } from './core/request'; -import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; - -@Injectable({ - providedIn: 'root' -}) -export class CollectionFormatService { - constructor(public readonly http: HttpClient) { } - - /** - * @param data The data for the request. - * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) - * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) - * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) - * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) - * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) - * @throws ApiError - */ - public collectionFormat(data: CollectionFormatData): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/collectionFormat', - query: { - parameterArrayCSV: data.parameterArrayCsv, - parameterArraySSV: data.parameterArraySsv, - parameterArrayTSV: data.parameterArrayTsv, - parameterArrayPipes: data.parameterArrayPipes, - parameterArrayMulti: data.parameterArrayMulti - } - }); - } - -} - -@Injectable({ - providedIn: 'root' -}) -export class ComplexService { - constructor(public readonly http: HttpClient) { } - - /** - * @param data The data for the request. - * @param data.parameterObject Parameter containing object - * @param data.parameterReference Parameter containing reference - * @returns ModelWithString Successful response - * @throws ApiError - */ - public complexTypes(data: ComplexTypesData): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/complex', - query: { - parameterObject: data.parameterObject, - parameterReference: data.parameterReference - }, - errors: { - 400: '400 `server` error', - 500: '500 server error' - } - }); - } - - /** - * @param data The data for the request. - * @param data.id - * @param data.requestBody - * @returns ModelWithString Success - * @throws ApiError - */ - public complexParams(data: ComplexParamsData): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/v{api-version}/complex/{id}', - path: { - id: data.id - }, - body: data.requestBody, - mediaType: 'application/json-patch+json' - }); - } - -} - -@Injectable({ - providedIn: 'root' -}) -export class DefaultService { - constructor(public readonly http: HttpClient) { } - - /** - * @throws ApiError - */ - public export(): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public patchApiNoTag(): Observable { - return __request(OpenAPI, this.http, { - method: 'PATCH', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @param data The data for the request. - * @param data.requestBody - * @returns Model_From_Zendesk Success - * @returns ModelWithReadOnlyAndWriteOnly Default success response - * @throws ApiError - */ - public import(data: ImportData): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/no+tag', - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public fooWow(): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @param data The data for the request. - * @param data.fooParam foo in method - * @returns number Response is a simple number - * @throws ApiError - */ - public getApiSimpleOperation(data: GetApiSimpleOperationData): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/simple:operation', - path: { - foo_param: data.fooParam - }, - errors: { - default: 'Default error response' - } - }); - } - -} - -@Injectable({ - providedIn: 'root' -}) -export class DefaultsService { - constructor(public readonly http: HttpClient) { } - - /** - * @param data The data for the request. - * @param data.parameterString This is a simple string with default value - * @param data.parameterNumber This is a simple number with default value - * @param data.parameterBoolean This is a simple boolean with default value - * @param data.parameterEnum This is a simple enum with default value - * @param data.parameterModel This is a simple model with default value - * @throws ApiError - */ - public callWithDefaultParameters(data: CallWithDefaultParametersData = {}): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterString This is a simple string that is optional with default value - * @param data.parameterNumber This is a simple number that is optional with default value - * @param data.parameterBoolean This is a simple boolean that is optional with default value - * @param data.parameterEnum This is a simple enum that is optional with default value - * @param data.parameterModel This is a simple model that is optional with default value - * @throws ApiError - */ - public callWithDefaultOptionalParameters(data: CallWithDefaultOptionalParametersData = {}): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterStringWithNoDefault This is a string with no default - * @param data.parameterOptionalStringWithDefault This is a optional string with default - * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default - * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default - * @param data.parameterStringWithDefault This is a string with default - * @param data.parameterStringWithEmptyDefault This is a string with empty default - * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default - * @param data.parameterStringNullableWithDefault This is a string that can be null with default - * @throws ApiError - */ - public callToTestOrderOfParams(data: CallToTestOrderOfParamsData): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/v{api-version}/defaults', - query: { - parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, - parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, - parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, - parameterStringWithDefault: data.parameterStringWithDefault, - parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, - parameterStringWithNoDefault: data.parameterStringWithNoDefault, - parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, - parameterStringNullableWithDefault: data.parameterStringNullableWithDefault - } - }); - } - -} - -@Injectable({ - providedIn: 'root' -}) -export class DeprecatedService { - constructor(public readonly http: HttpClient) { } - - /** - * @deprecated - * @param data The data for the request. - * @param data.parameter This parameter is deprecated - * @throws ApiError - */ - public deprecatedCall(data: DeprecatedCallData): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/parameters/deprecated', - headers: { - parameter: data.parameter - } - }); - } - -} - -@Injectable({ - providedIn: 'root' -}) -export class DescriptionsService { - constructor(public readonly http: HttpClient) { } - - /** - * @param data The data for the request. - * @param data.parameterWithBreaks Testing multiline comments in string: First line - * Second line - * - * Fourth line - * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work - * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work - * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work - * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work - * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work - * @throws ApiError - */ - public callWithDescriptions(data: CallWithDescriptionsData = {}): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/descriptions/', - query: { - parameterWithBreaks: data.parameterWithBreaks, - parameterWithBackticks: data.parameterWithBackticks, - parameterWithSlashes: data.parameterWithSlashes, - parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders, - parameterWithQuotes: data.parameterWithQuotes, - parameterWithReservedCharacters: data.parameterWithReservedCharacters - } - }); - } - -} - -@Injectable({ - providedIn: 'root' -}) -export class DuplicateService { - constructor(public readonly http: HttpClient) { } - - /** - * @throws ApiError - */ - public duplicateName(): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public duplicateName1(): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public duplicateName2(): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public duplicateName3(): Observable { - return __request(OpenAPI, this.http, { - method: 'DELETE', - url: '/api/v{api-version}/duplicate' - }); - } - -} - -@Injectable({ - providedIn: 'root' -}) -export class ErrorService { - constructor(public readonly http: HttpClient) { } - - /** - * @param data The data for the request. - * @param data.status Status code to return - * @returns unknown Custom message: Successful response - * @throws ApiError - */ - public testErrorCode(data: TestErrorCodeData): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/error', - query: { - status: data.status - }, - errors: { - 500: 'Custom message: Internal Server Error', - 501: 'Custom message: Not Implemented', - 502: 'Custom message: Bad Gateway', - 503: 'Custom message: Service Unavailable' - } - }); - } - -} - -@Injectable({ - providedIn: 'root' -}) -export class FileResponseService { - constructor(public readonly http: HttpClient) { } - - /** - * @param data The data for the request. - * @param data.id - * @returns binary Success - * @throws ApiError - */ - public fileResponse(data: FileResponseData): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/file/{id}', - path: { - id: data.id - } - }); - } - -} - -@Injectable({ - providedIn: 'root' -}) -export class FormDataService { - constructor(public readonly http: HttpClient) { } - - /** - * @param data The data for the request. - * @param data.parameter This is a reusable parameter - * @param data.formData A reusable request body - * @throws ApiError - */ - public postApiFormData(data: PostApiFormDataData = {}): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/formData/', - query: { - parameter: data.parameter - }, - formData: data.formData, - mediaType: 'multipart/form-data' - }); - } - -} - -@Injectable({ - providedIn: 'root' -}) -export class HeaderService { - constructor(public readonly http: HttpClient) { } - - /** - * @returns string Successful response - * @throws ApiError - */ - public callWithResultFromHeader(): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/header', - responseHeader: 'operation-location', - errors: { - 400: '400 server error', - 500: '500 server error' - } - }); - } - -} - -@Injectable({ - providedIn: 'root' -}) -export class MultipartService { - constructor(public readonly http: HttpClient) { } - - /** - * @param data The data for the request. - * @param data.formData - * @throws ApiError - */ - public multipartRequest(data: MultipartRequestData = {}): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/multipart', - formData: data.formData, - mediaType: 'multipart/form-data' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public multipartResponse(): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/multipart' - }); - } - -} - -@Injectable({ - providedIn: 'root' -}) -export class MultipleTags1Service { - constructor(public readonly http: HttpClient) { } - - /** - * @returns _400 - * @throws ApiError - */ - public dummyA(): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/a' - }); - } - - /** - * @returns void Success - * @throws ApiError - */ - public dummyB(): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -@Injectable({ - providedIn: 'root' -}) -export class MultipleTags2Service { - constructor(public readonly http: HttpClient) { } - - /** - * @returns _400 - * @throws ApiError - */ - public dummyA(): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/a' - }); - } - - /** - * @returns void Success - * @throws ApiError - */ - public dummyB(): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -@Injectable({ - providedIn: 'root' -}) -export class MultipleTags3Service { - constructor(public readonly http: HttpClient) { } - - /** - * @returns void Success - * @throws ApiError - */ - public dummyB(): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -@Injectable({ - providedIn: 'root' -}) -export class NoContentService { - constructor(public readonly http: HttpClient) { } - - /** - * @returns void Success - * @throws ApiError - */ - public callWithNoContentResponse(): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/no-content' - }); - } - - /** - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public callWithResponseAndNoContentResponse(): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/response-and-no-content' - }); - } - -} - -@Injectable({ - providedIn: 'root' -}) -export class NonAsciiÆøåÆøÅöôêÊService { - constructor(public readonly http: HttpClient) { } - - /** - * @param data The data for the request. - * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param - * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response - * @throws ApiError - */ - public nonAsciiæøåÆøÅöôêÊ字符串(data: NonAsciiæøåÆøÅöôêÊ字符串Data): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - query: { - 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ - } - }); - } - - /** - * Login User - * @param data The data for the request. - * @param data.formData - * @throws ApiError - */ - public putWithFormUrlEncoded(data: PutWithFormUrlEncodedData): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - formData: data.formData, - mediaType: 'application/x-www-form-urlencoded' - }); - } - -} - -@Injectable({ - providedIn: 'root' -}) -export class ParametersService { - constructor(public readonly http: HttpClient) { } - - /** - * @param data The data for the request. - * @param data.fooParam foo in method - * @param data.barParam bar in method - * @param data.xFooBar Parameter with illegal characters - * @throws ApiError - */ - public deleteFoo(data: DeleteFooData3): Observable { - return __request(OpenAPI, this.http, { - method: 'DELETE', - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - path: { - foo_param: data.fooParam, - BarParam: data.barParam - }, - headers: { - 'x-Foo-Bar': data.xFooBar - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the header - * @param data.fooAllOfEnum - * @param data.cursor This is the parameter that goes into the query params - * @param data.parameterCookie This is the parameter that goes into the cookie - * @param data.parameterPath This is the parameter that goes into the path - * @param data.requestBody This is the parameter that goes into the body - * @param data.fooRefEnum - * @throws ApiError - */ - public callWithParameters(data: CallWithParametersData): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/parameters/{parameterPath}', - path: { - parameterPath: data.parameterPath - }, - cookies: { - parameterCookie: data.parameterCookie - }, - headers: { - parameterHeader: data.parameterHeader - }, - query: { - foo_ref_enum: data.fooRefEnum, - foo_all_of_enum: data.fooAllOfEnum, - cursor: data.cursor - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the request header - * @param data.parameterQuery This is the parameter that goes into the request query params - * @param data.parameterCookie This is the parameter that goes into the cookie - * @param data.requestBody This is the parameter that goes into the body - * @param data.parameterPath1 This is the parameter that goes into the path - * @param data.parameterPath2 This is the parameter that goes into the path - * @param data.parameterPath3 This is the parameter that goes into the path - * @param data._default This is the parameter with a reserved keyword - * @throws ApiError - */ - public callWithWeirdParameterNames(data: CallWithWeirdParameterNamesData): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - path: { - 'parameter.path.1': data.parameterPath1, - 'parameter-path-2': data.parameterPath2, - 'PARAMETER-PATH-3': data.parameterPath3 - }, - cookies: { - 'PARAMETER-COOKIE': data.parameterCookie - }, - headers: { - 'parameter.header': data.parameterHeader - }, - query: { - default: data._default, - 'parameter-query': data.parameterQuery - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.requestBody This is a required parameter - * @param data.page This is an optional parameter - * @throws ApiError - */ - public getCallWithOptionalParam(data: GetCallWithOptionalParamData): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/parameters/', - query: { - page: data.page - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.parameter This is a required parameter - * @param data.requestBody This is an optional parameter - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public postCallWithOptionalParam(data: PostCallWithOptionalParamData): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/parameters/', - query: { - parameter: data.parameter - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - -} - -@Injectable({ - providedIn: 'root' -}) -export class RequestBodyService { - constructor(public readonly http: HttpClient) { } - - /** - * @param data The data for the request. - * @param data.parameter This is a reusable parameter - * @param data.foo A reusable request body - * @throws ApiError - */ - public postApiRequestBody(data: PostApiRequestBodyData = {}): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/requestBody/', - query: { - parameter: data.parameter - }, - body: data.foo, - mediaType: 'application/json' - }); - } - -} - -@Injectable({ - providedIn: 'root' -}) -export class ResponseService { - constructor(public readonly http: HttpClient) { } - - /** - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public callWithResponseAndNoContentResponse(): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/response-and-no-content' - }); - } - - /** - * @returns import - * @throws ApiError - */ - public callWithResponse(): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/response' - }); - } - - /** - * @returns unknown Message for 200 response - * @returns ModelWithString Message for 201 response - * @returns ModelWithString Message for 202 response - * @throws ApiError - */ - public callWithDuplicateResponses(): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/response', - errors: { - 500: 'Message for 500 error', - 501: 'Message for 501 error', - 502: 'Message for 502 error', - '4XX': 'Message for 4XX errors', - default: 'Default error response' - } - }); - } - - /** - * @returns unknown Message for 200 response - * @returns ModelThatExtends Message for 201 response - * @returns ModelThatExtendsExtends Message for 202 response - * @throws ApiError - */ - public callWithResponses(): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/v{api-version}/response', - errors: { - 500: 'Message for 500 error', - 501: 'Message for 501 error', - 502: 'Message for 502 error', - default: 'Message for default response' - } - }); - } - -} - -@Injectable({ - providedIn: 'root' -}) -export class SimpleService { - constructor(public readonly http: HttpClient) { } - - /** - * @returns Model_From_Zendesk Success - * @throws ApiError - */ - public apiVVersionODataControllerCount(): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/simple/$count' - }); - } - - /** - * @throws ApiError - */ - public getCallWithoutParametersAndResponse(): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public putCallWithoutParametersAndResponse(): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public postCallWithoutParametersAndResponse(): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public deleteCallWithoutParametersAndResponse(): Observable { - return __request(OpenAPI, this.http, { - method: 'DELETE', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public optionsCallWithoutParametersAndResponse(): Observable { - return __request(OpenAPI, this.http, { - method: 'OPTIONS', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public headCallWithoutParametersAndResponse(): Observable { - return __request(OpenAPI, this.http, { - method: 'HEAD', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public patchCallWithoutParametersAndResponse(): Observable { - return __request(OpenAPI, this.http, { - method: 'PATCH', - url: '/api/v{api-version}/simple' - }); - } - -} - -@Injectable({ - providedIn: 'root' -}) -export class TypesService { - constructor(public readonly http: HttpClient) { } - - /** - * @param data The data for the request. - * @param data.parameterArray This is an array parameter - * @param data.parameterDictionary This is a dictionary parameter - * @param data.parameterEnum This is an enum parameter - * @param data.parameterTuple This is tuple parameter - * @param data.parameterNumber This is a number parameter - * @param data.parameterString This is a string parameter - * @param data.parameterBoolean This is a boolean parameter - * @param data.parameterObject This is an object parameter - * @param data.id This is a number parameter - * @returns number Response is a simple number - * @returns string Response is a simple string - * @returns boolean Response is a simple boolean - * @returns unknown Response is a simple object - * @throws ApiError - */ - public types(data: TypesData): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/types', - path: { - id: data.id - }, - query: { - parameterNumber: data.parameterNumber, - parameterString: data.parameterString, - parameterBoolean: data.parameterBoolean, - parameterObject: data.parameterObject, - parameterArray: data.parameterArray, - parameterDictionary: data.parameterDictionary, - parameterEnum: data.parameterEnum, - parameterTuple: data.parameterTuple - } - }); - } - -} - -@Injectable({ - providedIn: 'root' -}) -export class UploadService { - constructor(public readonly http: HttpClient) { } - - /** - * @param data The data for the request. - * @param data.formData - * @returns boolean - * @throws ApiError - */ - public uploadFile(data: UploadFileData): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/upload', - formData: data.formData, - mediaType: 'application/x-www-form-urlencoded' - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_angular/types.gen.ts deleted file mode 100644 index 344261da0..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular/types.gen.ts +++ /dev/null @@ -1,1414 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _3e_num_1Период = 'Bird' | 'Dog'; - -/** - * Model with number-only name - */ -export type _400 = string; - -export type _default = { - name?: string; -}; - -/** - * Model with restricted keyword name - */ -export type _import = string; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: (number) | undefined; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AnyOfAnyAndNull = { - data?: (unknown | null); -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<({ - foo?: string; -} | { - bar?: string; -})>; -}; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<({ - foo?: string; -} | { - bar?: string; -})>; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array<(boolean)>; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array<(number)>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: camelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array<(string)>; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type camelCaseCommentWithBreaks = number; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - firstName: string; - lastname: string; - age: number; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: (({ - boolean?: boolean; -} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: (Array<(_3e_num_1Период | ConstValue)> | null); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(number | string)>; -}); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: ParameterSimpleParameter; -} | { - bar: NonAsciiStringæøåÆØÅöôêÊ字符串; -}) & { - baz: (number) | null; - qux: number; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(boolean)>; -}); -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: (boolean | { - [key: string]: (number); -}); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; - -export type ConstValue = "ConstValue"; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: (string); - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: (string | number | boolean) | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: (string); -}; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -export type File = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { - item?: boolean; - error?: (string) | null; - readonly hasError?: boolean; - data?: { - [key: string]: unknown; - }; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_String_ = { - item?: (string) | null; - error?: (string) | null; - readonly hasError?: boolean; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type Model_From_Zendesk = string; - -/** - * Circle - */ -export type ModelCircle = { - kind: 'circle'; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: 'square'; - sideLength?: number; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string; -}; - -export type ModelWithAnyOfConstantSizeArray = [ - (number | string), - (number | string), - (number | string) -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - (number & string), - (number & string) -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - ((number) | null | string), - ((number) | null | string), - ((number) | null | string) -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - (number | _import), - (number | _import) -]; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnly = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -export type ModelWithConst = { - String?: "String"; - number?: 0; - null?: null; - withType?: "Some string"; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: (string); - }; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: boolean; -}; - -/** - * This is a simple enum with strings - */ -export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - -/** - * These are the HTTP error code enums - */ -export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -export type foo_bar_baz_qux = '3.0'; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array<(string)>; - data?: (ModelWithNestedArrayEnumsData); -}; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedCompositionEnums = { - foo?: (ModelWithNestedArrayEnumsDataFoo); -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: ('Success' | 'Warning' | 'Error'); - }; - dictionaryWithEnumFromDescription?: { - [key: string]: (number); - }; - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; - arrayWithDescription?: Array<(number)>; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedProperties = { - readonly first: { - readonly second: { - readonly third: (string) | null; - } | null; - } | null; -}; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: (string) | null; - /** - * This is a simple string property - */ - nullableProp2?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: (string) | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Период - */ -export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; - -export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { - baz: (number) | null; - qux: number; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - (string), - (string) - ]; - foo: 'Corge'; -}; - -export type foo = 'Bar'; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPattern = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - (number | string), - string -]; - -/** - * This is a model with one nested property - */ -export type ModelWithProperties = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: (string) | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -export type ModelWithReadOnlyAndWriteOnly = { - foo: string; - readonly bar: string; - baz: string; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReference = { - prop?: ModelWithProperties; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: (Array<(string | boolean)> | null); -}; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array<(string)>; -}; - -/** - * This is a reusable parameter - */ -export type ParameterSimpleParameter = string; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Parameter with illegal characters - */ -export type Parameterx_Foo_Bar = ModelWithString; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<({ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; -})>; -}; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple file - */ -export type SimpleFile = (Blob | File); - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = (string) | null; - -export type CollectionFormatData = { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCsv: Array<(string)> | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array<(string)> | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array<(string)> | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySsv: Array<(string)> | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTsv: Array<(string)> | null; -}; - -export type ComplexTypesData = { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; -}; - -export type ComplexTypesResponse = (Array); - -export type ComplexParamsData = { - id: number; - requestBody?: { - readonly key: (string) | null; - name: (string) | null; - enabled?: boolean; - readonly type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array<(string)> | null; - parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); - readonly user?: { - readonly id?: number; - readonly name?: (string) | null; - }; - }; -}; - -export type ComplexParamsResponse = (ModelWithString); - -export type PatchApiNoTagResponse = (unknown); - -export type ImportData = { - requestBody: (ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly); -}; - -export type ImportResponse = (Model_From_Zendesk | ModelWithReadOnlyAndWriteOnly); - -export type FooWowResponse = (unknown); - -export type GetApiSimpleOperationData = { - /** - * foo in method - */ - fooParam: string; -}; - -export type GetApiSimpleOperationResponse = (number); - -export type CallWithDefaultParametersData = { - /** - * This is a simple boolean with default value - */ - parameterBoolean?: (boolean) | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: (ModelWithString) | null; - /** - * This is a simple number with default value - */ - parameterNumber?: (number) | null; - /** - * This is a simple string with default value - */ - parameterString?: (string) | null; -}; - -export type CallWithDefaultOptionalParametersData = { - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; -}; - -export type CallToTestOrderOfParamsData = { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: (string) | null; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: (string) | null; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; -}; - -export type DeprecatedCallData = { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: (DeprecatedModel) | null; -}; - -export type CallWithDescriptionsData = { - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: unknown; - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: unknown; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: unknown; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: unknown; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: unknown; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: unknown; -}; - -export type TestErrorCodeData = { - /** - * Status code to return - */ - status: number; -}; - -export type TestErrorCodeResponse = (unknown); - -export type FileResponseData = { - id: string; -}; - -export type FileResponseResponse = ((Blob | File)); - -export type PostApiFormDataData = { - /** - * A reusable request body - */ - formData?: ModelWithString; - /** - * This is a reusable parameter - */ - parameter?: string; -}; - -export type CallWithResultFromHeaderResponse = (string); - -export type MultipartRequestData = { - formData?: { - content?: (Blob | File); - data?: ((ModelWithString) | null); - }; -}; - -export type MultipartResponseResponse = ({ - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; -}); - -export type DummyAResponse = (_400); - -export type DummyBResponse = (void); - -export type CallWithNoContentResponseResponse = (void); - -export type CallWithResponseAndNoContentResponseResponse = (number | void); - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - /** - * Dummy input param - */ - nonAsciiParamæøåÆøÅöôêÊ: number; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = (Array); - -export type PutWithFormUrlEncodedData = { - formData: ArrayWithStrings; -}; - -export type DeleteFooData3 = { - /** - * bar in method - */ - barParam: string; - /** - * foo in method - */ - fooParam: string; - /** - * Parameter with illegal characters - */ - xFooBar: ModelWithString; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the query params - */ - cursor: (string) | null; - fooAllOfEnum: (ModelWithNestedArrayEnumsDataFoo); - fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the cookie - */ - parameterCookie: (string) | null; - /** - * This is the parameter that goes into the header - */ - parameterHeader: (string) | null; - /** - * This is the parameter that goes into the path - */ - parameterPath: (string) | null; - /** - * This is the parameter that goes into the body - */ - requestBody: { - [key: string]: unknown; - } | null; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter with a reserved keyword - */ - _default?: string; - /** - * This is the parameter that goes into the cookie - */ - parameterCookie: (string) | null; - /** - * This is the parameter that goes into the request header - */ - parameterHeader: (string) | null; - /** - * This is the parameter that goes into the path - */ - parameterPath1?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath2?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath3?: string; - /** - * This is the parameter that goes into the request query params - */ - parameterQuery: (string) | null; - /** - * This is the parameter that goes into the body - */ - requestBody: (ModelWithString) | null; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - page?: number; - /** - * This is a required parameter - */ - requestBody: ModelWithOneOfEnum; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is a required parameter - */ - parameter: Pageable; - /** - * This is an optional parameter - */ - requestBody?: { - offset?: (number) | null; - }; -}; - -export type PostCallWithOptionalParamResponse = (number | void); - -export type PostApiRequestBodyData = { - /** - * A reusable request body - */ - foo?: ModelWithString; - /** - * This is a reusable parameter - */ - parameter?: string; -}; - -export type CallWithResponseResponse = (_import); - -export type CallWithDuplicateResponsesResponse = ((ModelWithBoolean & ModelWithInteger) | ModelWithString); - -export type CallWithResponsesResponse = ({ - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; -} | ModelThatExtends | ModelThatExtendsExtends); - -export type ApiVVersionODataControllerCountResponse = (Model_From_Zendesk); - -export type TypesData = { - /** - * This is a number parameter - */ - id?: number; - /** - * This is an array parameter - */ - parameterArray: Array<(string)> | null; - /** - * This is a boolean parameter - */ - parameterBoolean: (boolean) | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: ('Success' | 'Warning' | 'Error') | null; - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is a string parameter - */ - parameterString: (string) | null; - /** - * This is tuple parameter - */ - parameterTuple: [ - number, - number, - number, - number - ]; -}; - -export type TypesResponse = (number | string | boolean | { - [key: string]: unknown; -}); - -export type UploadFileData = { - formData: (Blob | File); -}; - -export type UploadFileResponse = (boolean); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiError.ts deleted file mode 100644 index 36675d288..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiError.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: unknown; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiRequestOptions.ts deleted file mode 100644 index 939a0aa4c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiRequestOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type ApiRequestOptions = { - readonly body?: any; - readonly cookies?: Record; - readonly errors?: Record; - readonly formData?: Record | any[] | Blob | File; - readonly headers?: Record; - readonly mediaType?: string; - readonly method: - | 'DELETE' - | 'GET' - | 'HEAD' - | 'OPTIONS' - | 'PATCH' - | 'POST' - | 'PUT'; - readonly path?: Record; - readonly query?: Record; - readonly responseHeader?: string; - readonly responseTransformer?: (data: unknown) => Promise; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiResult.ts deleted file mode 100644 index 4c58e3913..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/ApiResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ApiResult = { - readonly body: TData; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/OpenAPI.ts deleted file mode 100644 index 9fafe8d52..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/OpenAPI.ts +++ /dev/null @@ -1,55 +0,0 @@ -import type { HttpResponse } from '@angular/common/http'; -import type { ApiRequestOptions } from './ApiRequestOptions'; - -type Headers = Record; -type Middleware = (value: T) => T | Promise; -type Resolver = (options: ApiRequestOptions) => Promise; - -export class Interceptors { - _fns: Middleware[]; - - constructor() { - this._fns = []; - } - - eject(fn: Middleware): void { - const index = this._fns.indexOf(fn); - if (index !== -1) { - this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; - } - } - - use(fn: Middleware): void { - this._fns = [...this._fns, fn]; - } -} - -export type OpenAPIConfig = { - BASE: string; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - ENCODE_PATH?: ((path: string) => string) | undefined; - HEADERS?: Headers | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - VERSION: string; - WITH_CREDENTIALS: boolean; - interceptors: { - response: Interceptors>; - }; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: 'http://localhost:3000/base', - CREDENTIALS: 'include', - ENCODE_PATH: undefined, - HEADERS: undefined, - PASSWORD: undefined, - TOKEN: undefined, - USERNAME: undefined, - VERSION: '1.0', - WITH_CREDENTIALS: false, - interceptors: { - response: new Interceptors(), - }, -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/request.ts deleted file mode 100644 index 4eab34ab6..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_transform/core/request.ts +++ /dev/null @@ -1,337 +0,0 @@ -import { HttpClient, HttpHeaders } from '@angular/common/http'; -import type { HttpResponse, HttpErrorResponse } from '@angular/common/http'; -import { forkJoin, of, throwError } from 'rxjs'; -import { catchError, map, switchMap } from 'rxjs/operators'; -import type { Observable } from 'rxjs'; - -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const isString = (value: unknown): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: any): value is Blob => { - return value instanceof Blob; -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const encodePair = (key: string, value: unknown) => { - if (value === undefined || value === null) { - return; - } - - if (value instanceof Date) { - append(key, value.toISOString()); - } else if (Array.isArray(value)) { - value.forEach(v => encodePair(key, v)); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); - } else { - append(key, value); - } - }; - - Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - - return qs.length ? `?${qs.join('&')}` : ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = config.BASE + path; - return options.query ? url + getQueryString(options.query) : url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([, value]) => value !== undefined && value !== null) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = (config: OpenAPIConfig, options: ApiRequestOptions): Observable => { - return forkJoin({ - // @ts-ignore - token: resolve(options, config.TOKEN), - // @ts-ignore - username: resolve(options, config.USERNAME), - // @ts-ignore - password: resolve(options, config.PASSWORD), - // @ts-ignore - additionalHeaders: resolve(options, config.HEADERS), - }).pipe( - map(({ token, username, password, additionalHeaders }) => { - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - }) - .filter(([, value]) => value !== undefined && value !== null) - .reduce((headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), {} as Record); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return new HttpHeaders(headers); - }), - ); -}; - -export const getRequestBody = (options: ApiRequestOptions): unknown => { - if (options.body) { - if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { - return JSON.stringify(options.body); - } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; -}; - -export const sendRequest = ( - config: OpenAPIConfig, - options: ApiRequestOptions, - http: HttpClient, - url: string, - body: unknown, - formData: FormData | undefined, - headers: HttpHeaders -): Observable> => { - return http.request(options.method, url, { - headers, - body: body ?? formData, - withCredentials: config.WITH_CREDENTIALS, - observe: 'response', - }); -}; - -export const getResponseHeader = (response: HttpResponse, responseHeader?: string): string | undefined => { - if (responseHeader) { - const value = response.headers.get(responseHeader); - if (isString(value)) { - return value; - } - } - return undefined; -}; - -export const getResponseBody = (response: HttpResponse): T | undefined => { - if (response.status !== 204 && response.body !== null) { - return response.body; - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 405: 'Method Not Allowed', - 406: 'Not Acceptable', - 407: 'Proxy Authentication Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Payload Too Large', - 414: 'URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Range Not Satisfiable', - 417: 'Expectation Failed', - 418: 'Im a teapot', - 421: 'Misdirected Request', - 422: 'Unprocessable Content', - 423: 'Locked', - 424: 'Failed Dependency', - 425: 'Too Early', - 426: 'Upgrade Required', - 428: 'Precondition Required', - 429: 'Too Many Requests', - 431: 'Request Header Fields Too Large', - 451: 'Unavailable For Legal Reasons', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported', - 506: 'Variant Also Negotiates', - 507: 'Insufficient Storage', - 508: 'Loop Detected', - 510: 'Not Extended', - 511: 'Network Authentication Required', - ...options.errors, - } - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError(options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param http The Angular HTTP client - * @param options The request options from the service - * @returns Observable - * @throws ApiError - */ -export const request = (config: OpenAPIConfig, http: HttpClient, options: ApiRequestOptions): Observable => { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - - return getHeaders(config, options).pipe( - switchMap(headers => { - return sendRequest(config, options, http, url, body, formData, headers); - }), - switchMap(async response => { - for (const fn of config.interceptors.response._fns) { - response = await fn(response); - } - const responseBody = getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - let transformedBody = responseBody; - if (options.responseTransformer && response.ok) { - transformedBody = await options.responseTransformer(responseBody) - } - - return { - url, - ok: response.ok, - status: response.status, - statusText: response.statusText, - body: responseHeader ?? transformedBody, - } as ApiResult; - }), - catchError((error: HttpErrorResponse) => { - if (!error.status) { - return throwError(() => error); - } - return of({ - url, - ok: error.ok, - status: error.status, - statusText: error.statusText, - body: error.error ?? error.statusText, - } as ApiResult); - }), - map(result => { - catchErrorCodes(options, result); - return result.body as T; - }), - catchError((error: ApiError) => { - return throwError(() => error); - }), - ); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_transform/index.ts b/packages/openapi-ts-tests/test/generated/v3_angular_transform/index.ts deleted file mode 100644 index 3f555f4f1..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_transform/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export { ApiError } from './core/ApiError'; -export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_transform/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_angular_transform/sdk.gen.ts deleted file mode 100644 index 272083d22..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_transform/sdk.gen.ts +++ /dev/null @@ -1,87 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import type { Observable } from 'rxjs'; -import { OpenAPI } from './core/OpenAPI'; -import { request as __request } from './core/request'; -import { type ParentModelWithDatesResponse, type ModelWithDatesResponse, type ModelWithDatesArrayResponse, type ArrayOfDatesResponse, type DateResponse, type MultipleResponsesResponse, ParentModelWithDatesResponseTransformer, ModelWithDatesResponseTransformer, ModelWithDatesArrayResponseTransformer } from './types.gen'; - -@Injectable({ - providedIn: 'root' -}) -export class DefaultService { - constructor(public readonly http: HttpClient) { } - - /** - * @returns ParentModelWithDates Success - * @returns unknown Success - * @throws ApiError - */ - public parentModelWithDates(): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/model-with-dates', - responseTransformer: ParentModelWithDatesResponseTransformer - }); - } - - /** - * @returns ModelWithDates Success - * @throws ApiError - */ - public modelWithDates(): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/model-with-dates', - responseTransformer: ModelWithDatesResponseTransformer - }); - } - - /** - * @returns ModelWithDates Success - * @throws ApiError - */ - public modelWithDatesArray(): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/model-with-dates-array', - responseTransformer: ModelWithDatesArrayResponseTransformer - }); - } - - /** - * @returns string Success - * @throws ApiError - */ - public arrayOfDates(): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/array-of-dates' - }); - } - - /** - * @returns string Success - * @throws ApiError - */ - public date(): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/date' - }); - } - - /** - * @returns ModelWithDates Updated - * @returns SimpleModel Created - * @throws ApiError - */ - public multipleResponses(): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/multiple-responses' - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_transform/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_angular_transform/types.gen.ts deleted file mode 100644 index 8c9227850..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_transform/types.gen.ts +++ /dev/null @@ -1,106 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * This is a model that contains a some dates - */ -export type ModelWithDates = { - id: number; - name: string; - readonly enabled: boolean; - readonly modified: Date; - readonly expires?: Date; -}; - -/** - * This is a model that contains a some dates and arrays - */ -export type ParentModelWithDates = { - id: number; - readonly modified?: Date; - items?: Array; - item?: ModelWithDates; - 'nullable-date'?: Array<(Date | null)>; - simpleItems?: Array; - simpleItem?: SimpleModel; - dates?: Array<(Date)>; - strings?: Array<(string)>; -}; - -/** - * This is a model that contains a some dates - */ -export type SimpleModel = { - id: number; - name: string; - readonly enabled: boolean; -}; - -export type ParentModelWithDatesResponse = (ParentModelWithDates | unknown); - -export type ModelWithDatesResponse = (ModelWithDates); - -export type ModelWithDatesArrayResponse = (Array); - -export type ArrayOfDatesResponse = (Array<(Date)>); - -export type DateResponse = (Date); - -export type MultipleResponsesResponse = (Array | Array); - -export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; - -export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; - -export type ModelWithDatesModelResponseTransformer = (data: any) => ModelWithDates; - -export const ModelWithDatesModelResponseTransformer: ModelWithDatesModelResponseTransformer = data => { - if (data?.modified) { - data.modified = new Date(data.modified); - } - if (data?.expires) { - data.expires = new Date(data.expires); - } - return data; -}; - -export const ParentModelWithDatesModelResponseTransformer: ParentModelWithDatesModelResponseTransformer = data => { - if (data?.modified) { - data.modified = new Date(data.modified); - } - if (Array.isArray(data?.items)) { - data.items.forEach(ModelWithDatesModelResponseTransformer); - } - if (data?.item) { - ModelWithDatesModelResponseTransformer(data.item); - } - if (Array.isArray(data?.['nullable-date'])) { - data['nullable-date'] = data['nullable-date'].map(item => item ? new Date(item) : item); - } - if (Array.isArray(data?.dates)) { - data.dates = data.dates.map(item => item ? new Date(item) : item); - } - return data; -}; - -export const ParentModelWithDatesResponseTransformer: ParentModelWithDatesResponseTransformer = async (data) => { - if (data) { - ParentModelWithDatesModelResponseTransformer(data); - } - return data; -}; - -export type ModelWithDatesResponseTransformer = (data: any) => Promise; - -export const ModelWithDatesResponseTransformer: ModelWithDatesResponseTransformer = async (data) => { - ModelWithDatesModelResponseTransformer(data); - return data; -}; - -export type ModelWithDatesArrayResponseTransformer = (data: any) => Promise; - -export const ModelWithDatesArrayResponseTransformer: ModelWithDatesArrayResponseTransformer = async (data) => { - if (Array.isArray(data)) { - data.forEach(ModelWithDatesModelResponseTransformer); - } - return data; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiError.ts deleted file mode 100644 index 36675d288..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiError.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: unknown; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiRequestOptions.ts deleted file mode 100644 index 939a0aa4c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiRequestOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type ApiRequestOptions = { - readonly body?: any; - readonly cookies?: Record; - readonly errors?: Record; - readonly formData?: Record | any[] | Blob | File; - readonly headers?: Record; - readonly mediaType?: string; - readonly method: - | 'DELETE' - | 'GET' - | 'HEAD' - | 'OPTIONS' - | 'PATCH' - | 'POST' - | 'PUT'; - readonly path?: Record; - readonly query?: Record; - readonly responseHeader?: string; - readonly responseTransformer?: (data: unknown) => Promise; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiResult.ts deleted file mode 100644 index 4c58e3913..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/ApiResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ApiResult = { - readonly body: TData; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/OpenAPI.ts deleted file mode 100644 index 9fafe8d52..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/OpenAPI.ts +++ /dev/null @@ -1,55 +0,0 @@ -import type { HttpResponse } from '@angular/common/http'; -import type { ApiRequestOptions } from './ApiRequestOptions'; - -type Headers = Record; -type Middleware = (value: T) => T | Promise; -type Resolver = (options: ApiRequestOptions) => Promise; - -export class Interceptors { - _fns: Middleware[]; - - constructor() { - this._fns = []; - } - - eject(fn: Middleware): void { - const index = this._fns.indexOf(fn); - if (index !== -1) { - this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; - } - } - - use(fn: Middleware): void { - this._fns = [...this._fns, fn]; - } -} - -export type OpenAPIConfig = { - BASE: string; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - ENCODE_PATH?: ((path: string) => string) | undefined; - HEADERS?: Headers | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - VERSION: string; - WITH_CREDENTIALS: boolean; - interceptors: { - response: Interceptors>; - }; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: 'http://localhost:3000/base', - CREDENTIALS: 'include', - ENCODE_PATH: undefined, - HEADERS: undefined, - PASSWORD: undefined, - TOKEN: undefined, - USERNAME: undefined, - VERSION: '1.0', - WITH_CREDENTIALS: false, - interceptors: { - response: new Interceptors(), - }, -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/request.ts deleted file mode 100644 index 4eab34ab6..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/core/request.ts +++ /dev/null @@ -1,337 +0,0 @@ -import { HttpClient, HttpHeaders } from '@angular/common/http'; -import type { HttpResponse, HttpErrorResponse } from '@angular/common/http'; -import { forkJoin, of, throwError } from 'rxjs'; -import { catchError, map, switchMap } from 'rxjs/operators'; -import type { Observable } from 'rxjs'; - -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const isString = (value: unknown): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: any): value is Blob => { - return value instanceof Blob; -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const encodePair = (key: string, value: unknown) => { - if (value === undefined || value === null) { - return; - } - - if (value instanceof Date) { - append(key, value.toISOString()); - } else if (Array.isArray(value)) { - value.forEach(v => encodePair(key, v)); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); - } else { - append(key, value); - } - }; - - Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - - return qs.length ? `?${qs.join('&')}` : ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = config.BASE + path; - return options.query ? url + getQueryString(options.query) : url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([, value]) => value !== undefined && value !== null) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = (config: OpenAPIConfig, options: ApiRequestOptions): Observable => { - return forkJoin({ - // @ts-ignore - token: resolve(options, config.TOKEN), - // @ts-ignore - username: resolve(options, config.USERNAME), - // @ts-ignore - password: resolve(options, config.PASSWORD), - // @ts-ignore - additionalHeaders: resolve(options, config.HEADERS), - }).pipe( - map(({ token, username, password, additionalHeaders }) => { - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - }) - .filter(([, value]) => value !== undefined && value !== null) - .reduce((headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), {} as Record); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return new HttpHeaders(headers); - }), - ); -}; - -export const getRequestBody = (options: ApiRequestOptions): unknown => { - if (options.body) { - if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { - return JSON.stringify(options.body); - } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; -}; - -export const sendRequest = ( - config: OpenAPIConfig, - options: ApiRequestOptions, - http: HttpClient, - url: string, - body: unknown, - formData: FormData | undefined, - headers: HttpHeaders -): Observable> => { - return http.request(options.method, url, { - headers, - body: body ?? formData, - withCredentials: config.WITH_CREDENTIALS, - observe: 'response', - }); -}; - -export const getResponseHeader = (response: HttpResponse, responseHeader?: string): string | undefined => { - if (responseHeader) { - const value = response.headers.get(responseHeader); - if (isString(value)) { - return value; - } - } - return undefined; -}; - -export const getResponseBody = (response: HttpResponse): T | undefined => { - if (response.status !== 204 && response.body !== null) { - return response.body; - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 405: 'Method Not Allowed', - 406: 'Not Acceptable', - 407: 'Proxy Authentication Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Payload Too Large', - 414: 'URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Range Not Satisfiable', - 417: 'Expectation Failed', - 418: 'Im a teapot', - 421: 'Misdirected Request', - 422: 'Unprocessable Content', - 423: 'Locked', - 424: 'Failed Dependency', - 425: 'Too Early', - 426: 'Upgrade Required', - 428: 'Precondition Required', - 429: 'Too Many Requests', - 431: 'Request Header Fields Too Large', - 451: 'Unavailable For Legal Reasons', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported', - 506: 'Variant Also Negotiates', - 507: 'Insufficient Storage', - 508: 'Loop Detected', - 510: 'Not Extended', - 511: 'Network Authentication Required', - ...options.errors, - } - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError(options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param http The Angular HTTP client - * @param options The request options from the service - * @returns Observable - * @throws ApiError - */ -export const request = (config: OpenAPIConfig, http: HttpClient, options: ApiRequestOptions): Observable => { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - - return getHeaders(config, options).pipe( - switchMap(headers => { - return sendRequest(config, options, http, url, body, formData, headers); - }), - switchMap(async response => { - for (const fn of config.interceptors.response._fns) { - response = await fn(response); - } - const responseBody = getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - let transformedBody = responseBody; - if (options.responseTransformer && response.ok) { - transformedBody = await options.responseTransformer(responseBody) - } - - return { - url, - ok: response.ok, - status: response.status, - statusText: response.statusText, - body: responseHeader ?? transformedBody, - } as ApiResult; - }), - catchError((error: HttpErrorResponse) => { - if (!error.status) { - return throwError(() => error); - } - return of({ - url, - ok: error.ok, - status: error.status, - statusText: error.statusText, - body: error.error ?? error.statusText, - } as ApiResult); - }), - map(result => { - catchErrorCodes(options, result); - return result.body as T; - }), - catchError((error: ApiError) => { - return throwError(() => error); - }), - ); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/index.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/index.ts deleted file mode 100644 index 3f555f4f1..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export { ApiError } from './core/ApiError'; -export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/sdk.gen.ts deleted file mode 100644 index dc89c810c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/sdk.gen.ts +++ /dev/null @@ -1,801 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import type { Observable } from 'rxjs'; -import { OpenAPI } from './core/OpenAPI'; -import { request as __request } from './core/request'; -import type { PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, ApiVVersionODataControllerCountResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, PostApiFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, DummyAResponse, DummyBResponse, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartRequestData, MultipartResponseResponse, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderResponse, TestErrorCodeData, TestErrorCodeResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; - -/** - * @throws ApiError - */ -export const export_ = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/no+tag' - }); -}; - -/** - * @returns unknown OK - * @throws ApiError - */ -export const patchApiNoTag = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'PATCH', - url: '/api/v{api-version}/no+tag' - }); -}; - -/** - * @param data The data for the request. - * @param data.requestBody - * @returns Model_From_Zendesk Success - * @returns ModelWithReadOnlyAndWriteOnly Default success response - * @throws ApiError - */ -export const import_ = function (data: ImportData): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/no+tag', - body: data.requestBody, - mediaType: 'application/json' - }); -}; - -/** - * @returns unknown OK - * @throws ApiError - */ -export const fooWow = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/v{api-version}/no+tag' - }); -}; - -/** - * @returns Model_From_Zendesk Success - * @throws ApiError - */ -export const apiVVersionODataControllerCount = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/simple/$count' - }); -}; - -/** - * @param data The data for the request. - * @param data.fooParam foo in method - * @returns number Response is a simple number - * @throws ApiError - */ -export const getApiSimpleOperation = function (data: GetApiSimpleOperationData): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/simple:operation', - path: { - foo_param: data.fooParam - }, - errors: { - default: 'Default error response' - } - }); -}; - -/** - * @throws ApiError - */ -export const getCallWithoutParametersAndResponse = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/simple' - }); -}; - -/** - * @throws ApiError - */ -export const putCallWithoutParametersAndResponse = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/v{api-version}/simple' - }); -}; - -/** - * @throws ApiError - */ -export const postCallWithoutParametersAndResponse = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/simple' - }); -}; - -/** - * @throws ApiError - */ -export const deleteCallWithoutParametersAndResponse = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'DELETE', - url: '/api/v{api-version}/simple' - }); -}; - -/** - * @throws ApiError - */ -export const optionsCallWithoutParametersAndResponse = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'OPTIONS', - url: '/api/v{api-version}/simple' - }); -}; - -/** - * @throws ApiError - */ -export const headCallWithoutParametersAndResponse = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'HEAD', - url: '/api/v{api-version}/simple' - }); -}; - -/** - * @throws ApiError - */ -export const patchCallWithoutParametersAndResponse = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'PATCH', - url: '/api/v{api-version}/simple' - }); -}; - -/** - * @param data The data for the request. - * @param data.fooParam foo in method - * @param data.barParam bar in method - * @param data.xFooBar Parameter with illegal characters - * @throws ApiError - */ -export const deleteFoo = function (data: DeleteFooData3): Observable { - return __request(OpenAPI, this.http, { - method: 'DELETE', - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - path: { - foo_param: data.fooParam, - BarParam: data.barParam - }, - headers: { - 'x-Foo-Bar': data.xFooBar - } - }); -}; - -/** - * @param data The data for the request. - * @param data.parameterWithBreaks Testing multiline comments in string: First line - * Second line - * - * Fourth line - * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work - * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work - * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work - * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work - * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work - * @throws ApiError - */ -export const callWithDescriptions = function (data: CallWithDescriptionsData = {}): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/descriptions/', - query: { - parameterWithBreaks: data.parameterWithBreaks, - parameterWithBackticks: data.parameterWithBackticks, - parameterWithSlashes: data.parameterWithSlashes, - parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders, - parameterWithQuotes: data.parameterWithQuotes, - parameterWithReservedCharacters: data.parameterWithReservedCharacters - } - }); -}; - -/** - * @deprecated - * @param data The data for the request. - * @param data.parameter This parameter is deprecated - * @throws ApiError - */ -export const deprecatedCall = function (data: DeprecatedCallData): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/parameters/deprecated', - headers: { - parameter: data.parameter - } - }); -}; - -/** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the header - * @param data.fooAllOfEnum - * @param data.cursor This is the parameter that goes into the query params - * @param data.parameterCookie This is the parameter that goes into the cookie - * @param data.parameterPath This is the parameter that goes into the path - * @param data.requestBody This is the parameter that goes into the body - * @param data.fooRefEnum - * @throws ApiError - */ -export const callWithParameters = function (data: CallWithParametersData): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/parameters/{parameterPath}', - path: { - parameterPath: data.parameterPath - }, - cookies: { - parameterCookie: data.parameterCookie - }, - headers: { - parameterHeader: data.parameterHeader - }, - query: { - foo_ref_enum: data.fooRefEnum, - foo_all_of_enum: data.fooAllOfEnum, - cursor: data.cursor - }, - body: data.requestBody, - mediaType: 'application/json' - }); -}; - -/** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the request header - * @param data.parameterQuery This is the parameter that goes into the request query params - * @param data.parameterCookie This is the parameter that goes into the cookie - * @param data.requestBody This is the parameter that goes into the body - * @param data.parameterPath1 This is the parameter that goes into the path - * @param data.parameterPath2 This is the parameter that goes into the path - * @param data.parameterPath3 This is the parameter that goes into the path - * @param data._default This is the parameter with a reserved keyword - * @throws ApiError - */ -export const callWithWeirdParameterNames = function (data: CallWithWeirdParameterNamesData): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - path: { - 'parameter.path.1': data.parameterPath1, - 'parameter-path-2': data.parameterPath2, - 'PARAMETER-PATH-3': data.parameterPath3 - }, - cookies: { - 'PARAMETER-COOKIE': data.parameterCookie - }, - headers: { - 'parameter.header': data.parameterHeader - }, - query: { - default: data._default, - 'parameter-query': data.parameterQuery - }, - body: data.requestBody, - mediaType: 'application/json' - }); -}; - -/** - * @param data The data for the request. - * @param data.requestBody This is a required parameter - * @param data.page This is an optional parameter - * @throws ApiError - */ -export const getCallWithOptionalParam = function (data: GetCallWithOptionalParamData): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/parameters/', - query: { - page: data.page - }, - body: data.requestBody, - mediaType: 'application/json' - }); -}; - -/** - * @param data The data for the request. - * @param data.parameter This is a required parameter - * @param data.requestBody This is an optional parameter - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ -export const postCallWithOptionalParam = function (data: PostCallWithOptionalParamData): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/parameters/', - query: { - parameter: data.parameter - }, - body: data.requestBody, - mediaType: 'application/json' - }); -}; - -/** - * @param data The data for the request. - * @param data.parameter This is a reusable parameter - * @param data.foo A reusable request body - * @throws ApiError - */ -export const postApiRequestBody = function (data: PostApiRequestBodyData = {}): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/requestBody/', - query: { - parameter: data.parameter - }, - body: data.foo, - mediaType: 'application/json' - }); -}; - -/** - * @param data The data for the request. - * @param data.parameter This is a reusable parameter - * @param data.formData A reusable request body - * @throws ApiError - */ -export const postApiFormData = function (data: PostApiFormDataData = {}): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/formData/', - query: { - parameter: data.parameter - }, - formData: data.formData, - mediaType: 'multipart/form-data' - }); -}; - -/** - * @param data The data for the request. - * @param data.parameterString This is a simple string with default value - * @param data.parameterNumber This is a simple number with default value - * @param data.parameterBoolean This is a simple boolean with default value - * @param data.parameterEnum This is a simple enum with default value - * @param data.parameterModel This is a simple model with default value - * @throws ApiError - */ -export const callWithDefaultParameters = function (data: CallWithDefaultParametersData = {}): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); -}; - -/** - * @param data The data for the request. - * @param data.parameterString This is a simple string that is optional with default value - * @param data.parameterNumber This is a simple number that is optional with default value - * @param data.parameterBoolean This is a simple boolean that is optional with default value - * @param data.parameterEnum This is a simple enum that is optional with default value - * @param data.parameterModel This is a simple model that is optional with default value - * @throws ApiError - */ -export const callWithDefaultOptionalParameters = function (data: CallWithDefaultOptionalParametersData = {}): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); -}; - -/** - * @param data The data for the request. - * @param data.parameterStringWithNoDefault This is a string with no default - * @param data.parameterOptionalStringWithDefault This is a optional string with default - * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default - * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default - * @param data.parameterStringWithDefault This is a string with default - * @param data.parameterStringWithEmptyDefault This is a string with empty default - * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default - * @param data.parameterStringNullableWithDefault This is a string that can be null with default - * @throws ApiError - */ -export const callToTestOrderOfParams = function (data: CallToTestOrderOfParamsData): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/v{api-version}/defaults', - query: { - parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, - parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, - parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, - parameterStringWithDefault: data.parameterStringWithDefault, - parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, - parameterStringWithNoDefault: data.parameterStringWithNoDefault, - parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, - parameterStringNullableWithDefault: data.parameterStringNullableWithDefault - } - }); -}; - -/** - * @throws ApiError - */ -export const duplicateName = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/duplicate' - }); -}; - -/** - * @throws ApiError - */ -export const duplicateName1 = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/duplicate' - }); -}; - -/** - * @throws ApiError - */ -export const duplicateName2 = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/v{api-version}/duplicate' - }); -}; - -/** - * @throws ApiError - */ -export const duplicateName3 = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'DELETE', - url: '/api/v{api-version}/duplicate' - }); -}; - -/** - * @returns void Success - * @throws ApiError - */ -export const callWithNoContentResponse = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/no-content' - }); -}; - -/** - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ -export const callWithResponseAndNoContentResponse = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/response-and-no-content' - }); -}; - -/** - * @returns _400 - * @throws ApiError - */ -export const dummyA = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/a' - }); -}; - -/** - * @returns void Success - * @throws ApiError - */ -export const dummyB = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); -}; - -/** - * @returns import - * @throws ApiError - */ -export const callWithResponse = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/response' - }); -}; - -/** - * @returns unknown Message for 200 response - * @returns ModelWithString Message for 201 response - * @returns ModelWithString Message for 202 response - * @throws ApiError - */ -export const callWithDuplicateResponses = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/response', - errors: { - 500: 'Message for 500 error', - 501: 'Message for 501 error', - 502: 'Message for 502 error', - '4XX': 'Message for 4XX errors', - default: 'Default error response' - } - }); -}; - -/** - * @returns unknown Message for 200 response - * @returns ModelThatExtends Message for 201 response - * @returns ModelThatExtendsExtends Message for 202 response - * @throws ApiError - */ -export const callWithResponses = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/v{api-version}/response', - errors: { - 500: 'Message for 500 error', - 501: 'Message for 501 error', - 502: 'Message for 502 error', - default: 'Message for default response' - } - }); -}; - -/** - * @param data The data for the request. - * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) - * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) - * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) - * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) - * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) - * @throws ApiError - */ -export const collectionFormat = function (data: CollectionFormatData): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/collectionFormat', - query: { - parameterArrayCSV: data.parameterArrayCsv, - parameterArraySSV: data.parameterArraySsv, - parameterArrayTSV: data.parameterArrayTsv, - parameterArrayPipes: data.parameterArrayPipes, - parameterArrayMulti: data.parameterArrayMulti - } - }); -}; - -/** - * @param data The data for the request. - * @param data.parameterArray This is an array parameter - * @param data.parameterDictionary This is a dictionary parameter - * @param data.parameterEnum This is an enum parameter - * @param data.parameterTuple This is tuple parameter - * @param data.parameterNumber This is a number parameter - * @param data.parameterString This is a string parameter - * @param data.parameterBoolean This is a boolean parameter - * @param data.parameterObject This is an object parameter - * @param data.id This is a number parameter - * @returns number Response is a simple number - * @returns string Response is a simple string - * @returns boolean Response is a simple boolean - * @returns unknown Response is a simple object - * @throws ApiError - */ -export const types = function (data: TypesData): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/types', - path: { - id: data.id - }, - query: { - parameterNumber: data.parameterNumber, - parameterString: data.parameterString, - parameterBoolean: data.parameterBoolean, - parameterObject: data.parameterObject, - parameterArray: data.parameterArray, - parameterDictionary: data.parameterDictionary, - parameterEnum: data.parameterEnum, - parameterTuple: data.parameterTuple - } - }); -}; - -/** - * @param data The data for the request. - * @param data.formData - * @returns boolean - * @throws ApiError - */ -export const uploadFile = function (data: UploadFileData): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/upload', - formData: data.formData, - mediaType: 'application/x-www-form-urlencoded' - }); -}; - -/** - * @param data The data for the request. - * @param data.id - * @returns binary Success - * @throws ApiError - */ -export const fileResponse = function (data: FileResponseData): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/file/{id}', - path: { - id: data.id - } - }); -}; - -/** - * @param data The data for the request. - * @param data.parameterObject Parameter containing object - * @param data.parameterReference Parameter containing reference - * @returns ModelWithString Successful response - * @throws ApiError - */ -export const complexTypes = function (data: ComplexTypesData): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/complex', - query: { - parameterObject: data.parameterObject, - parameterReference: data.parameterReference - }, - errors: { - 400: '400 `server` error', - 500: '500 server error' - } - }); -}; - -/** - * @param data The data for the request. - * @param data.formData - * @throws ApiError - */ -export const multipartRequest = function (data: MultipartRequestData = {}): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/multipart', - formData: data.formData, - mediaType: 'multipart/form-data' - }); -}; - -/** - * @returns unknown OK - * @throws ApiError - */ -export const multipartResponse = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/v{api-version}/multipart' - }); -}; - -/** - * @param data The data for the request. - * @param data.id - * @param data.requestBody - * @returns ModelWithString Success - * @throws ApiError - */ -export const complexParams = function (data: ComplexParamsData): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/v{api-version}/complex/{id}', - path: { - id: data.id - }, - body: data.requestBody, - mediaType: 'application/json-patch+json' - }); -}; - -/** - * @returns string Successful response - * @throws ApiError - */ -export const callWithResultFromHeader = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/header', - responseHeader: 'operation-location', - errors: { - 400: '400 server error', - 500: '500 server error' - } - }); -}; - -/** - * @param data The data for the request. - * @param data.status Status code to return - * @returns unknown Custom message: Successful response - * @throws ApiError - */ -export const testErrorCode = function (data: TestErrorCodeData): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/error', - query: { - status: data.status - }, - errors: { - 500: 'Custom message: Internal Server Error', - 501: 'Custom message: Not Implemented', - 502: 'Custom message: Bad Gateway', - 503: 'Custom message: Service Unavailable' - } - }); -}; - -/** - * @param data The data for the request. - * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param - * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response - * @throws ApiError - */ -export const nonAsciiæøåÆøÅöôêÊ字符串 = function (data: NonAsciiæøåÆøÅöôêÊ字符串Data): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - query: { - 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ - } - }); -}; - -/** - * Login User - * @param data The data for the request. - * @param data.formData - * @throws ApiError - */ -export const putWithFormUrlEncoded = function (data: PutWithFormUrlEncodedData): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - formData: data.formData, - mediaType: 'application/x-www-form-urlencoded' - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/types.gen.ts deleted file mode 100644 index ea3de322c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable/types.gen.ts +++ /dev/null @@ -1,1414 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _3e_num_1Период = 'Bird' | 'Dog'; - -/** - * Model with number-only name - */ -export type _400 = string; - -export type _default = { - name?: string; -}; - -/** - * Model with restricted keyword name - */ -export type _import = string; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: (number) | undefined; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AnyOfAnyAndNull = { - data?: (unknown | null); -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<({ - foo?: string; -} | { - bar?: string; -})>; -}; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<({ - foo?: string; -} | { - bar?: string; -})>; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array<(boolean)>; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array<(number)>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: camelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array<(string)>; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type camelCaseCommentWithBreaks = number; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - firstName: string; - lastname: string; - age: number; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: (({ - boolean?: boolean; -} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: (Array<(_3e_num_1Период | ConstValue)> | null); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(number | string)>; -}); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: ParameterSimpleParameter; -} | { - bar: NonAsciiStringæøåÆØÅöôêÊ字符串; -}) & { - baz: (number) | null; - qux: number; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(boolean)>; -}); -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: (boolean | { - [key: string]: (number); -}); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; - -export type ConstValue = "ConstValue"; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: (string); - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: (string | number | boolean) | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: (string); -}; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -export type File = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { - item?: boolean; - error?: (string) | null; - readonly hasError?: boolean; - data?: { - [key: string]: unknown; - }; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_String_ = { - item?: (string) | null; - error?: (string) | null; - readonly hasError?: boolean; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type Model_From_Zendesk = string; - -/** - * Circle - */ -export type ModelCircle = { - kind: 'circle'; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: 'square'; - sideLength?: number; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string; -}; - -export type ModelWithAnyOfConstantSizeArray = [ - (number | string), - (number | string), - (number | string) -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - (number & string), - (number & string) -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - ((number) | null | string), - ((number) | null | string), - ((number) | null | string) -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - (number | _import), - (number | _import) -]; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnly = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -export type ModelWithConst = { - String?: "String"; - number?: 0; - null?: null; - withType?: "Some string"; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: (string); - }; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: boolean; -}; - -/** - * This is a simple enum with strings - */ -export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - -/** - * These are the HTTP error code enums - */ -export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -export type foo_bar_baz_qux = '3.0'; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array<(string)>; - data?: (ModelWithNestedArrayEnumsData); -}; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedCompositionEnums = { - foo?: (ModelWithNestedArrayEnumsDataFoo); -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: ('Success' | 'Warning' | 'Error'); - }; - dictionaryWithEnumFromDescription?: { - [key: string]: (number); - }; - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; - arrayWithDescription?: Array<(number)>; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedProperties = { - readonly first: { - readonly second: { - readonly third: (string) | null; - } | null; - } | null; -}; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: (string) | null; - /** - * This is a simple string property - */ - nullableProp2?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: (string) | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Период - */ -export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; - -export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { - baz: (number) | null; - qux: number; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - (string), - (string) - ]; - foo: 'Corge'; -}; - -export type foo = 'Bar'; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPattern = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - (number | string), - string -]; - -/** - * This is a model with one nested property - */ -export type ModelWithProperties = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: (string) | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -export type ModelWithReadOnlyAndWriteOnly = { - foo: string; - readonly bar: string; - baz: string; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReference = { - prop?: ModelWithProperties; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: (Array<(string | boolean)> | null); -}; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array<(string)>; -}; - -/** - * This is a reusable parameter - */ -export type ParameterSimpleParameter = string; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Parameter with illegal characters - */ -export type Parameterx_Foo_Bar = ModelWithString; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<({ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; -})>; -}; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple file - */ -export type SimpleFile = (Blob | File); - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = (string) | null; - -export type PatchApiNoTagResponse = (unknown); - -export type ImportData = { - requestBody: (ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly); -}; - -export type ImportResponse = (Model_From_Zendesk | ModelWithReadOnlyAndWriteOnly); - -export type FooWowResponse = (unknown); - -export type ApiVVersionODataControllerCountResponse = (Model_From_Zendesk); - -export type GetApiSimpleOperationData = { - /** - * foo in method - */ - fooParam: string; -}; - -export type GetApiSimpleOperationResponse = (number); - -export type DeleteFooData3 = { - /** - * bar in method - */ - barParam: string; - /** - * foo in method - */ - fooParam: string; - /** - * Parameter with illegal characters - */ - xFooBar: ModelWithString; -}; - -export type CallWithDescriptionsData = { - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: unknown; - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: unknown; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: unknown; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: unknown; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: unknown; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: unknown; -}; - -export type DeprecatedCallData = { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: (DeprecatedModel) | null; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the query params - */ - cursor: (string) | null; - fooAllOfEnum: (ModelWithNestedArrayEnumsDataFoo); - fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the cookie - */ - parameterCookie: (string) | null; - /** - * This is the parameter that goes into the header - */ - parameterHeader: (string) | null; - /** - * This is the parameter that goes into the path - */ - parameterPath: (string) | null; - /** - * This is the parameter that goes into the body - */ - requestBody: { - [key: string]: unknown; - } | null; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter with a reserved keyword - */ - _default?: string; - /** - * This is the parameter that goes into the cookie - */ - parameterCookie: (string) | null; - /** - * This is the parameter that goes into the request header - */ - parameterHeader: (string) | null; - /** - * This is the parameter that goes into the path - */ - parameterPath1?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath2?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath3?: string; - /** - * This is the parameter that goes into the request query params - */ - parameterQuery: (string) | null; - /** - * This is the parameter that goes into the body - */ - requestBody: (ModelWithString) | null; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - page?: number; - /** - * This is a required parameter - */ - requestBody: ModelWithOneOfEnum; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is a required parameter - */ - parameter: Pageable; - /** - * This is an optional parameter - */ - requestBody?: { - offset?: (number) | null; - }; -}; - -export type PostCallWithOptionalParamResponse = (number | void); - -export type PostApiRequestBodyData = { - /** - * A reusable request body - */ - foo?: ModelWithString; - /** - * This is a reusable parameter - */ - parameter?: string; -}; - -export type PostApiFormDataData = { - /** - * A reusable request body - */ - formData?: ModelWithString; - /** - * This is a reusable parameter - */ - parameter?: string; -}; - -export type CallWithDefaultParametersData = { - /** - * This is a simple boolean with default value - */ - parameterBoolean?: (boolean) | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: (ModelWithString) | null; - /** - * This is a simple number with default value - */ - parameterNumber?: (number) | null; - /** - * This is a simple string with default value - */ - parameterString?: (string) | null; -}; - -export type CallWithDefaultOptionalParametersData = { - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; -}; - -export type CallToTestOrderOfParamsData = { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: (string) | null; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: (string) | null; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; -}; - -export type CallWithNoContentResponseResponse = (void); - -export type CallWithResponseAndNoContentResponseResponse = (number | void); - -export type DummyAResponse = (_400); - -export type DummyBResponse = (void); - -export type CallWithResponseResponse = (_import); - -export type CallWithDuplicateResponsesResponse = ((ModelWithBoolean & ModelWithInteger) | ModelWithString); - -export type CallWithResponsesResponse = ({ - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; -} | ModelThatExtends | ModelThatExtendsExtends); - -export type CollectionFormatData = { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCsv: Array<(string)> | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array<(string)> | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array<(string)> | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySsv: Array<(string)> | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTsv: Array<(string)> | null; -}; - -export type TypesData = { - /** - * This is a number parameter - */ - id?: number; - /** - * This is an array parameter - */ - parameterArray: Array<(string)> | null; - /** - * This is a boolean parameter - */ - parameterBoolean: (boolean) | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: ('Success' | 'Warning' | 'Error') | null; - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is a string parameter - */ - parameterString: (string) | null; - /** - * This is tuple parameter - */ - parameterTuple: [ - number, - number, - number, - number - ]; -}; - -export type TypesResponse = (number | string | boolean | { - [key: string]: unknown; -}); - -export type UploadFileData = { - formData: (Blob | File); -}; - -export type UploadFileResponse = (boolean); - -export type FileResponseData = { - id: string; -}; - -export type FileResponseResponse = ((Blob | File)); - -export type ComplexTypesData = { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; -}; - -export type ComplexTypesResponse = (Array); - -export type MultipartRequestData = { - formData?: { - content?: (Blob | File); - data?: ((ModelWithString) | null); - }; -}; - -export type MultipartResponseResponse = ({ - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; -}); - -export type ComplexParamsData = { - id: number; - requestBody?: { - readonly key: (string) | null; - name: (string) | null; - enabled?: boolean; - readonly type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array<(string)> | null; - parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); - readonly user?: { - readonly id?: number; - readonly name?: (string) | null; - }; - }; -}; - -export type ComplexParamsResponse = (ModelWithString); - -export type CallWithResultFromHeaderResponse = (string); - -export type TestErrorCodeData = { - /** - * Status code to return - */ - status: number; -}; - -export type TestErrorCodeResponse = (unknown); - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - /** - * Dummy input param - */ - nonAsciiParamæøåÆøÅöôêÊ: number; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = (Array); - -export type PutWithFormUrlEncodedData = { - formData: ArrayWithStrings; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiError.ts deleted file mode 100644 index 36675d288..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiError.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: unknown; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiRequestOptions.ts deleted file mode 100644 index 939a0aa4c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiRequestOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type ApiRequestOptions = { - readonly body?: any; - readonly cookies?: Record; - readonly errors?: Record; - readonly formData?: Record | any[] | Blob | File; - readonly headers?: Record; - readonly mediaType?: string; - readonly method: - | 'DELETE' - | 'GET' - | 'HEAD' - | 'OPTIONS' - | 'PATCH' - | 'POST' - | 'PUT'; - readonly path?: Record; - readonly query?: Record; - readonly responseHeader?: string; - readonly responseTransformer?: (data: unknown) => Promise; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiResult.ts deleted file mode 100644 index 4c58e3913..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/ApiResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ApiResult = { - readonly body: TData; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/OpenAPI.ts deleted file mode 100644 index 9fafe8d52..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/OpenAPI.ts +++ /dev/null @@ -1,55 +0,0 @@ -import type { HttpResponse } from '@angular/common/http'; -import type { ApiRequestOptions } from './ApiRequestOptions'; - -type Headers = Record; -type Middleware = (value: T) => T | Promise; -type Resolver = (options: ApiRequestOptions) => Promise; - -export class Interceptors { - _fns: Middleware[]; - - constructor() { - this._fns = []; - } - - eject(fn: Middleware): void { - const index = this._fns.indexOf(fn); - if (index !== -1) { - this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; - } - } - - use(fn: Middleware): void { - this._fns = [...this._fns, fn]; - } -} - -export type OpenAPIConfig = { - BASE: string; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - ENCODE_PATH?: ((path: string) => string) | undefined; - HEADERS?: Headers | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - VERSION: string; - WITH_CREDENTIALS: boolean; - interceptors: { - response: Interceptors>; - }; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: 'http://localhost:3000/base', - CREDENTIALS: 'include', - ENCODE_PATH: undefined, - HEADERS: undefined, - PASSWORD: undefined, - TOKEN: undefined, - USERNAME: undefined, - VERSION: '1.0', - WITH_CREDENTIALS: false, - interceptors: { - response: new Interceptors(), - }, -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/request.ts deleted file mode 100644 index 4eab34ab6..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/core/request.ts +++ /dev/null @@ -1,337 +0,0 @@ -import { HttpClient, HttpHeaders } from '@angular/common/http'; -import type { HttpResponse, HttpErrorResponse } from '@angular/common/http'; -import { forkJoin, of, throwError } from 'rxjs'; -import { catchError, map, switchMap } from 'rxjs/operators'; -import type { Observable } from 'rxjs'; - -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const isString = (value: unknown): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: any): value is Blob => { - return value instanceof Blob; -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const encodePair = (key: string, value: unknown) => { - if (value === undefined || value === null) { - return; - } - - if (value instanceof Date) { - append(key, value.toISOString()); - } else if (Array.isArray(value)) { - value.forEach(v => encodePair(key, v)); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); - } else { - append(key, value); - } - }; - - Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - - return qs.length ? `?${qs.join('&')}` : ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = config.BASE + path; - return options.query ? url + getQueryString(options.query) : url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([, value]) => value !== undefined && value !== null) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = (config: OpenAPIConfig, options: ApiRequestOptions): Observable => { - return forkJoin({ - // @ts-ignore - token: resolve(options, config.TOKEN), - // @ts-ignore - username: resolve(options, config.USERNAME), - // @ts-ignore - password: resolve(options, config.PASSWORD), - // @ts-ignore - additionalHeaders: resolve(options, config.HEADERS), - }).pipe( - map(({ token, username, password, additionalHeaders }) => { - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - }) - .filter(([, value]) => value !== undefined && value !== null) - .reduce((headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), {} as Record); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return new HttpHeaders(headers); - }), - ); -}; - -export const getRequestBody = (options: ApiRequestOptions): unknown => { - if (options.body) { - if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { - return JSON.stringify(options.body); - } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; -}; - -export const sendRequest = ( - config: OpenAPIConfig, - options: ApiRequestOptions, - http: HttpClient, - url: string, - body: unknown, - formData: FormData | undefined, - headers: HttpHeaders -): Observable> => { - return http.request(options.method, url, { - headers, - body: body ?? formData, - withCredentials: config.WITH_CREDENTIALS, - observe: 'response', - }); -}; - -export const getResponseHeader = (response: HttpResponse, responseHeader?: string): string | undefined => { - if (responseHeader) { - const value = response.headers.get(responseHeader); - if (isString(value)) { - return value; - } - } - return undefined; -}; - -export const getResponseBody = (response: HttpResponse): T | undefined => { - if (response.status !== 204 && response.body !== null) { - return response.body; - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 405: 'Method Not Allowed', - 406: 'Not Acceptable', - 407: 'Proxy Authentication Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Payload Too Large', - 414: 'URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Range Not Satisfiable', - 417: 'Expectation Failed', - 418: 'Im a teapot', - 421: 'Misdirected Request', - 422: 'Unprocessable Content', - 423: 'Locked', - 424: 'Failed Dependency', - 425: 'Too Early', - 426: 'Upgrade Required', - 428: 'Precondition Required', - 429: 'Too Many Requests', - 431: 'Request Header Fields Too Large', - 451: 'Unavailable For Legal Reasons', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported', - 506: 'Variant Also Negotiates', - 507: 'Insufficient Storage', - 508: 'Loop Detected', - 510: 'Not Extended', - 511: 'Network Authentication Required', - ...options.errors, - } - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError(options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param http The Angular HTTP client - * @param options The request options from the service - * @returns Observable - * @throws ApiError - */ -export const request = (config: OpenAPIConfig, http: HttpClient, options: ApiRequestOptions): Observable => { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - - return getHeaders(config, options).pipe( - switchMap(headers => { - return sendRequest(config, options, http, url, body, formData, headers); - }), - switchMap(async response => { - for (const fn of config.interceptors.response._fns) { - response = await fn(response); - } - const responseBody = getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - let transformedBody = responseBody; - if (options.responseTransformer && response.ok) { - transformedBody = await options.responseTransformer(responseBody) - } - - return { - url, - ok: response.ok, - status: response.status, - statusText: response.statusText, - body: responseHeader ?? transformedBody, - } as ApiResult; - }), - catchError((error: HttpErrorResponse) => { - if (!error.status) { - return throwError(() => error); - } - return of({ - url, - ok: error.ok, - status: error.status, - statusText: error.statusText, - body: error.error ?? error.statusText, - } as ApiResult); - }), - map(result => { - catchErrorCodes(options, result); - return result.body as T; - }), - catchError((error: ApiError) => { - return throwError(() => error); - }), - ); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/index.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/index.ts deleted file mode 100644 index 3f555f4f1..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export { ApiError } from './core/ApiError'; -export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/sdk.gen.ts deleted file mode 100644 index 109822a09..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/sdk.gen.ts +++ /dev/null @@ -1,79 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import type { Observable } from 'rxjs'; -import { OpenAPI } from './core/OpenAPI'; -import { request as __request } from './core/request'; -import { type ParentModelWithDatesResponse, type ModelWithDatesResponse, type ModelWithDatesArrayResponse, type ArrayOfDatesResponse, type DateResponse, type MultipleResponsesResponse, ParentModelWithDatesResponseTransformer, ModelWithDatesResponseTransformer, ModelWithDatesArrayResponseTransformer } from './types.gen'; - -/** - * @returns ParentModelWithDates Success - * @returns unknown Success - * @throws ApiError - */ -export const parentModelWithDates = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/model-with-dates', - responseTransformer: ParentModelWithDatesResponseTransformer - }); -}; - -/** - * @returns ModelWithDates Success - * @throws ApiError - */ -export const modelWithDates = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/model-with-dates', - responseTransformer: ModelWithDatesResponseTransformer - }); -}; - -/** - * @returns ModelWithDates Success - * @throws ApiError - */ -export const modelWithDatesArray = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/model-with-dates-array', - responseTransformer: ModelWithDatesArrayResponseTransformer - }); -}; - -/** - * @returns string Success - * @throws ApiError - */ -export const arrayOfDates = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/array-of-dates' - }); -}; - -/** - * @returns string Success - * @throws ApiError - */ -export const date = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/date' - }); -}; - -/** - * @returns ModelWithDates Updated - * @returns SimpleModel Created - * @throws ApiError - */ -export const multipleResponses = function (): Observable { - return __request(OpenAPI, this.http, { - method: 'PUT', - url: '/api/multiple-responses' - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/types.gen.ts deleted file mode 100644 index 8c9227850..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_angular_tree_shakeable_transform/types.gen.ts +++ /dev/null @@ -1,106 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * This is a model that contains a some dates - */ -export type ModelWithDates = { - id: number; - name: string; - readonly enabled: boolean; - readonly modified: Date; - readonly expires?: Date; -}; - -/** - * This is a model that contains a some dates and arrays - */ -export type ParentModelWithDates = { - id: number; - readonly modified?: Date; - items?: Array; - item?: ModelWithDates; - 'nullable-date'?: Array<(Date | null)>; - simpleItems?: Array; - simpleItem?: SimpleModel; - dates?: Array<(Date)>; - strings?: Array<(string)>; -}; - -/** - * This is a model that contains a some dates - */ -export type SimpleModel = { - id: number; - name: string; - readonly enabled: boolean; -}; - -export type ParentModelWithDatesResponse = (ParentModelWithDates | unknown); - -export type ModelWithDatesResponse = (ModelWithDates); - -export type ModelWithDatesArrayResponse = (Array); - -export type ArrayOfDatesResponse = (Array<(Date)>); - -export type DateResponse = (Date); - -export type MultipleResponsesResponse = (Array | Array); - -export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; - -export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; - -export type ModelWithDatesModelResponseTransformer = (data: any) => ModelWithDates; - -export const ModelWithDatesModelResponseTransformer: ModelWithDatesModelResponseTransformer = data => { - if (data?.modified) { - data.modified = new Date(data.modified); - } - if (data?.expires) { - data.expires = new Date(data.expires); - } - return data; -}; - -export const ParentModelWithDatesModelResponseTransformer: ParentModelWithDatesModelResponseTransformer = data => { - if (data?.modified) { - data.modified = new Date(data.modified); - } - if (Array.isArray(data?.items)) { - data.items.forEach(ModelWithDatesModelResponseTransformer); - } - if (data?.item) { - ModelWithDatesModelResponseTransformer(data.item); - } - if (Array.isArray(data?.['nullable-date'])) { - data['nullable-date'] = data['nullable-date'].map(item => item ? new Date(item) : item); - } - if (Array.isArray(data?.dates)) { - data.dates = data.dates.map(item => item ? new Date(item) : item); - } - return data; -}; - -export const ParentModelWithDatesResponseTransformer: ParentModelWithDatesResponseTransformer = async (data) => { - if (data) { - ParentModelWithDatesModelResponseTransformer(data); - } - return data; -}; - -export type ModelWithDatesResponseTransformer = (data: any) => Promise; - -export const ModelWithDatesResponseTransformer: ModelWithDatesResponseTransformer = async (data) => { - ModelWithDatesModelResponseTransformer(data); - return data; -}; - -export type ModelWithDatesArrayResponseTransformer = (data: any) => Promise; - -export const ModelWithDatesArrayResponseTransformer: ModelWithDatesArrayResponseTransformer = async (data) => { - if (Array.isArray(data)) { - data.forEach(ModelWithDatesModelResponseTransformer); - } - return data; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_axios/core/ApiError.ts deleted file mode 100644 index 36675d288..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_axios/core/ApiError.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: unknown; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_axios/core/ApiRequestOptions.ts deleted file mode 100644 index 939a0aa4c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_axios/core/ApiRequestOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type ApiRequestOptions = { - readonly body?: any; - readonly cookies?: Record; - readonly errors?: Record; - readonly formData?: Record | any[] | Blob | File; - readonly headers?: Record; - readonly mediaType?: string; - readonly method: - | 'DELETE' - | 'GET' - | 'HEAD' - | 'OPTIONS' - | 'PATCH' - | 'POST' - | 'PUT'; - readonly path?: Record; - readonly query?: Record; - readonly responseHeader?: string; - readonly responseTransformer?: (data: unknown) => Promise; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_axios/core/ApiResult.ts deleted file mode 100644 index 4c58e3913..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_axios/core/ApiResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ApiResult = { - readonly body: TData; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_axios/core/CancelablePromise.ts deleted file mode 100644 index ccc082e8f..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_axios/core/CancelablePromise.ts +++ /dev/null @@ -1,126 +0,0 @@ -export class CancelError extends Error { - constructor(message: string) { - super(message); - this.name = 'CancelError'; - } - - public get isCancelled(): boolean { - return true; - } -} - -export interface OnCancel { - readonly isResolved: boolean; - readonly isRejected: boolean; - readonly isCancelled: boolean; - - (cancelHandler: () => void): void; -} - -export class CancelablePromise implements Promise { - private _isResolved: boolean; - private _isRejected: boolean; - private _isCancelled: boolean; - readonly cancelHandlers: (() => void)[]; - readonly promise: Promise; - private _resolve?: (value: T | PromiseLike) => void; - private _reject?: (reason?: unknown) => void; - - constructor( - executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: unknown) => void, - onCancel: OnCancel - ) => void - ) { - this._isResolved = false; - this._isRejected = false; - this._isCancelled = false; - this.cancelHandlers = []; - this.promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - - const onResolve = (value: T | PromiseLike): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isResolved = true; - if (this._resolve) this._resolve(value); - }; - - const onReject = (reason?: unknown): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isRejected = true; - if (this._reject) this._reject(reason); - }; - - const onCancel = (cancelHandler: () => void): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this.cancelHandlers.push(cancelHandler); - }; - - Object.defineProperty(onCancel, 'isResolved', { - get: (): boolean => this._isResolved, - }); - - Object.defineProperty(onCancel, 'isRejected', { - get: (): boolean => this._isRejected, - }); - - Object.defineProperty(onCancel, 'isCancelled', { - get: (): boolean => this._isCancelled, - }); - - return executor(onResolve, onReject, onCancel as OnCancel); - }); - } - - get [Symbol.toStringTag]() { - return "Cancellable Promise"; - } - - public then( - onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null - ): Promise { - return this.promise.then(onFulfilled, onRejected); - } - - public catch( - onRejected?: ((reason: unknown) => TResult | PromiseLike) | null - ): Promise { - return this.promise.catch(onRejected); - } - - public finally(onFinally?: (() => void) | null): Promise { - return this.promise.finally(onFinally); - } - - public cancel(): void { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isCancelled = true; - if (this.cancelHandlers.length) { - try { - for (const cancelHandler of this.cancelHandlers) { - cancelHandler(); - } - } catch (error) { - console.warn('Cancellation threw an error', error); - return; - } - } - this.cancelHandlers.length = 0; - if (this._reject) this._reject(new CancelError('Request aborted')); - } - - public get isCancelled(): boolean { - return this._isCancelled; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_axios/core/OpenAPI.ts deleted file mode 100644 index cb7b23cb7..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_axios/core/OpenAPI.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { AxiosRequestConfig, AxiosResponse } from 'axios'; -import type { ApiRequestOptions } from './ApiRequestOptions'; - -type Headers = Record; -type Middleware = (value: T) => T | Promise; -type Resolver = (options: ApiRequestOptions) => Promise; - -export class Interceptors { - _fns: Middleware[]; - - constructor() { - this._fns = []; - } - - eject(fn: Middleware): void { - const index = this._fns.indexOf(fn); - if (index !== -1) { - this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; - } - } - - use(fn: Middleware): void { - this._fns = [...this._fns, fn]; - } -} - -export type OpenAPIConfig = { - BASE: string; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - ENCODE_PATH?: ((path: string) => string) | undefined; - HEADERS?: Headers | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - VERSION: string; - WITH_CREDENTIALS: boolean; - interceptors: { - request: Interceptors; - response: Interceptors; - }; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: 'http://localhost:3000/base', - CREDENTIALS: 'include', - ENCODE_PATH: undefined, - HEADERS: undefined, - PASSWORD: undefined, - TOKEN: undefined, - USERNAME: undefined, - VERSION: '1.0', - WITH_CREDENTIALS: false, - interceptors: { - request: new Interceptors(), - response: new Interceptors(), - }, -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_axios/core/request.ts deleted file mode 100644 index ecc2e393c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_axios/core/request.ts +++ /dev/null @@ -1,347 +0,0 @@ -import axios from 'axios'; -import type { AxiosError, AxiosRequestConfig, AxiosResponse, AxiosInstance } from 'axios'; - -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import { CancelablePromise } from './CancelablePromise'; -import type { OnCancel } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const isString = (value: unknown): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: any): value is Blob => { - return value instanceof Blob; -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const isSuccess = (status: number): boolean => { - return status >= 200 && status < 300; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const encodePair = (key: string, value: unknown) => { - if (value === undefined || value === null) { - return; - } - - if (value instanceof Date) { - append(key, value.toISOString()); - } else if (Array.isArray(value)) { - value.forEach(v => encodePair(key, v)); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); - } else { - append(key, value); - } - }; - - Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - - return qs.length ? `?${qs.join('&')}` : ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = config.BASE + path; - return options.query ? url + getQueryString(options.query) : url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([, value]) => value !== undefined && value !== null) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise> => { - const [token, username, password, additionalHeaders] = await Promise.all([ - // @ts-ignore - resolve(options, config.TOKEN), - // @ts-ignore - resolve(options, config.USERNAME), - // @ts-ignore - resolve(options, config.PASSWORD), - // @ts-ignore - resolve(options, config.HEADERS), - ]); - - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - }) - .filter(([, value]) => value !== undefined && value !== null) - .reduce((headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), {} as Record); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } else if (options.formData !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } - } - - return headers; -}; - -export const getRequestBody = (options: ApiRequestOptions): unknown => { - if (options.body) { - return options.body; - } - return undefined; -}; - -export const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: unknown, - formData: FormData | undefined, - headers: Record, - onCancel: OnCancel, - axiosClient: AxiosInstance -): Promise> => { - const controller = new AbortController(); - - let requestConfig: AxiosRequestConfig = { - data: body ?? formData, - headers, - method: options.method, - signal: controller.signal, - url, - withCredentials: config.WITH_CREDENTIALS, - }; - - onCancel(() => controller.abort()); - - for (const fn of config.interceptors.request._fns) { - requestConfig = await fn(requestConfig); - } - - try { - return await axiosClient.request(requestConfig); - } catch (error) { - const axiosError = error as AxiosError; - if (axiosError.response) { - return axiosError.response; - } - throw error; - } -}; - -export const getResponseHeader = (response: AxiosResponse, responseHeader?: string): string | undefined => { - if (responseHeader) { - const content = response.headers[responseHeader]; - if (isString(content)) { - return content; - } - } - return undefined; -}; - -export const getResponseBody = (response: AxiosResponse): unknown => { - if (response.status !== 204) { - return response.data; - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 405: 'Method Not Allowed', - 406: 'Not Acceptable', - 407: 'Proxy Authentication Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Payload Too Large', - 414: 'URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Range Not Satisfiable', - 417: 'Expectation Failed', - 418: 'Im a teapot', - 421: 'Misdirected Request', - 422: 'Unprocessable Content', - 423: 'Locked', - 424: 'Failed Dependency', - 425: 'Too Early', - 426: 'Upgrade Required', - 428: 'Precondition Required', - 429: 'Too Many Requests', - 431: 'Request Header Fields Too Large', - 451: 'Unavailable For Legal Reasons', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported', - 506: 'Variant Also Negotiates', - 507: 'Insufficient Storage', - 508: 'Loop Detected', - 510: 'Not Extended', - 511: 'Network Authentication Required', - ...options.errors, - } - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError(options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @param axiosClient The axios client instance to use - * @returns CancelablePromise - * @throws ApiError - */ -export const request = (config: OpenAPIConfig, options: ApiRequestOptions, axiosClient: AxiosInstance = axios): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options); - - if (!onCancel.isCancelled) { - let response = await sendRequest(config, options, url, body, formData, headers, onCancel, axiosClient); - - for (const fn of config.interceptors.response._fns) { - response = await fn(response); - } - - const responseBody = getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - let transformedBody = responseBody; - if (options.responseTransformer && isSuccess(response.status)) { - transformedBody = await options.responseTransformer(responseBody) - } - - const result: ApiResult = { - url, - ok: isSuccess(response.status), - status: response.status, - statusText: response.statusText, - body: responseHeader ?? transformedBody, - }; - - catchErrorCodes(options, result); - - resolve(result.body); - } - } catch (error) { - reject(error); - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios/index.ts b/packages/openapi-ts-tests/test/generated/v3_axios/index.ts deleted file mode 100644 index 50a1dd734..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_axios/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export { ApiError } from './core/ApiError'; -export { CancelablePromise, CancelError } from './core/CancelablePromise'; -export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_axios/sdk.gen.ts deleted file mode 100644 index f62288bcf..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_axios/sdk.gen.ts +++ /dev/null @@ -1,913 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { CancelablePromise } from './core/CancelablePromise'; -import { OpenAPI } from './core/OpenAPI'; -import { request as __request } from './core/request'; -import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; - -export class CollectionFormatService { - /** - * @param data The data for the request. - * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) - * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) - * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) - * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) - * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) - * @throws ApiError - */ - public static collectionFormat(data: CollectionFormatData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/collectionFormat', - query: { - parameterArrayCSV: data.parameterArrayCsv, - parameterArraySSV: data.parameterArraySsv, - parameterArrayTSV: data.parameterArrayTsv, - parameterArrayPipes: data.parameterArrayPipes, - parameterArrayMulti: data.parameterArrayMulti - } - }); - } - -} - -export class ComplexService { - /** - * @param data The data for the request. - * @param data.parameterObject Parameter containing object - * @param data.parameterReference Parameter containing reference - * @returns ModelWithString Successful response - * @throws ApiError - */ - public static complexTypes(data: ComplexTypesData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/complex', - query: { - parameterObject: data.parameterObject, - parameterReference: data.parameterReference - }, - errors: { - 400: '400 `server` error', - 500: '500 server error' - } - }); - } - - /** - * @param data The data for the request. - * @param data.id - * @param data.requestBody - * @returns ModelWithString Success - * @throws ApiError - */ - public static complexParams(data: ComplexParamsData): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/complex/{id}', - path: { - id: data.id - }, - body: data.requestBody, - mediaType: 'application/json-patch+json' - }); - } - -} - -export class DefaultService { - /** - * @throws ApiError - */ - public static export(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public static patchApiNoTag(): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @param data The data for the request. - * @param data.requestBody - * @returns Model_From_Zendesk Success - * @returns ModelWithReadOnlyAndWriteOnly Default success response - * @throws ApiError - */ - public static import(data: ImportData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/no+tag', - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public static fooWow(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @param data The data for the request. - * @param data.fooParam foo in method - * @returns number Response is a simple number - * @throws ApiError - */ - public static getApiSimpleOperation(data: GetApiSimpleOperationData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple:operation', - path: { - foo_param: data.fooParam - }, - errors: { - default: 'Default error response' - } - }); - } - -} - -export class DefaultsService { - /** - * @param data The data for the request. - * @param data.parameterString This is a simple string with default value - * @param data.parameterNumber This is a simple number with default value - * @param data.parameterBoolean This is a simple boolean with default value - * @param data.parameterEnum This is a simple enum with default value - * @param data.parameterModel This is a simple model with default value - * @throws ApiError - */ - public static callWithDefaultParameters(data: CallWithDefaultParametersData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterString This is a simple string that is optional with default value - * @param data.parameterNumber This is a simple number that is optional with default value - * @param data.parameterBoolean This is a simple boolean that is optional with default value - * @param data.parameterEnum This is a simple enum that is optional with default value - * @param data.parameterModel This is a simple model that is optional with default value - * @throws ApiError - */ - public static callWithDefaultOptionalParameters(data: CallWithDefaultOptionalParametersData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterStringWithNoDefault This is a string with no default - * @param data.parameterOptionalStringWithDefault This is a optional string with default - * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default - * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default - * @param data.parameterStringWithDefault This is a string with default - * @param data.parameterStringWithEmptyDefault This is a string with empty default - * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default - * @param data.parameterStringNullableWithDefault This is a string that can be null with default - * @throws ApiError - */ - public static callToTestOrderOfParams(data: CallToTestOrderOfParamsData): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/defaults', - query: { - parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, - parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, - parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, - parameterStringWithDefault: data.parameterStringWithDefault, - parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, - parameterStringWithNoDefault: data.parameterStringWithNoDefault, - parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, - parameterStringNullableWithDefault: data.parameterStringNullableWithDefault - } - }); - } - -} - -export class DeprecatedService { - /** - * @deprecated - * @param data The data for the request. - * @param data.parameter This parameter is deprecated - * @throws ApiError - */ - public static deprecatedCall(data: DeprecatedCallData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/deprecated', - headers: { - parameter: data.parameter - } - }); - } - -} - -export class DescriptionsService { - /** - * @param data The data for the request. - * @param data.parameterWithBreaks Testing multiline comments in string: First line - * Second line - * - * Fourth line - * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work - * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work - * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work - * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work - * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work - * @throws ApiError - */ - public static callWithDescriptions(data: CallWithDescriptionsData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/descriptions/', - query: { - parameterWithBreaks: data.parameterWithBreaks, - parameterWithBackticks: data.parameterWithBackticks, - parameterWithSlashes: data.parameterWithSlashes, - parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders, - parameterWithQuotes: data.parameterWithQuotes, - parameterWithReservedCharacters: data.parameterWithReservedCharacters - } - }); - } - -} - -export class DuplicateService { - /** - * @throws ApiError - */ - public static duplicateName(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public static duplicateName1(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public static duplicateName2(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public static duplicateName3(): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/duplicate' - }); - } - -} - -export class ErrorService { - /** - * @param data The data for the request. - * @param data.status Status code to return - * @returns unknown Custom message: Successful response - * @throws ApiError - */ - public static testErrorCode(data: TestErrorCodeData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/error', - query: { - status: data.status - }, - errors: { - 500: 'Custom message: Internal Server Error', - 501: 'Custom message: Not Implemented', - 502: 'Custom message: Bad Gateway', - 503: 'Custom message: Service Unavailable' - } - }); - } - -} - -export class FileResponseService { - /** - * @param data The data for the request. - * @param data.id - * @returns binary Success - * @throws ApiError - */ - public static fileResponse(data: FileResponseData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/file/{id}', - path: { - id: data.id - } - }); - } - -} - -export class FormDataService { - /** - * @param data The data for the request. - * @param data.parameter This is a reusable parameter - * @param data.formData A reusable request body - * @throws ApiError - */ - public static postApiFormData(data: PostApiFormDataData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/formData/', - query: { - parameter: data.parameter - }, - formData: data.formData, - mediaType: 'multipart/form-data' - }); - } - -} - -export class HeaderService { - /** - * @returns string Successful response - * @throws ApiError - */ - public static callWithResultFromHeader(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/header', - responseHeader: 'operation-location', - errors: { - 400: '400 server error', - 500: '500 server error' - } - }); - } - -} - -export class MultipartService { - /** - * @param data The data for the request. - * @param data.formData - * @throws ApiError - */ - public static multipartRequest(data: MultipartRequestData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/multipart', - formData: data.formData, - mediaType: 'multipart/form-data' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public static multipartResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multipart' - }); - } - -} - -export class MultipleTags1Service { - /** - * @returns _400 - * @throws ApiError - */ - public static dummyA(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/a' - }); - } - - /** - * @returns void Success - * @throws ApiError - */ - public static dummyB(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class MultipleTags2Service { - /** - * @returns _400 - * @throws ApiError - */ - public static dummyA(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/a' - }); - } - - /** - * @returns void Success - * @throws ApiError - */ - public static dummyB(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class MultipleTags3Service { - /** - * @returns void Success - * @throws ApiError - */ - public static dummyB(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class NoContentService { - /** - * @returns void Success - * @throws ApiError - */ - public static callWithNoContentResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/no-content' - }); - } - - /** - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public static callWithResponseAndNoContentResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/response-and-no-content' - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - /** - * @param data The data for the request. - * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param - * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response - * @throws ApiError - */ - public static nonAsciiæøåÆøÅöôêÊ字符串(data: NonAsciiæøåÆøÅöôêÊ字符串Data): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - query: { - 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ - } - }); - } - - /** - * Login User - * @param data The data for the request. - * @param data.formData - * @throws ApiError - */ - public static putWithFormUrlEncoded(data: PutWithFormUrlEncodedData): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - formData: data.formData, - mediaType: 'application/x-www-form-urlencoded' - }); - } - -} - -export class ParametersService { - /** - * @param data The data for the request. - * @param data.fooParam foo in method - * @param data.barParam bar in method - * @param data.xFooBar Parameter with illegal characters - * @throws ApiError - */ - public static deleteFoo(data: DeleteFooData3): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - path: { - foo_param: data.fooParam, - BarParam: data.barParam - }, - headers: { - 'x-Foo-Bar': data.xFooBar - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the header - * @param data.fooAllOfEnum - * @param data.cursor This is the parameter that goes into the query params - * @param data.parameterCookie This is the parameter that goes into the cookie - * @param data.parameterPath This is the parameter that goes into the path - * @param data.requestBody This is the parameter that goes into the body - * @param data.fooRefEnum - * @throws ApiError - */ - public static callWithParameters(data: CallWithParametersData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/{parameterPath}', - path: { - parameterPath: data.parameterPath - }, - cookies: { - parameterCookie: data.parameterCookie - }, - headers: { - parameterHeader: data.parameterHeader - }, - query: { - foo_ref_enum: data.fooRefEnum, - foo_all_of_enum: data.fooAllOfEnum, - cursor: data.cursor - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the request header - * @param data.parameterQuery This is the parameter that goes into the request query params - * @param data.parameterCookie This is the parameter that goes into the cookie - * @param data.requestBody This is the parameter that goes into the body - * @param data.parameterPath1 This is the parameter that goes into the path - * @param data.parameterPath2 This is the parameter that goes into the path - * @param data.parameterPath3 This is the parameter that goes into the path - * @param data._default This is the parameter with a reserved keyword - * @throws ApiError - */ - public static callWithWeirdParameterNames(data: CallWithWeirdParameterNamesData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - path: { - 'parameter.path.1': data.parameterPath1, - 'parameter-path-2': data.parameterPath2, - 'PARAMETER-PATH-3': data.parameterPath3 - }, - cookies: { - 'PARAMETER-COOKIE': data.parameterCookie - }, - headers: { - 'parameter.header': data.parameterHeader - }, - query: { - default: data._default, - 'parameter-query': data.parameterQuery - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.requestBody This is a required parameter - * @param data.page This is an optional parameter - * @throws ApiError - */ - public static getCallWithOptionalParam(data: GetCallWithOptionalParamData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/parameters/', - query: { - page: data.page - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.parameter This is a required parameter - * @param data.requestBody This is an optional parameter - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public static postCallWithOptionalParam(data: PostCallWithOptionalParamData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/', - query: { - parameter: data.parameter - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - -} - -export class RequestBodyService { - /** - * @param data The data for the request. - * @param data.parameter This is a reusable parameter - * @param data.foo A reusable request body - * @throws ApiError - */ - public static postApiRequestBody(data: PostApiRequestBodyData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/requestBody/', - query: { - parameter: data.parameter - }, - body: data.foo, - mediaType: 'application/json' - }); - } - -} - -export class ResponseService { - /** - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public static callWithResponseAndNoContentResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/response-and-no-content' - }); - } - - /** - * @returns import - * @throws ApiError - */ - public static callWithResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/response' - }); - } - - /** - * @returns unknown Message for 200 response - * @returns ModelWithString Message for 201 response - * @returns ModelWithString Message for 202 response - * @throws ApiError - */ - public static callWithDuplicateResponses(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/response', - errors: { - 500: 'Message for 500 error', - 501: 'Message for 501 error', - 502: 'Message for 502 error', - '4XX': 'Message for 4XX errors', - default: 'Default error response' - } - }); - } - - /** - * @returns unknown Message for 200 response - * @returns ModelThatExtends Message for 201 response - * @returns ModelThatExtendsExtends Message for 202 response - * @throws ApiError - */ - public static callWithResponses(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/response', - errors: { - 500: 'Message for 500 error', - 501: 'Message for 501 error', - 502: 'Message for 502 error', - default: 'Message for default response' - } - }); - } - -} - -export class SimpleService { - /** - * @returns Model_From_Zendesk Success - * @throws ApiError - */ - public static apiVVersionODataControllerCount(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple/$count' - }); - } - - /** - * @throws ApiError - */ - public static getCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static putCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static postCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static deleteCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static optionsCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'OPTIONS', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static headCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'HEAD', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static patchCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v{api-version}/simple' - }); - } - -} - -export class TypesService { - /** - * @param data The data for the request. - * @param data.parameterArray This is an array parameter - * @param data.parameterDictionary This is a dictionary parameter - * @param data.parameterEnum This is an enum parameter - * @param data.parameterTuple This is tuple parameter - * @param data.parameterNumber This is a number parameter - * @param data.parameterString This is a string parameter - * @param data.parameterBoolean This is a boolean parameter - * @param data.parameterObject This is an object parameter - * @param data.id This is a number parameter - * @returns number Response is a simple number - * @returns string Response is a simple string - * @returns boolean Response is a simple boolean - * @returns unknown Response is a simple object - * @throws ApiError - */ - public static types(data: TypesData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/types', - path: { - id: data.id - }, - query: { - parameterNumber: data.parameterNumber, - parameterString: data.parameterString, - parameterBoolean: data.parameterBoolean, - parameterObject: data.parameterObject, - parameterArray: data.parameterArray, - parameterDictionary: data.parameterDictionary, - parameterEnum: data.parameterEnum, - parameterTuple: data.parameterTuple - } - }); - } - -} - -export class UploadService { - /** - * @param data The data for the request. - * @param data.formData - * @returns boolean - * @throws ApiError - */ - public static uploadFile(data: UploadFileData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/upload', - formData: data.formData, - mediaType: 'application/x-www-form-urlencoded' - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_axios/types.gen.ts deleted file mode 100644 index d20c92660..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_axios/types.gen.ts +++ /dev/null @@ -1,1537 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _3e_num_1Период = 'Bird' | 'Dog'; - -export const _3e_num_1Период = { - BIRD: 'Bird', - DOG: 'Dog' -} as const; - -/** - * Model with number-only name - */ -export type _400 = string; - -export type _default = { - name?: string; -}; - -/** - * Model with restricted keyword name - */ -export type _import = string; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: (number) | undefined; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AnyOfAnyAndNull = { - data?: (unknown | null); -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<({ - foo?: string; -} | { - bar?: string; -})>; -}; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<({ - foo?: string; -} | { - bar?: string; -})>; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array<(boolean)>; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array<(number)>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: camelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array<(string)>; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type camelCaseCommentWithBreaks = number; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - firstName: string; - lastname: string; - age: number; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: (({ - boolean?: boolean; -} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: (Array<(_3e_num_1Период | ConstValue)> | null); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(number | string)>; -}); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: ParameterSimpleParameter; -} | { - bar: NonAsciiStringæøåÆØÅöôêÊ字符串; -}) & { - baz: (number) | null; - qux: number; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(boolean)>; -}); -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: (boolean | { - [key: string]: (number); -}); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; - -export type ConstValue = "ConstValue"; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: (string); - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: (string | number | boolean) | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: (string); -}; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple enum with numbers - */ -export const EnumWithExtensions = { - /** - * Used when the status of something is successful - */ - CUSTOM_SUCCESS: 200, - /** - * Used when the status of something has a warning - */ - CUSTOM_WARNING: 400, - /** - * Used when the status of something has an error - */ - CUSTOM_ERROR: 500 -} as const; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * This is a simple enum with numbers - */ -export const EnumWithNumbers = { - '_1': 1, - '_2': 2, - '_3': 3, - '_1.1': 1.1, - '_1.2': 1.2, - '_1.3': 1.3, - '_100': 100, - '_200': 200, - '_300': 300, - '_-100': -100, - '_-200': -200, - '_-300': -300, - '_-1.1': -1.1, - '_-1.2': -1.2, - '_-1.3': -1.3 -} as const; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -export const EnumWithReplacedCharacters = { - _SINGLE_QUOTE_: "'Single Quote'", - _DOUBLE_QUOTES_: '"Double Quotes"', - 'ØÆÅÔÖ_ØÆÅÔÖ字符串': 'øæåôöØÆÅÔÖ字符串', - '_3.1': 3.1, - EMPTY_STRING: '' -} as const; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with strings - */ -export const EnumWithStrings = { - SUCCESS: 'Success', - WARNING: 'Warning', - ERROR: 'Error', - _SINGLE_QUOTE_: "'Single Quote'", - _DOUBLE_QUOTES_: '"Double Quotes"', - 'NON_ASCII__ØÆÅÔÖ_ØÆÅÔÖ字符串': 'Non-ascii: øæåôöØÆÅÔÖ字符串' -} as const; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -export const EnumWithXEnumNames = { - zero: 0, - one: 1, - two: 2 -} as const; - -export type File = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { - item?: boolean; - error?: (string) | null; - readonly hasError?: boolean; - data?: { - [key: string]: unknown; - }; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_String_ = { - item?: (string) | null; - error?: (string) | null; - readonly hasError?: boolean; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type Model_From_Zendesk = string; - -/** - * Circle - */ -export type ModelCircle = { - kind: 'circle'; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: 'square'; - sideLength?: number; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string; -}; - -export type ModelWithAnyOfConstantSizeArray = [ - (number | string), - (number | string), - (number | string) -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - (number & string), - (number & string) -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - ((number) | null | string), - ((number) | null | string), - ((number) | null | string) -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - (number | _import), - (number | _import) -]; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnly = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -export type ModelWithConst = { - String?: "String"; - number?: 0; - null?: null; - withType?: "Some string"; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: (string); - }; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: boolean; -}; - -/** - * This is a simple enum with strings - */ -export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - -/** - * This is a simple enum with strings - */ -export const foo_bar_enum = { - SUCCESS: 'Success', - WARNING: 'Warning', - ERROR: 'Error', - 'ØÆÅ字符串': 'ØÆÅ字符串' -} as const; - -/** - * These are the HTTP error code enums - */ -export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - -/** - * These are the HTTP error code enums - */ -export const statusCode = { - _100: '100', - _200_FOO: '200 FOO', - _300_FOO_BAR: '300 FOO_BAR', - _400_FOO_BAR: '400 foo-bar', - _500_FOO_BAR: '500 foo.bar', - _600_FOO_BAR: '600 foo&bar' -} as const; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -export type foo_bar_baz_qux = '3.0'; - -export const foo_bar_baz_qux = { - _3_0: '3.0' -} as const; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array<(string)>; - data?: (ModelWithNestedArrayEnumsData); -}; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export const ModelWithNestedArrayEnumsDataBar = { - BAZ: 'baz', - QUX: 'qux' -} as const; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export const ModelWithNestedArrayEnumsDataFoo = { - FOO: 'foo', - BAR: 'bar' -} as const; - -export type ModelWithNestedCompositionEnums = { - foo?: (ModelWithNestedArrayEnumsDataFoo); -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: ('Success' | 'Warning' | 'Error'); - }; - dictionaryWithEnumFromDescription?: { - [key: string]: (number); - }; - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; - arrayWithDescription?: Array<(number)>; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedProperties = { - readonly first: { - readonly second: { - readonly third: (string) | null; - } | null; - } | null; -}; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: (string) | null; - /** - * This is a simple string property - */ - nullableProp2?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: (string) | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Период - */ -export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; - -/** - * Период - */ -export const value = { - '_-10': -10, - '_-1': -1, - '_0': 0, - '_1': 1, - '_3': 3, - '_6': 6, - '_12': 12 -} as const; - -export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { - baz: (number) | null; - qux: number; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - (string), - (string) - ]; - foo: 'Corge'; -}; - -export type foo = 'Bar'; - -export const foo = { - BAR: 'Bar' -} as const; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPattern = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - (number | string), - string -]; - -/** - * This is a model with one nested property - */ -export type ModelWithProperties = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: (string) | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -export type ModelWithReadOnlyAndWriteOnly = { - foo: string; - readonly bar: string; - baz: string; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReference = { - prop?: ModelWithProperties; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: (Array<(string | boolean)> | null); -}; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array<(string)>; -}; - -/** - * This is a reusable parameter - */ -export type ParameterSimpleParameter = string; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Parameter with illegal characters - */ -export type Parameterx_Foo_Bar = ModelWithString; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<({ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; -})>; -}; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple file - */ -export type SimpleFile = (Blob | File); - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = (string) | null; - -export type CollectionFormatData = { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCsv: Array<(string)> | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array<(string)> | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array<(string)> | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySsv: Array<(string)> | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTsv: Array<(string)> | null; -}; - -export type ComplexTypesData = { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; -}; - -export type ComplexTypesResponse = (Array); - -export type ComplexParamsData = { - id: number; - requestBody?: { - readonly key: (string) | null; - name: (string) | null; - enabled?: boolean; - readonly type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array<(string)> | null; - parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); - readonly user?: { - readonly id?: number; - readonly name?: (string) | null; - }; - }; -}; - -export type ComplexParamsResponse = (ModelWithString); - -export type PatchApiNoTagResponse = (unknown); - -export type ImportData = { - requestBody: (ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly); -}; - -export type ImportResponse = (Model_From_Zendesk | ModelWithReadOnlyAndWriteOnly); - -export type FooWowResponse = (unknown); - -export type GetApiSimpleOperationData = { - /** - * foo in method - */ - fooParam: string; -}; - -export type GetApiSimpleOperationResponse = (number); - -export type CallWithDefaultParametersData = { - /** - * This is a simple boolean with default value - */ - parameterBoolean?: (boolean) | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: (ModelWithString) | null; - /** - * This is a simple number with default value - */ - parameterNumber?: (number) | null; - /** - * This is a simple string with default value - */ - parameterString?: (string) | null; -}; - -export type CallWithDefaultOptionalParametersData = { - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; -}; - -export type CallToTestOrderOfParamsData = { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: (string) | null; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: (string) | null; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; -}; - -export type DeprecatedCallData = { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: (DeprecatedModel) | null; -}; - -export type CallWithDescriptionsData = { - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: unknown; - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: unknown; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: unknown; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: unknown; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: unknown; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: unknown; -}; - -export type TestErrorCodeData = { - /** - * Status code to return - */ - status: number; -}; - -export type TestErrorCodeResponse = (unknown); - -export type FileResponseData = { - id: string; -}; - -export type FileResponseResponse = ((Blob | File)); - -export type PostApiFormDataData = { - /** - * A reusable request body - */ - formData?: ModelWithString; - /** - * This is a reusable parameter - */ - parameter?: string; -}; - -export type CallWithResultFromHeaderResponse = (string); - -export type MultipartRequestData = { - formData?: { - content?: (Blob | File); - data?: ((ModelWithString) | null); - }; -}; - -export type MultipartResponseResponse = ({ - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; -}); - -export type DummyAResponse = (_400); - -export type DummyBResponse = (void); - -export type CallWithNoContentResponseResponse = (void); - -export type CallWithResponseAndNoContentResponseResponse = (number | void); - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - /** - * Dummy input param - */ - nonAsciiParamæøåÆøÅöôêÊ: number; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = (Array); - -export type PutWithFormUrlEncodedData = { - formData: ArrayWithStrings; -}; - -export type DeleteFooData3 = { - /** - * bar in method - */ - barParam: string; - /** - * foo in method - */ - fooParam: string; - /** - * Parameter with illegal characters - */ - xFooBar: ModelWithString; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the query params - */ - cursor: (string) | null; - fooAllOfEnum: (ModelWithNestedArrayEnumsDataFoo); - fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the cookie - */ - parameterCookie: (string) | null; - /** - * This is the parameter that goes into the header - */ - parameterHeader: (string) | null; - /** - * This is the parameter that goes into the path - */ - parameterPath: (string) | null; - /** - * This is the parameter that goes into the body - */ - requestBody: { - [key: string]: unknown; - } | null; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter with a reserved keyword - */ - _default?: string; - /** - * This is the parameter that goes into the cookie - */ - parameterCookie: (string) | null; - /** - * This is the parameter that goes into the request header - */ - parameterHeader: (string) | null; - /** - * This is the parameter that goes into the path - */ - parameterPath1?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath2?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath3?: string; - /** - * This is the parameter that goes into the request query params - */ - parameterQuery: (string) | null; - /** - * This is the parameter that goes into the body - */ - requestBody: (ModelWithString) | null; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - page?: number; - /** - * This is a required parameter - */ - requestBody: ModelWithOneOfEnum; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is a required parameter - */ - parameter: Pageable; - /** - * This is an optional parameter - */ - requestBody?: { - offset?: (number) | null; - }; -}; - -export type PostCallWithOptionalParamResponse = (number | void); - -export type PostApiRequestBodyData = { - /** - * A reusable request body - */ - foo?: ModelWithString; - /** - * This is a reusable parameter - */ - parameter?: string; -}; - -export type CallWithResponseResponse = (_import); - -export type CallWithDuplicateResponsesResponse = ((ModelWithBoolean & ModelWithInteger) | ModelWithString); - -export type CallWithResponsesResponse = ({ - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; -} | ModelThatExtends | ModelThatExtendsExtends); - -export type ApiVVersionODataControllerCountResponse = (Model_From_Zendesk); - -export type TypesData = { - /** - * This is a number parameter - */ - id?: number; - /** - * This is an array parameter - */ - parameterArray: Array<(string)> | null; - /** - * This is a boolean parameter - */ - parameterBoolean: (boolean) | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: ('Success' | 'Warning' | 'Error') | null; - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is a string parameter - */ - parameterString: (string) | null; - /** - * This is tuple parameter - */ - parameterTuple: [ - number, - number, - number, - number - ]; -}; - -export type TypesResponse = (number | string | boolean | { - [key: string]: unknown; -}); - -export type UploadFileData = { - formData: (Blob | File); -}; - -export type UploadFileResponse = (boolean); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiError.ts deleted file mode 100644 index 36675d288..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiError.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: unknown; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiRequestOptions.ts deleted file mode 100644 index 939a0aa4c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiRequestOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type ApiRequestOptions = { - readonly body?: any; - readonly cookies?: Record; - readonly errors?: Record; - readonly formData?: Record | any[] | Blob | File; - readonly headers?: Record; - readonly mediaType?: string; - readonly method: - | 'DELETE' - | 'GET' - | 'HEAD' - | 'OPTIONS' - | 'PATCH' - | 'POST' - | 'PUT'; - readonly path?: Record; - readonly query?: Record; - readonly responseHeader?: string; - readonly responseTransformer?: (data: unknown) => Promise; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiResult.ts deleted file mode 100644 index 4c58e3913..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/ApiResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ApiResult = { - readonly body: TData; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/CancelablePromise.ts deleted file mode 100644 index ccc082e8f..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/CancelablePromise.ts +++ /dev/null @@ -1,126 +0,0 @@ -export class CancelError extends Error { - constructor(message: string) { - super(message); - this.name = 'CancelError'; - } - - public get isCancelled(): boolean { - return true; - } -} - -export interface OnCancel { - readonly isResolved: boolean; - readonly isRejected: boolean; - readonly isCancelled: boolean; - - (cancelHandler: () => void): void; -} - -export class CancelablePromise implements Promise { - private _isResolved: boolean; - private _isRejected: boolean; - private _isCancelled: boolean; - readonly cancelHandlers: (() => void)[]; - readonly promise: Promise; - private _resolve?: (value: T | PromiseLike) => void; - private _reject?: (reason?: unknown) => void; - - constructor( - executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: unknown) => void, - onCancel: OnCancel - ) => void - ) { - this._isResolved = false; - this._isRejected = false; - this._isCancelled = false; - this.cancelHandlers = []; - this.promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - - const onResolve = (value: T | PromiseLike): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isResolved = true; - if (this._resolve) this._resolve(value); - }; - - const onReject = (reason?: unknown): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isRejected = true; - if (this._reject) this._reject(reason); - }; - - const onCancel = (cancelHandler: () => void): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this.cancelHandlers.push(cancelHandler); - }; - - Object.defineProperty(onCancel, 'isResolved', { - get: (): boolean => this._isResolved, - }); - - Object.defineProperty(onCancel, 'isRejected', { - get: (): boolean => this._isRejected, - }); - - Object.defineProperty(onCancel, 'isCancelled', { - get: (): boolean => this._isCancelled, - }); - - return executor(onResolve, onReject, onCancel as OnCancel); - }); - } - - get [Symbol.toStringTag]() { - return "Cancellable Promise"; - } - - public then( - onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null - ): Promise { - return this.promise.then(onFulfilled, onRejected); - } - - public catch( - onRejected?: ((reason: unknown) => TResult | PromiseLike) | null - ): Promise { - return this.promise.catch(onRejected); - } - - public finally(onFinally?: (() => void) | null): Promise { - return this.promise.finally(onFinally); - } - - public cancel(): void { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isCancelled = true; - if (this.cancelHandlers.length) { - try { - for (const cancelHandler of this.cancelHandlers) { - cancelHandler(); - } - } catch (error) { - console.warn('Cancellation threw an error', error); - return; - } - } - this.cancelHandlers.length = 0; - if (this._reject) this._reject(new CancelError('Request aborted')); - } - - public get isCancelled(): boolean { - return this._isCancelled; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/OpenAPI.ts deleted file mode 100644 index cb7b23cb7..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/OpenAPI.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { AxiosRequestConfig, AxiosResponse } from 'axios'; -import type { ApiRequestOptions } from './ApiRequestOptions'; - -type Headers = Record; -type Middleware = (value: T) => T | Promise; -type Resolver = (options: ApiRequestOptions) => Promise; - -export class Interceptors { - _fns: Middleware[]; - - constructor() { - this._fns = []; - } - - eject(fn: Middleware): void { - const index = this._fns.indexOf(fn); - if (index !== -1) { - this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; - } - } - - use(fn: Middleware): void { - this._fns = [...this._fns, fn]; - } -} - -export type OpenAPIConfig = { - BASE: string; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - ENCODE_PATH?: ((path: string) => string) | undefined; - HEADERS?: Headers | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - VERSION: string; - WITH_CREDENTIALS: boolean; - interceptors: { - request: Interceptors; - response: Interceptors; - }; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: 'http://localhost:3000/base', - CREDENTIALS: 'include', - ENCODE_PATH: undefined, - HEADERS: undefined, - PASSWORD: undefined, - TOKEN: undefined, - USERNAME: undefined, - VERSION: '1.0', - WITH_CREDENTIALS: false, - interceptors: { - request: new Interceptors(), - response: new Interceptors(), - }, -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/request.ts deleted file mode 100644 index ecc2e393c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_axios_transform/core/request.ts +++ /dev/null @@ -1,347 +0,0 @@ -import axios from 'axios'; -import type { AxiosError, AxiosRequestConfig, AxiosResponse, AxiosInstance } from 'axios'; - -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import { CancelablePromise } from './CancelablePromise'; -import type { OnCancel } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const isString = (value: unknown): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: any): value is Blob => { - return value instanceof Blob; -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const isSuccess = (status: number): boolean => { - return status >= 200 && status < 300; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const encodePair = (key: string, value: unknown) => { - if (value === undefined || value === null) { - return; - } - - if (value instanceof Date) { - append(key, value.toISOString()); - } else if (Array.isArray(value)) { - value.forEach(v => encodePair(key, v)); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); - } else { - append(key, value); - } - }; - - Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - - return qs.length ? `?${qs.join('&')}` : ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = config.BASE + path; - return options.query ? url + getQueryString(options.query) : url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([, value]) => value !== undefined && value !== null) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise> => { - const [token, username, password, additionalHeaders] = await Promise.all([ - // @ts-ignore - resolve(options, config.TOKEN), - // @ts-ignore - resolve(options, config.USERNAME), - // @ts-ignore - resolve(options, config.PASSWORD), - // @ts-ignore - resolve(options, config.HEADERS), - ]); - - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - }) - .filter(([, value]) => value !== undefined && value !== null) - .reduce((headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), {} as Record); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } else if (options.formData !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } - } - - return headers; -}; - -export const getRequestBody = (options: ApiRequestOptions): unknown => { - if (options.body) { - return options.body; - } - return undefined; -}; - -export const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: unknown, - formData: FormData | undefined, - headers: Record, - onCancel: OnCancel, - axiosClient: AxiosInstance -): Promise> => { - const controller = new AbortController(); - - let requestConfig: AxiosRequestConfig = { - data: body ?? formData, - headers, - method: options.method, - signal: controller.signal, - url, - withCredentials: config.WITH_CREDENTIALS, - }; - - onCancel(() => controller.abort()); - - for (const fn of config.interceptors.request._fns) { - requestConfig = await fn(requestConfig); - } - - try { - return await axiosClient.request(requestConfig); - } catch (error) { - const axiosError = error as AxiosError; - if (axiosError.response) { - return axiosError.response; - } - throw error; - } -}; - -export const getResponseHeader = (response: AxiosResponse, responseHeader?: string): string | undefined => { - if (responseHeader) { - const content = response.headers[responseHeader]; - if (isString(content)) { - return content; - } - } - return undefined; -}; - -export const getResponseBody = (response: AxiosResponse): unknown => { - if (response.status !== 204) { - return response.data; - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 405: 'Method Not Allowed', - 406: 'Not Acceptable', - 407: 'Proxy Authentication Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Payload Too Large', - 414: 'URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Range Not Satisfiable', - 417: 'Expectation Failed', - 418: 'Im a teapot', - 421: 'Misdirected Request', - 422: 'Unprocessable Content', - 423: 'Locked', - 424: 'Failed Dependency', - 425: 'Too Early', - 426: 'Upgrade Required', - 428: 'Precondition Required', - 429: 'Too Many Requests', - 431: 'Request Header Fields Too Large', - 451: 'Unavailable For Legal Reasons', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported', - 506: 'Variant Also Negotiates', - 507: 'Insufficient Storage', - 508: 'Loop Detected', - 510: 'Not Extended', - 511: 'Network Authentication Required', - ...options.errors, - } - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError(options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @param axiosClient The axios client instance to use - * @returns CancelablePromise - * @throws ApiError - */ -export const request = (config: OpenAPIConfig, options: ApiRequestOptions, axiosClient: AxiosInstance = axios): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options); - - if (!onCancel.isCancelled) { - let response = await sendRequest(config, options, url, body, formData, headers, onCancel, axiosClient); - - for (const fn of config.interceptors.response._fns) { - response = await fn(response); - } - - const responseBody = getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - let transformedBody = responseBody; - if (options.responseTransformer && isSuccess(response.status)) { - transformedBody = await options.responseTransformer(responseBody) - } - - const result: ApiResult = { - url, - ok: isSuccess(response.status), - status: response.status, - statusText: response.statusText, - body: responseHeader ?? transformedBody, - }; - - catchErrorCodes(options, result); - - resolve(result.body); - } - } catch (error) { - reject(error); - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios_transform/index.ts b/packages/openapi-ts-tests/test/generated/v3_axios_transform/index.ts deleted file mode 100644 index 50a1dd734..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_axios_transform/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export { ApiError } from './core/ApiError'; -export { CancelablePromise, CancelError } from './core/CancelablePromise'; -export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios_transform/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_axios_transform/sdk.gen.ts deleted file mode 100644 index 5211e9979..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_axios_transform/sdk.gen.ts +++ /dev/null @@ -1,80 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { CancelablePromise } from './core/CancelablePromise'; -import { OpenAPI } from './core/OpenAPI'; -import { request as __request } from './core/request'; -import { type ParentModelWithDatesResponse, type ModelWithDatesResponse, type ModelWithDatesArrayResponse, type ArrayOfDatesResponse, type DateResponse, type MultipleResponsesResponse, ParentModelWithDatesResponseTransformer, ModelWithDatesResponseTransformer, ModelWithDatesArrayResponseTransformer } from './types.gen'; - -export class DefaultService { - /** - * @returns ParentModelWithDates Success - * @returns unknown Success - * @throws ApiError - */ - public static parentModelWithDates(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/model-with-dates', - responseTransformer: ParentModelWithDatesResponseTransformer - }); - } - - /** - * @returns ModelWithDates Success - * @throws ApiError - */ - public static modelWithDates(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/model-with-dates', - responseTransformer: ModelWithDatesResponseTransformer - }); - } - - /** - * @returns ModelWithDates Success - * @throws ApiError - */ - public static modelWithDatesArray(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/model-with-dates-array', - responseTransformer: ModelWithDatesArrayResponseTransformer - }); - } - - /** - * @returns string Success - * @throws ApiError - */ - public static arrayOfDates(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/array-of-dates' - }); - } - - /** - * @returns string Success - * @throws ApiError - */ - public static date(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/date' - }); - } - - /** - * @returns ModelWithDates Updated - * @returns SimpleModel Created - * @throws ApiError - */ - public static multipleResponses(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/multiple-responses' - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_axios_transform/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_axios_transform/types.gen.ts deleted file mode 100644 index 8c9227850..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_axios_transform/types.gen.ts +++ /dev/null @@ -1,106 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * This is a model that contains a some dates - */ -export type ModelWithDates = { - id: number; - name: string; - readonly enabled: boolean; - readonly modified: Date; - readonly expires?: Date; -}; - -/** - * This is a model that contains a some dates and arrays - */ -export type ParentModelWithDates = { - id: number; - readonly modified?: Date; - items?: Array; - item?: ModelWithDates; - 'nullable-date'?: Array<(Date | null)>; - simpleItems?: Array; - simpleItem?: SimpleModel; - dates?: Array<(Date)>; - strings?: Array<(string)>; -}; - -/** - * This is a model that contains a some dates - */ -export type SimpleModel = { - id: number; - name: string; - readonly enabled: boolean; -}; - -export type ParentModelWithDatesResponse = (ParentModelWithDates | unknown); - -export type ModelWithDatesResponse = (ModelWithDates); - -export type ModelWithDatesArrayResponse = (Array); - -export type ArrayOfDatesResponse = (Array<(Date)>); - -export type DateResponse = (Date); - -export type MultipleResponsesResponse = (Array | Array); - -export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; - -export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; - -export type ModelWithDatesModelResponseTransformer = (data: any) => ModelWithDates; - -export const ModelWithDatesModelResponseTransformer: ModelWithDatesModelResponseTransformer = data => { - if (data?.modified) { - data.modified = new Date(data.modified); - } - if (data?.expires) { - data.expires = new Date(data.expires); - } - return data; -}; - -export const ParentModelWithDatesModelResponseTransformer: ParentModelWithDatesModelResponseTransformer = data => { - if (data?.modified) { - data.modified = new Date(data.modified); - } - if (Array.isArray(data?.items)) { - data.items.forEach(ModelWithDatesModelResponseTransformer); - } - if (data?.item) { - ModelWithDatesModelResponseTransformer(data.item); - } - if (Array.isArray(data?.['nullable-date'])) { - data['nullable-date'] = data['nullable-date'].map(item => item ? new Date(item) : item); - } - if (Array.isArray(data?.dates)) { - data.dates = data.dates.map(item => item ? new Date(item) : item); - } - return data; -}; - -export const ParentModelWithDatesResponseTransformer: ParentModelWithDatesResponseTransformer = async (data) => { - if (data) { - ParentModelWithDatesModelResponseTransformer(data); - } - return data; -}; - -export type ModelWithDatesResponseTransformer = (data: any) => Promise; - -export const ModelWithDatesResponseTransformer: ModelWithDatesResponseTransformer = async (data) => { - ModelWithDatesModelResponseTransformer(data); - return data; -}; - -export type ModelWithDatesArrayResponseTransformer = (data: any) => Promise; - -export const ModelWithDatesArrayResponseTransformer: ModelWithDatesArrayResponseTransformer = async (data) => { - if (Array.isArray(data)) { - data.forEach(ModelWithDatesModelResponseTransformer); - } - return data; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client/ApiClient.ts b/packages/openapi-ts-tests/test/generated/v3_client/ApiClient.ts deleted file mode 100644 index b864adbea..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client/ApiClient.ts +++ /dev/null @@ -1,101 +0,0 @@ -import type { BaseHttpRequest } from './core/BaseHttpRequest'; -import type { OpenAPIConfig } from './core/OpenAPI'; -import { Interceptors } from './core/OpenAPI'; -import { FetchHttpRequest } from './core/FetchHttpRequest'; - -import { CollectionFormatService } from './sdk.gen'; -import { ComplexService } from './sdk.gen'; -import { DefaultService } from './sdk.gen'; -import { DefaultsService } from './sdk.gen'; -import { DeprecatedService } from './sdk.gen'; -import { DescriptionsService } from './sdk.gen'; -import { DuplicateService } from './sdk.gen'; -import { ErrorService } from './sdk.gen'; -import { FileResponseService } from './sdk.gen'; -import { FormDataService } from './sdk.gen'; -import { HeaderService } from './sdk.gen'; -import { MultipartService } from './sdk.gen'; -import { MultipleTags1Service } from './sdk.gen'; -import { MultipleTags2Service } from './sdk.gen'; -import { MultipleTags3Service } from './sdk.gen'; -import { NoContentService } from './sdk.gen'; -import { NonAsciiÆøåÆøÅöôêÊService } from './sdk.gen'; -import { ParametersService } from './sdk.gen'; -import { RequestBodyService } from './sdk.gen'; -import { ResponseService } from './sdk.gen'; -import { SimpleService } from './sdk.gen'; -import { TypesService } from './sdk.gen'; -import { UploadService } from './sdk.gen'; - -type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest; - -export class ApiClient { - - public readonly collectionFormat: CollectionFormatService; - public readonly complex: ComplexService; - public readonly default: DefaultService; - public readonly defaults: DefaultsService; - public readonly deprecated: DeprecatedService; - public readonly descriptions: DescriptionsService; - public readonly duplicate: DuplicateService; - public readonly error: ErrorService; - public readonly fileResponse: FileResponseService; - public readonly formData: FormDataService; - public readonly header: HeaderService; - public readonly multipart: MultipartService; - public readonly multipleTags1: MultipleTags1Service; - public readonly multipleTags2: MultipleTags2Service; - public readonly multipleTags3: MultipleTags3Service; - public readonly noContent: NoContentService; - public readonly nonAsciiÆøåÆøÅöôêÊ: NonAsciiÆøåÆøÅöôêÊService; - public readonly parameters: ParametersService; - public readonly requestBody: RequestBodyService; - public readonly response: ResponseService; - public readonly simple: SimpleService; - public readonly types: TypesService; - public readonly upload: UploadService; - - public readonly request: BaseHttpRequest; - - constructor(config?: Partial, HttpRequest: HttpRequestConstructor = FetchHttpRequest) { - this.request = new HttpRequest({ - BASE: config?.BASE ?? 'http://localhost:3000/base', - VERSION: config?.VERSION ?? '1.0', - WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false, - CREDENTIALS: config?.CREDENTIALS ?? 'include', - TOKEN: config?.TOKEN, - USERNAME: config?.USERNAME, - PASSWORD: config?.PASSWORD, - HEADERS: config?.HEADERS, - ENCODE_PATH: config?.ENCODE_PATH, - interceptors: { - request: config?.interceptors?.request ?? new Interceptors(), - response: config?.interceptors?.response ?? new Interceptors(), - }, - }); - - this.collectionFormat = new CollectionFormatService(this.request); - this.complex = new ComplexService(this.request); - this.default = new DefaultService(this.request); - this.defaults = new DefaultsService(this.request); - this.deprecated = new DeprecatedService(this.request); - this.descriptions = new DescriptionsService(this.request); - this.duplicate = new DuplicateService(this.request); - this.error = new ErrorService(this.request); - this.fileResponse = new FileResponseService(this.request); - this.formData = new FormDataService(this.request); - this.header = new HeaderService(this.request); - this.multipart = new MultipartService(this.request); - this.multipleTags1 = new MultipleTags1Service(this.request); - this.multipleTags2 = new MultipleTags2Service(this.request); - this.multipleTags3 = new MultipleTags3Service(this.request); - this.noContent = new NoContentService(this.request); - this.nonAsciiÆøåÆøÅöôêÊ = new NonAsciiÆøåÆøÅöôêÊService(this.request); - this.parameters = new ParametersService(this.request); - this.requestBody = new RequestBodyService(this.request); - this.response = new ResponseService(this.request); - this.simple = new SimpleService(this.request); - this.types = new TypesService(this.request); - this.upload = new UploadService(this.request); - } -} diff --git a/packages/openapi-ts-tests/test/generated/v3_client/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_client/core/ApiError.ts deleted file mode 100644 index 36675d288..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client/core/ApiError.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: unknown; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_client/core/ApiRequestOptions.ts deleted file mode 100644 index 939a0aa4c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client/core/ApiRequestOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type ApiRequestOptions = { - readonly body?: any; - readonly cookies?: Record; - readonly errors?: Record; - readonly formData?: Record | any[] | Blob | File; - readonly headers?: Record; - readonly mediaType?: string; - readonly method: - | 'DELETE' - | 'GET' - | 'HEAD' - | 'OPTIONS' - | 'PATCH' - | 'POST' - | 'PUT'; - readonly path?: Record; - readonly query?: Record; - readonly responseHeader?: string; - readonly responseTransformer?: (data: unknown) => Promise; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_client/core/ApiResult.ts deleted file mode 100644 index 4c58e3913..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client/core/ApiResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ApiResult = { - readonly body: TData; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client/core/BaseHttpRequest.ts b/packages/openapi-ts-tests/test/generated/v3_client/core/BaseHttpRequest.ts deleted file mode 100644 index ee28b8164..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client/core/BaseHttpRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { CancelablePromise } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; - -export abstract class BaseHttpRequest { - - constructor(public readonly config: OpenAPIConfig) {} - - public abstract request(options: ApiRequestOptions): CancelablePromise; -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_client/core/CancelablePromise.ts deleted file mode 100644 index ccc082e8f..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client/core/CancelablePromise.ts +++ /dev/null @@ -1,126 +0,0 @@ -export class CancelError extends Error { - constructor(message: string) { - super(message); - this.name = 'CancelError'; - } - - public get isCancelled(): boolean { - return true; - } -} - -export interface OnCancel { - readonly isResolved: boolean; - readonly isRejected: boolean; - readonly isCancelled: boolean; - - (cancelHandler: () => void): void; -} - -export class CancelablePromise implements Promise { - private _isResolved: boolean; - private _isRejected: boolean; - private _isCancelled: boolean; - readonly cancelHandlers: (() => void)[]; - readonly promise: Promise; - private _resolve?: (value: T | PromiseLike) => void; - private _reject?: (reason?: unknown) => void; - - constructor( - executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: unknown) => void, - onCancel: OnCancel - ) => void - ) { - this._isResolved = false; - this._isRejected = false; - this._isCancelled = false; - this.cancelHandlers = []; - this.promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - - const onResolve = (value: T | PromiseLike): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isResolved = true; - if (this._resolve) this._resolve(value); - }; - - const onReject = (reason?: unknown): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isRejected = true; - if (this._reject) this._reject(reason); - }; - - const onCancel = (cancelHandler: () => void): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this.cancelHandlers.push(cancelHandler); - }; - - Object.defineProperty(onCancel, 'isResolved', { - get: (): boolean => this._isResolved, - }); - - Object.defineProperty(onCancel, 'isRejected', { - get: (): boolean => this._isRejected, - }); - - Object.defineProperty(onCancel, 'isCancelled', { - get: (): boolean => this._isCancelled, - }); - - return executor(onResolve, onReject, onCancel as OnCancel); - }); - } - - get [Symbol.toStringTag]() { - return "Cancellable Promise"; - } - - public then( - onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null - ): Promise { - return this.promise.then(onFulfilled, onRejected); - } - - public catch( - onRejected?: ((reason: unknown) => TResult | PromiseLike) | null - ): Promise { - return this.promise.catch(onRejected); - } - - public finally(onFinally?: (() => void) | null): Promise { - return this.promise.finally(onFinally); - } - - public cancel(): void { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isCancelled = true; - if (this.cancelHandlers.length) { - try { - for (const cancelHandler of this.cancelHandlers) { - cancelHandler(); - } - } catch (error) { - console.warn('Cancellation threw an error', error); - return; - } - } - this.cancelHandlers.length = 0; - if (this._reject) this._reject(new CancelError('Request aborted')); - } - - public get isCancelled(): boolean { - return this._isCancelled; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client/core/FetchHttpRequest.ts b/packages/openapi-ts-tests/test/generated/v3_client/core/FetchHttpRequest.ts deleted file mode 100644 index e7c4bd5a9..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client/core/FetchHttpRequest.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import { BaseHttpRequest } from './BaseHttpRequest'; -import type { CancelablePromise } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; -import { request as __request } from './request'; - -export class FetchHttpRequest extends BaseHttpRequest { - - constructor(config: OpenAPIConfig) { - super(config); - } - - /** - * Request method - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ - public override request(options: ApiRequestOptions): CancelablePromise { - return __request(this.config, options); - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_client/core/OpenAPI.ts deleted file mode 100644 index 144e25744..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client/core/OpenAPI.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; - -type Headers = Record; -type Middleware = (value: T) => T | Promise; -type Resolver = (options: ApiRequestOptions) => Promise; - -export class Interceptors { - _fns: Middleware[]; - - constructor() { - this._fns = []; - } - - eject(fn: Middleware): void { - const index = this._fns.indexOf(fn); - if (index !== -1) { - this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; - } - } - - use(fn: Middleware): void { - this._fns = [...this._fns, fn]; - } -} - -export type OpenAPIConfig = { - BASE: string; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - ENCODE_PATH?: ((path: string) => string) | undefined; - HEADERS?: Headers | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - VERSION: string; - WITH_CREDENTIALS: boolean; - interceptors: { - request: Interceptors; - response: Interceptors; - }; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: 'http://localhost:3000/base', - CREDENTIALS: 'include', - ENCODE_PATH: undefined, - HEADERS: undefined, - PASSWORD: undefined, - TOKEN: undefined, - USERNAME: undefined, - VERSION: '1.0', - WITH_CREDENTIALS: false, - interceptors: { - request: new Interceptors(), - response: new Interceptors(), - }, -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_client/core/request.ts deleted file mode 100644 index 5458a2899..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client/core/request.ts +++ /dev/null @@ -1,350 +0,0 @@ -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import { CancelablePromise } from './CancelablePromise'; -import type { OnCancel } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const isString = (value: unknown): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: any): value is Blob => { - return value instanceof Blob; -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const encodePair = (key: string, value: unknown) => { - if (value === undefined || value === null) { - return; - } - - if (value instanceof Date) { - append(key, value.toISOString()); - } else if (Array.isArray(value)) { - value.forEach(v => encodePair(key, v)); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); - } else { - append(key, value); - } - }; - - Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - - return qs.length ? `?${qs.join('&')}` : ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = config.BASE + path; - return options.query ? url + getQueryString(options.query) : url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([, value]) => value !== undefined && value !== null) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { - const [token, username, password, additionalHeaders] = await Promise.all([ - // @ts-ignore - resolve(options, config.TOKEN), - // @ts-ignore - resolve(options, config.USERNAME), - // @ts-ignore - resolve(options, config.PASSWORD), - // @ts-ignore - resolve(options, config.HEADERS), - ]); - - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - }) - .filter(([, value]) => value !== undefined && value !== null) - .reduce((headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), {} as Record); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return new Headers(headers); -}; - -export const getRequestBody = (options: ApiRequestOptions): unknown => { - if (options.body !== undefined) { - if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { - return JSON.stringify(options.body); - } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; -}; - -export const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: any, - formData: FormData | undefined, - headers: Headers, - onCancel: OnCancel -): Promise => { - const controller = new AbortController(); - - let request: RequestInit = { - headers, - body: body ?? formData, - method: options.method, - signal: controller.signal, - }; - - if (config.WITH_CREDENTIALS) { - request.credentials = config.CREDENTIALS; - } - - for (const fn of config.interceptors.request._fns) { - request = await fn(request); - } - - onCancel(() => controller.abort()); - - return await fetch(url, request); -}; - -export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { - if (responseHeader) { - const content = response.headers.get(responseHeader); - if (isString(content)) { - return content; - } - } - return undefined; -}; - -export const getResponseBody = async (response: Response): Promise => { - if (response.status !== 204) { - try { - const contentType = response.headers.get('Content-Type'); - if (contentType) { - const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; - if (contentType.includes('application/json') || contentType.includes('+json')) { - return await response.json(); - } else if (binaryTypes.some(type => contentType.includes(type))) { - return await response.blob(); - } else if (contentType.includes('multipart/form-data')) { - return await response.formData(); - } else if (contentType.includes('text/')) { - return await response.text(); - } - } - } catch (error) { - console.error(error); - } - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 405: 'Method Not Allowed', - 406: 'Not Acceptable', - 407: 'Proxy Authentication Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Payload Too Large', - 414: 'URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Range Not Satisfiable', - 417: 'Expectation Failed', - 418: 'Im a teapot', - 421: 'Misdirected Request', - 422: 'Unprocessable Content', - 423: 'Locked', - 424: 'Failed Dependency', - 425: 'Too Early', - 426: 'Upgrade Required', - 428: 'Precondition Required', - 429: 'Too Many Requests', - 431: 'Request Header Fields Too Large', - 451: 'Unavailable For Legal Reasons', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported', - 506: 'Variant Also Negotiates', - 507: 'Insufficient Storage', - 508: 'Loop Detected', - 510: 'Not Extended', - 511: 'Network Authentication Required', - ...options.errors, - } - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError(options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ -export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options); - - if (!onCancel.isCancelled) { - let response = await sendRequest(config, options, url, body, formData, headers, onCancel); - - for (const fn of config.interceptors.response._fns) { - response = await fn(response); - } - - const responseBody = await getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - let transformedBody = responseBody; - if (options.responseTransformer && response.ok) { - transformedBody = await options.responseTransformer(responseBody) - } - - const result: ApiResult = { - url, - ok: response.ok, - status: response.status, - statusText: response.statusText, - body: responseHeader ?? transformedBody, - }; - - catchErrorCodes(options, result); - - resolve(result.body); - } - } catch (error) { - reject(error); - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client/index.ts b/packages/openapi-ts-tests/test/generated/v3_client/index.ts deleted file mode 100644 index 7e12dd663..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export { ApiClient } from './ApiClient'; -export { ApiError } from './core/ApiError'; -export { BaseHttpRequest } from './core/BaseHttpRequest'; -export { CancelablePromise, CancelError } from './core/CancelablePromise'; -export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_client/sdk.gen.ts deleted file mode 100644 index ca0f0d5c1..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client/sdk.gen.ts +++ /dev/null @@ -1,958 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { CancelablePromise } from './core/CancelablePromise'; -import type { BaseHttpRequest } from './core/BaseHttpRequest'; -import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; - -export class CollectionFormatService { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @param data The data for the request. - * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) - * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) - * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) - * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) - * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) - * @throws ApiError - */ - public collectionFormat(data: CollectionFormatData): CancelablePromise { - return this.httpRequest.request({ - method: 'GET', - url: '/api/v{api-version}/collectionFormat', - query: { - parameterArrayCSV: data.parameterArrayCsv, - parameterArraySSV: data.parameterArraySsv, - parameterArrayTSV: data.parameterArrayTsv, - parameterArrayPipes: data.parameterArrayPipes, - parameterArrayMulti: data.parameterArrayMulti - } - }); - } - -} - -export class ComplexService { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @param data The data for the request. - * @param data.parameterObject Parameter containing object - * @param data.parameterReference Parameter containing reference - * @returns ModelWithString Successful response - * @throws ApiError - */ - public complexTypes(data: ComplexTypesData): CancelablePromise { - return this.httpRequest.request({ - method: 'GET', - url: '/api/v{api-version}/complex', - query: { - parameterObject: data.parameterObject, - parameterReference: data.parameterReference - }, - errors: { - 400: '400 `server` error', - 500: '500 server error' - } - }); - } - - /** - * @param data The data for the request. - * @param data.id - * @param data.requestBody - * @returns ModelWithString Success - * @throws ApiError - */ - public complexParams(data: ComplexParamsData): CancelablePromise { - return this.httpRequest.request({ - method: 'PUT', - url: '/api/v{api-version}/complex/{id}', - path: { - id: data.id - }, - body: data.requestBody, - mediaType: 'application/json-patch+json' - }); - } - -} - -export class DefaultService { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @throws ApiError - */ - public export(): CancelablePromise { - return this.httpRequest.request({ - method: 'GET', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public patchApiNoTag(): CancelablePromise { - return this.httpRequest.request({ - method: 'PATCH', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @param data The data for the request. - * @param data.requestBody - * @returns Model_From_Zendesk Success - * @returns ModelWithReadOnlyAndWriteOnly Default success response - * @throws ApiError - */ - public import(data: ImportData): CancelablePromise { - return this.httpRequest.request({ - method: 'POST', - url: '/api/v{api-version}/no+tag', - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public fooWow(): CancelablePromise { - return this.httpRequest.request({ - method: 'PUT', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @param data The data for the request. - * @param data.fooParam foo in method - * @returns number Response is a simple number - * @throws ApiError - */ - public getApiSimpleOperation(data: GetApiSimpleOperationData): CancelablePromise { - return this.httpRequest.request({ - method: 'GET', - url: '/api/v{api-version}/simple:operation', - path: { - foo_param: data.fooParam - }, - errors: { - default: 'Default error response' - } - }); - } - -} - -export class DefaultsService { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @param data The data for the request. - * @param data.parameterString This is a simple string with default value - * @param data.parameterNumber This is a simple number with default value - * @param data.parameterBoolean This is a simple boolean with default value - * @param data.parameterEnum This is a simple enum with default value - * @param data.parameterModel This is a simple model with default value - * @throws ApiError - */ - public callWithDefaultParameters(data: CallWithDefaultParametersData = {}): CancelablePromise { - return this.httpRequest.request({ - method: 'GET', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterString This is a simple string that is optional with default value - * @param data.parameterNumber This is a simple number that is optional with default value - * @param data.parameterBoolean This is a simple boolean that is optional with default value - * @param data.parameterEnum This is a simple enum that is optional with default value - * @param data.parameterModel This is a simple model that is optional with default value - * @throws ApiError - */ - public callWithDefaultOptionalParameters(data: CallWithDefaultOptionalParametersData = {}): CancelablePromise { - return this.httpRequest.request({ - method: 'POST', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterStringWithNoDefault This is a string with no default - * @param data.parameterOptionalStringWithDefault This is a optional string with default - * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default - * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default - * @param data.parameterStringWithDefault This is a string with default - * @param data.parameterStringWithEmptyDefault This is a string with empty default - * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default - * @param data.parameterStringNullableWithDefault This is a string that can be null with default - * @throws ApiError - */ - public callToTestOrderOfParams(data: CallToTestOrderOfParamsData): CancelablePromise { - return this.httpRequest.request({ - method: 'PUT', - url: '/api/v{api-version}/defaults', - query: { - parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, - parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, - parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, - parameterStringWithDefault: data.parameterStringWithDefault, - parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, - parameterStringWithNoDefault: data.parameterStringWithNoDefault, - parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, - parameterStringNullableWithDefault: data.parameterStringNullableWithDefault - } - }); - } - -} - -export class DeprecatedService { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @deprecated - * @param data The data for the request. - * @param data.parameter This parameter is deprecated - * @throws ApiError - */ - public deprecatedCall(data: DeprecatedCallData): CancelablePromise { - return this.httpRequest.request({ - method: 'POST', - url: '/api/v{api-version}/parameters/deprecated', - headers: { - parameter: data.parameter - } - }); - } - -} - -export class DescriptionsService { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @param data The data for the request. - * @param data.parameterWithBreaks Testing multiline comments in string: First line - * Second line - * - * Fourth line - * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work - * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work - * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work - * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work - * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work - * @throws ApiError - */ - public callWithDescriptions(data: CallWithDescriptionsData = {}): CancelablePromise { - return this.httpRequest.request({ - method: 'POST', - url: '/api/v{api-version}/descriptions/', - query: { - parameterWithBreaks: data.parameterWithBreaks, - parameterWithBackticks: data.parameterWithBackticks, - parameterWithSlashes: data.parameterWithSlashes, - parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders, - parameterWithQuotes: data.parameterWithQuotes, - parameterWithReservedCharacters: data.parameterWithReservedCharacters - } - }); - } - -} - -export class DuplicateService { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @throws ApiError - */ - public duplicateName(): CancelablePromise { - return this.httpRequest.request({ - method: 'GET', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public duplicateName1(): CancelablePromise { - return this.httpRequest.request({ - method: 'POST', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public duplicateName2(): CancelablePromise { - return this.httpRequest.request({ - method: 'PUT', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public duplicateName3(): CancelablePromise { - return this.httpRequest.request({ - method: 'DELETE', - url: '/api/v{api-version}/duplicate' - }); - } - -} - -export class ErrorService { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @param data The data for the request. - * @param data.status Status code to return - * @returns unknown Custom message: Successful response - * @throws ApiError - */ - public testErrorCode(data: TestErrorCodeData): CancelablePromise { - return this.httpRequest.request({ - method: 'POST', - url: '/api/v{api-version}/error', - query: { - status: data.status - }, - errors: { - 500: 'Custom message: Internal Server Error', - 501: 'Custom message: Not Implemented', - 502: 'Custom message: Bad Gateway', - 503: 'Custom message: Service Unavailable' - } - }); - } - -} - -export class FileResponseService { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @param data The data for the request. - * @param data.id - * @returns binary Success - * @throws ApiError - */ - public fileResponse(data: FileResponseData): CancelablePromise { - return this.httpRequest.request({ - method: 'GET', - url: '/api/v{api-version}/file/{id}', - path: { - id: data.id - } - }); - } - -} - -export class FormDataService { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @param data The data for the request. - * @param data.parameter This is a reusable parameter - * @param data.formData A reusable request body - * @throws ApiError - */ - public postApiFormData(data: PostApiFormDataData = {}): CancelablePromise { - return this.httpRequest.request({ - method: 'POST', - url: '/api/v{api-version}/formData/', - query: { - parameter: data.parameter - }, - formData: data.formData, - mediaType: 'multipart/form-data' - }); - } - -} - -export class HeaderService { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @returns string Successful response - * @throws ApiError - */ - public callWithResultFromHeader(): CancelablePromise { - return this.httpRequest.request({ - method: 'POST', - url: '/api/v{api-version}/header', - responseHeader: 'operation-location', - errors: { - 400: '400 server error', - 500: '500 server error' - } - }); - } - -} - -export class MultipartService { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @param data The data for the request. - * @param data.formData - * @throws ApiError - */ - public multipartRequest(data: MultipartRequestData = {}): CancelablePromise { - return this.httpRequest.request({ - method: 'POST', - url: '/api/v{api-version}/multipart', - formData: data.formData, - mediaType: 'multipart/form-data' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public multipartResponse(): CancelablePromise { - return this.httpRequest.request({ - method: 'GET', - url: '/api/v{api-version}/multipart' - }); - } - -} - -export class MultipleTags1Service { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @returns _400 - * @throws ApiError - */ - public dummyA(): CancelablePromise { - return this.httpRequest.request({ - method: 'GET', - url: '/api/v{api-version}/multiple-tags/a' - }); - } - - /** - * @returns void Success - * @throws ApiError - */ - public dummyB(): CancelablePromise { - return this.httpRequest.request({ - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class MultipleTags2Service { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @returns _400 - * @throws ApiError - */ - public dummyA(): CancelablePromise { - return this.httpRequest.request({ - method: 'GET', - url: '/api/v{api-version}/multiple-tags/a' - }); - } - - /** - * @returns void Success - * @throws ApiError - */ - public dummyB(): CancelablePromise { - return this.httpRequest.request({ - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class MultipleTags3Service { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @returns void Success - * @throws ApiError - */ - public dummyB(): CancelablePromise { - return this.httpRequest.request({ - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class NoContentService { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @returns void Success - * @throws ApiError - */ - public callWithNoContentResponse(): CancelablePromise { - return this.httpRequest.request({ - method: 'GET', - url: '/api/v{api-version}/no-content' - }); - } - - /** - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public callWithResponseAndNoContentResponse(): CancelablePromise { - return this.httpRequest.request({ - method: 'GET', - url: '/api/v{api-version}/multiple-tags/response-and-no-content' - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @param data The data for the request. - * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param - * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response - * @throws ApiError - */ - public nonAsciiæøåÆøÅöôêÊ字符串(data: NonAsciiæøåÆøÅöôêÊ字符串Data): CancelablePromise { - return this.httpRequest.request({ - method: 'POST', - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - query: { - 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ - } - }); - } - - /** - * Login User - * @param data The data for the request. - * @param data.formData - * @throws ApiError - */ - public putWithFormUrlEncoded(data: PutWithFormUrlEncodedData): CancelablePromise { - return this.httpRequest.request({ - method: 'PUT', - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - formData: data.formData, - mediaType: 'application/x-www-form-urlencoded' - }); - } - -} - -export class ParametersService { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @param data The data for the request. - * @param data.fooParam foo in method - * @param data.barParam bar in method - * @param data.xFooBar Parameter with illegal characters - * @throws ApiError - */ - public deleteFoo(data: DeleteFooData3): CancelablePromise { - return this.httpRequest.request({ - method: 'DELETE', - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - path: { - foo_param: data.fooParam, - BarParam: data.barParam - }, - headers: { - 'x-Foo-Bar': data.xFooBar - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the header - * @param data.fooAllOfEnum - * @param data.cursor This is the parameter that goes into the query params - * @param data.parameterCookie This is the parameter that goes into the cookie - * @param data.parameterPath This is the parameter that goes into the path - * @param data.requestBody This is the parameter that goes into the body - * @param data.fooRefEnum - * @throws ApiError - */ - public callWithParameters(data: CallWithParametersData): CancelablePromise { - return this.httpRequest.request({ - method: 'POST', - url: '/api/v{api-version}/parameters/{parameterPath}', - path: { - parameterPath: data.parameterPath - }, - cookies: { - parameterCookie: data.parameterCookie - }, - headers: { - parameterHeader: data.parameterHeader - }, - query: { - foo_ref_enum: data.fooRefEnum, - foo_all_of_enum: data.fooAllOfEnum, - cursor: data.cursor - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the request header - * @param data.parameterQuery This is the parameter that goes into the request query params - * @param data.parameterCookie This is the parameter that goes into the cookie - * @param data.requestBody This is the parameter that goes into the body - * @param data.parameterPath1 This is the parameter that goes into the path - * @param data.parameterPath2 This is the parameter that goes into the path - * @param data.parameterPath3 This is the parameter that goes into the path - * @param data._default This is the parameter with a reserved keyword - * @throws ApiError - */ - public callWithWeirdParameterNames(data: CallWithWeirdParameterNamesData): CancelablePromise { - return this.httpRequest.request({ - method: 'POST', - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - path: { - 'parameter.path.1': data.parameterPath1, - 'parameter-path-2': data.parameterPath2, - 'PARAMETER-PATH-3': data.parameterPath3 - }, - cookies: { - 'PARAMETER-COOKIE': data.parameterCookie - }, - headers: { - 'parameter.header': data.parameterHeader - }, - query: { - default: data._default, - 'parameter-query': data.parameterQuery - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.requestBody This is a required parameter - * @param data.page This is an optional parameter - * @throws ApiError - */ - public getCallWithOptionalParam(data: GetCallWithOptionalParamData): CancelablePromise { - return this.httpRequest.request({ - method: 'GET', - url: '/api/v{api-version}/parameters/', - query: { - page: data.page - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.parameter This is a required parameter - * @param data.requestBody This is an optional parameter - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public postCallWithOptionalParam(data: PostCallWithOptionalParamData): CancelablePromise { - return this.httpRequest.request({ - method: 'POST', - url: '/api/v{api-version}/parameters/', - query: { - parameter: data.parameter - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - -} - -export class RequestBodyService { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @param data The data for the request. - * @param data.parameter This is a reusable parameter - * @param data.foo A reusable request body - * @throws ApiError - */ - public postApiRequestBody(data: PostApiRequestBodyData = {}): CancelablePromise { - return this.httpRequest.request({ - method: 'POST', - url: '/api/v{api-version}/requestBody/', - query: { - parameter: data.parameter - }, - body: data.foo, - mediaType: 'application/json' - }); - } - -} - -export class ResponseService { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public callWithResponseAndNoContentResponse(): CancelablePromise { - return this.httpRequest.request({ - method: 'GET', - url: '/api/v{api-version}/multiple-tags/response-and-no-content' - }); - } - - /** - * @returns import - * @throws ApiError - */ - public callWithResponse(): CancelablePromise { - return this.httpRequest.request({ - method: 'GET', - url: '/api/v{api-version}/response' - }); - } - - /** - * @returns unknown Message for 200 response - * @returns ModelWithString Message for 201 response - * @returns ModelWithString Message for 202 response - * @throws ApiError - */ - public callWithDuplicateResponses(): CancelablePromise { - return this.httpRequest.request({ - method: 'POST', - url: '/api/v{api-version}/response', - errors: { - 500: 'Message for 500 error', - 501: 'Message for 501 error', - 502: 'Message for 502 error', - '4XX': 'Message for 4XX errors', - default: 'Default error response' - } - }); - } - - /** - * @returns unknown Message for 200 response - * @returns ModelThatExtends Message for 201 response - * @returns ModelThatExtendsExtends Message for 202 response - * @throws ApiError - */ - public callWithResponses(): CancelablePromise { - return this.httpRequest.request({ - method: 'PUT', - url: '/api/v{api-version}/response', - errors: { - 500: 'Message for 500 error', - 501: 'Message for 501 error', - 502: 'Message for 502 error', - default: 'Message for default response' - } - }); - } - -} - -export class SimpleService { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @returns Model_From_Zendesk Success - * @throws ApiError - */ - public apiVVersionODataControllerCount(): CancelablePromise { - return this.httpRequest.request({ - method: 'GET', - url: '/api/v{api-version}/simple/$count' - }); - } - - /** - * @throws ApiError - */ - public getCallWithoutParametersAndResponse(): CancelablePromise { - return this.httpRequest.request({ - method: 'GET', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public putCallWithoutParametersAndResponse(): CancelablePromise { - return this.httpRequest.request({ - method: 'PUT', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public postCallWithoutParametersAndResponse(): CancelablePromise { - return this.httpRequest.request({ - method: 'POST', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public deleteCallWithoutParametersAndResponse(): CancelablePromise { - return this.httpRequest.request({ - method: 'DELETE', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public optionsCallWithoutParametersAndResponse(): CancelablePromise { - return this.httpRequest.request({ - method: 'OPTIONS', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public headCallWithoutParametersAndResponse(): CancelablePromise { - return this.httpRequest.request({ - method: 'HEAD', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public patchCallWithoutParametersAndResponse(): CancelablePromise { - return this.httpRequest.request({ - method: 'PATCH', - url: '/api/v{api-version}/simple' - }); - } - -} - -export class TypesService { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @param data The data for the request. - * @param data.parameterArray This is an array parameter - * @param data.parameterDictionary This is a dictionary parameter - * @param data.parameterEnum This is an enum parameter - * @param data.parameterTuple This is tuple parameter - * @param data.parameterNumber This is a number parameter - * @param data.parameterString This is a string parameter - * @param data.parameterBoolean This is a boolean parameter - * @param data.parameterObject This is an object parameter - * @param data.id This is a number parameter - * @returns number Response is a simple number - * @returns string Response is a simple string - * @returns boolean Response is a simple boolean - * @returns unknown Response is a simple object - * @throws ApiError - */ - public types(data: TypesData): CancelablePromise { - return this.httpRequest.request({ - method: 'GET', - url: '/api/v{api-version}/types', - path: { - id: data.id - }, - query: { - parameterNumber: data.parameterNumber, - parameterString: data.parameterString, - parameterBoolean: data.parameterBoolean, - parameterObject: data.parameterObject, - parameterArray: data.parameterArray, - parameterDictionary: data.parameterDictionary, - parameterEnum: data.parameterEnum, - parameterTuple: data.parameterTuple - } - }); - } - -} - -export class UploadService { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @param data The data for the request. - * @param data.formData - * @returns boolean - * @throws ApiError - */ - public uploadFile(data: UploadFileData): CancelablePromise { - return this.httpRequest.request({ - method: 'POST', - url: '/api/v{api-version}/upload', - formData: data.formData, - mediaType: 'application/x-www-form-urlencoded' - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_client/types.gen.ts deleted file mode 100644 index df8f9dece..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client/types.gen.ts +++ /dev/null @@ -1,1414 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _3e_num_1Период = 'Bird' | 'Dog'; - -/** - * Model with number-only name - */ -export type _400 = string; - -export type _default = { - name?: string; -}; - -/** - * Model with restricted keyword name - */ -export type _import = string; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: (number) | undefined; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AnyOfAnyAndNull = { - data?: (unknown | null); -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<({ - foo?: string; -} | { - bar?: string; -})>; -}; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<({ - foo?: string; -} | { - bar?: string; -})>; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array<(boolean)>; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array<(number)>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: camelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array<(string)>; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type camelCaseCommentWithBreaks = number; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - firstName: string; - lastname: string; - age: number; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: (({ - boolean?: boolean; -} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: (Array<(_3e_num_1Период | ConstValue)> | null); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(number | string)>; -}); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: ParameterSimpleParameter; -} | { - bar: NonAsciiStringæøåÆØÅöôêÊ字符串; -}) & { - baz: (number) | null; - qux: number; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(boolean)>; -}); -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: (boolean | { - [key: string]: (number); -}); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; - -export type ConstValue = "ConstValue"; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: (string); - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: (string | number | boolean) | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: (string); -}; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -export type File = { - readonly id?: string; - readonly updated_at?: Date; - readonly created_at?: Date; - mime: string; - readonly file?: string; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { - item?: boolean; - error?: (string) | null; - readonly hasError?: boolean; - data?: { - [key: string]: unknown; - }; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_String_ = { - item?: (string) | null; - error?: (string) | null; - readonly hasError?: boolean; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type Model_From_Zendesk = string; - -/** - * Circle - */ -export type ModelCircle = { - kind: 'circle'; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: 'square'; - sideLength?: number; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string; -}; - -export type ModelWithAnyOfConstantSizeArray = [ - (number | string), - (number | string), - (number | string) -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - (number & string), - (number & string) -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - ((number) | null | string), - ((number) | null | string), - ((number) | null | string) -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - (number | _import), - (number | _import) -]; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnly = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -export type ModelWithConst = { - String?: "String"; - number?: 0; - null?: null; - withType?: "Some string"; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: (string); - }; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: boolean; -}; - -/** - * This is a simple enum with strings - */ -export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - -/** - * These are the HTTP error code enums - */ -export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -export type foo_bar_baz_qux = '3.0'; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array<(string)>; - data?: (ModelWithNestedArrayEnumsData); -}; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedCompositionEnums = { - foo?: (ModelWithNestedArrayEnumsDataFoo); -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: ('Success' | 'Warning' | 'Error'); - }; - dictionaryWithEnumFromDescription?: { - [key: string]: (number); - }; - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; - arrayWithDescription?: Array<(number)>; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedProperties = { - readonly first: { - readonly second: { - readonly third: (string) | null; - } | null; - } | null; -}; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: (string) | null; - /** - * This is a simple string property - */ - nullableProp2?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: (string) | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Период - */ -export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; - -export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { - baz: (number) | null; - qux: number; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: Date; - foo: 'Quux'; -} | { - content: [ - (Date | string), - (Date | string) - ]; - foo: 'Corge'; -}; - -export type foo = 'Bar'; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPattern = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: Date; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - (number | string), - string -]; - -/** - * This is a model with one nested property - */ -export type ModelWithProperties = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: (string) | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -export type ModelWithReadOnlyAndWriteOnly = { - foo: string; - readonly bar: string; - baz: string; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReference = { - prop?: ModelWithProperties; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: (Array<(string | boolean)> | null); -}; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array<(string)>; -}; - -/** - * This is a reusable parameter - */ -export type ParameterSimpleParameter = string; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Parameter with illegal characters - */ -export type Parameterx_Foo_Bar = ModelWithString; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<({ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; -})>; -}; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple file - */ -export type SimpleFile = (Blob | File); - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = (string) | null; - -export type CollectionFormatData = { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCsv: Array<(string)> | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array<(string)> | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array<(string)> | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySsv: Array<(string)> | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTsv: Array<(string)> | null; -}; - -export type ComplexTypesData = { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; -}; - -export type ComplexTypesResponse = (Array); - -export type ComplexParamsData = { - id: number; - requestBody?: { - readonly key: (string) | null; - name: (string) | null; - enabled?: boolean; - readonly type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array<(string)> | null; - parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); - readonly user?: { - readonly id?: number; - readonly name?: (string) | null; - }; - }; -}; - -export type ComplexParamsResponse = (ModelWithString); - -export type PatchApiNoTagResponse = (unknown); - -export type ImportData = { - requestBody: (ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly); -}; - -export type ImportResponse = (Model_From_Zendesk | ModelWithReadOnlyAndWriteOnly); - -export type FooWowResponse = (unknown); - -export type GetApiSimpleOperationData = { - /** - * foo in method - */ - fooParam: string; -}; - -export type GetApiSimpleOperationResponse = (number); - -export type CallWithDefaultParametersData = { - /** - * This is a simple boolean with default value - */ - parameterBoolean?: (boolean) | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: (ModelWithString) | null; - /** - * This is a simple number with default value - */ - parameterNumber?: (number) | null; - /** - * This is a simple string with default value - */ - parameterString?: (string) | null; -}; - -export type CallWithDefaultOptionalParametersData = { - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; -}; - -export type CallToTestOrderOfParamsData = { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: (string) | null; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: (string) | null; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; -}; - -export type DeprecatedCallData = { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: (DeprecatedModel) | null; -}; - -export type CallWithDescriptionsData = { - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: unknown; - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: unknown; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: unknown; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: unknown; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: unknown; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: unknown; -}; - -export type TestErrorCodeData = { - /** - * Status code to return - */ - status: number; -}; - -export type TestErrorCodeResponse = (unknown); - -export type FileResponseData = { - id: string; -}; - -export type FileResponseResponse = ((Blob | File)); - -export type PostApiFormDataData = { - /** - * A reusable request body - */ - formData?: ModelWithString; - /** - * This is a reusable parameter - */ - parameter?: string; -}; - -export type CallWithResultFromHeaderResponse = (string); - -export type MultipartRequestData = { - formData?: { - content?: (Blob | File); - data?: ((ModelWithString) | null); - }; -}; - -export type MultipartResponseResponse = ({ - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; -}); - -export type DummyAResponse = (_400); - -export type DummyBResponse = (void); - -export type CallWithNoContentResponseResponse = (void); - -export type CallWithResponseAndNoContentResponseResponse = (number | void); - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - /** - * Dummy input param - */ - nonAsciiParamæøåÆøÅöôêÊ: number; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = (Array); - -export type PutWithFormUrlEncodedData = { - formData: ArrayWithStrings; -}; - -export type DeleteFooData3 = { - /** - * bar in method - */ - barParam: string; - /** - * foo in method - */ - fooParam: string; - /** - * Parameter with illegal characters - */ - xFooBar: ModelWithString; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the query params - */ - cursor: (string) | null; - fooAllOfEnum: (ModelWithNestedArrayEnumsDataFoo); - fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the cookie - */ - parameterCookie: (string) | null; - /** - * This is the parameter that goes into the header - */ - parameterHeader: (string) | null; - /** - * This is the parameter that goes into the path - */ - parameterPath: (string) | null; - /** - * This is the parameter that goes into the body - */ - requestBody: { - [key: string]: unknown; - } | null; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter with a reserved keyword - */ - _default?: string; - /** - * This is the parameter that goes into the cookie - */ - parameterCookie: (string) | null; - /** - * This is the parameter that goes into the request header - */ - parameterHeader: (string) | null; - /** - * This is the parameter that goes into the path - */ - parameterPath1?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath2?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath3?: string; - /** - * This is the parameter that goes into the request query params - */ - parameterQuery: (string) | null; - /** - * This is the parameter that goes into the body - */ - requestBody: (ModelWithString) | null; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - page?: number; - /** - * This is a required parameter - */ - requestBody: ModelWithOneOfEnum; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is a required parameter - */ - parameter: Pageable; - /** - * This is an optional parameter - */ - requestBody?: { - offset?: (number) | null; - }; -}; - -export type PostCallWithOptionalParamResponse = (number | void); - -export type PostApiRequestBodyData = { - /** - * A reusable request body - */ - foo?: ModelWithString; - /** - * This is a reusable parameter - */ - parameter?: string; -}; - -export type CallWithResponseResponse = (_import); - -export type CallWithDuplicateResponsesResponse = ((ModelWithBoolean & ModelWithInteger) | ModelWithString); - -export type CallWithResponsesResponse = ({ - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; -} | ModelThatExtends | ModelThatExtendsExtends); - -export type ApiVVersionODataControllerCountResponse = (Model_From_Zendesk); - -export type TypesData = { - /** - * This is a number parameter - */ - id?: number; - /** - * This is an array parameter - */ - parameterArray: Array<(string)> | null; - /** - * This is a boolean parameter - */ - parameterBoolean: (boolean) | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: ('Success' | 'Warning' | 'Error') | null; - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is a string parameter - */ - parameterString: (string) | null; - /** - * This is tuple parameter - */ - parameterTuple: [ - number, - number, - number, - number - ]; -}; - -export type TypesResponse = (number | string | boolean | { - [key: string]: unknown; -}); - -export type UploadFileData = { - formData: (Blob | File); -}; - -export type UploadFileResponse = (boolean); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/ApiClient.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/ApiClient.ts deleted file mode 100644 index 6b14fbb1a..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client_transform/ApiClient.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { BaseHttpRequest } from './core/BaseHttpRequest'; -import type { OpenAPIConfig } from './core/OpenAPI'; -import { Interceptors } from './core/OpenAPI'; -import { FetchHttpRequest } from './core/FetchHttpRequest'; - -import { DefaultService } from './sdk.gen'; - -type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest; - -export class ApiClient { - - public readonly default: DefaultService; - - public readonly request: BaseHttpRequest; - - constructor(config?: Partial, HttpRequest: HttpRequestConstructor = FetchHttpRequest) { - this.request = new HttpRequest({ - BASE: config?.BASE ?? 'http://localhost:3000/base', - VERSION: config?.VERSION ?? '1.0', - WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false, - CREDENTIALS: config?.CREDENTIALS ?? 'include', - TOKEN: config?.TOKEN, - USERNAME: config?.USERNAME, - PASSWORD: config?.PASSWORD, - HEADERS: config?.HEADERS, - ENCODE_PATH: config?.ENCODE_PATH, - interceptors: { - request: config?.interceptors?.request ?? new Interceptors(), - response: config?.interceptors?.response ?? new Interceptors(), - }, - }); - - this.default = new DefaultService(this.request); - } -} diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiError.ts deleted file mode 100644 index 36675d288..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiError.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: unknown; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiRequestOptions.ts deleted file mode 100644 index 939a0aa4c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiRequestOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type ApiRequestOptions = { - readonly body?: any; - readonly cookies?: Record; - readonly errors?: Record; - readonly formData?: Record | any[] | Blob | File; - readonly headers?: Record; - readonly mediaType?: string; - readonly method: - | 'DELETE' - | 'GET' - | 'HEAD' - | 'OPTIONS' - | 'PATCH' - | 'POST' - | 'PUT'; - readonly path?: Record; - readonly query?: Record; - readonly responseHeader?: string; - readonly responseTransformer?: (data: unknown) => Promise; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiResult.ts deleted file mode 100644 index 4c58e3913..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/ApiResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ApiResult = { - readonly body: TData; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/BaseHttpRequest.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/BaseHttpRequest.ts deleted file mode 100644 index ee28b8164..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/BaseHttpRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { CancelablePromise } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; - -export abstract class BaseHttpRequest { - - constructor(public readonly config: OpenAPIConfig) {} - - public abstract request(options: ApiRequestOptions): CancelablePromise; -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/CancelablePromise.ts deleted file mode 100644 index ccc082e8f..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/CancelablePromise.ts +++ /dev/null @@ -1,126 +0,0 @@ -export class CancelError extends Error { - constructor(message: string) { - super(message); - this.name = 'CancelError'; - } - - public get isCancelled(): boolean { - return true; - } -} - -export interface OnCancel { - readonly isResolved: boolean; - readonly isRejected: boolean; - readonly isCancelled: boolean; - - (cancelHandler: () => void): void; -} - -export class CancelablePromise implements Promise { - private _isResolved: boolean; - private _isRejected: boolean; - private _isCancelled: boolean; - readonly cancelHandlers: (() => void)[]; - readonly promise: Promise; - private _resolve?: (value: T | PromiseLike) => void; - private _reject?: (reason?: unknown) => void; - - constructor( - executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: unknown) => void, - onCancel: OnCancel - ) => void - ) { - this._isResolved = false; - this._isRejected = false; - this._isCancelled = false; - this.cancelHandlers = []; - this.promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - - const onResolve = (value: T | PromiseLike): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isResolved = true; - if (this._resolve) this._resolve(value); - }; - - const onReject = (reason?: unknown): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isRejected = true; - if (this._reject) this._reject(reason); - }; - - const onCancel = (cancelHandler: () => void): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this.cancelHandlers.push(cancelHandler); - }; - - Object.defineProperty(onCancel, 'isResolved', { - get: (): boolean => this._isResolved, - }); - - Object.defineProperty(onCancel, 'isRejected', { - get: (): boolean => this._isRejected, - }); - - Object.defineProperty(onCancel, 'isCancelled', { - get: (): boolean => this._isCancelled, - }); - - return executor(onResolve, onReject, onCancel as OnCancel); - }); - } - - get [Symbol.toStringTag]() { - return "Cancellable Promise"; - } - - public then( - onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null - ): Promise { - return this.promise.then(onFulfilled, onRejected); - } - - public catch( - onRejected?: ((reason: unknown) => TResult | PromiseLike) | null - ): Promise { - return this.promise.catch(onRejected); - } - - public finally(onFinally?: (() => void) | null): Promise { - return this.promise.finally(onFinally); - } - - public cancel(): void { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isCancelled = true; - if (this.cancelHandlers.length) { - try { - for (const cancelHandler of this.cancelHandlers) { - cancelHandler(); - } - } catch (error) { - console.warn('Cancellation threw an error', error); - return; - } - } - this.cancelHandlers.length = 0; - if (this._reject) this._reject(new CancelError('Request aborted')); - } - - public get isCancelled(): boolean { - return this._isCancelled; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/FetchHttpRequest.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/FetchHttpRequest.ts deleted file mode 100644 index e7c4bd5a9..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/FetchHttpRequest.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import { BaseHttpRequest } from './BaseHttpRequest'; -import type { CancelablePromise } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; -import { request as __request } from './request'; - -export class FetchHttpRequest extends BaseHttpRequest { - - constructor(config: OpenAPIConfig) { - super(config); - } - - /** - * Request method - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ - public override request(options: ApiRequestOptions): CancelablePromise { - return __request(this.config, options); - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/OpenAPI.ts deleted file mode 100644 index 144e25744..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/OpenAPI.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; - -type Headers = Record; -type Middleware = (value: T) => T | Promise; -type Resolver = (options: ApiRequestOptions) => Promise; - -export class Interceptors { - _fns: Middleware[]; - - constructor() { - this._fns = []; - } - - eject(fn: Middleware): void { - const index = this._fns.indexOf(fn); - if (index !== -1) { - this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; - } - } - - use(fn: Middleware): void { - this._fns = [...this._fns, fn]; - } -} - -export type OpenAPIConfig = { - BASE: string; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - ENCODE_PATH?: ((path: string) => string) | undefined; - HEADERS?: Headers | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - VERSION: string; - WITH_CREDENTIALS: boolean; - interceptors: { - request: Interceptors; - response: Interceptors; - }; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: 'http://localhost:3000/base', - CREDENTIALS: 'include', - ENCODE_PATH: undefined, - HEADERS: undefined, - PASSWORD: undefined, - TOKEN: undefined, - USERNAME: undefined, - VERSION: '1.0', - WITH_CREDENTIALS: false, - interceptors: { - request: new Interceptors(), - response: new Interceptors(), - }, -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/core/request.ts deleted file mode 100644 index 5458a2899..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client_transform/core/request.ts +++ /dev/null @@ -1,350 +0,0 @@ -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import { CancelablePromise } from './CancelablePromise'; -import type { OnCancel } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const isString = (value: unknown): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: any): value is Blob => { - return value instanceof Blob; -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const encodePair = (key: string, value: unknown) => { - if (value === undefined || value === null) { - return; - } - - if (value instanceof Date) { - append(key, value.toISOString()); - } else if (Array.isArray(value)) { - value.forEach(v => encodePair(key, v)); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); - } else { - append(key, value); - } - }; - - Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - - return qs.length ? `?${qs.join('&')}` : ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = config.BASE + path; - return options.query ? url + getQueryString(options.query) : url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([, value]) => value !== undefined && value !== null) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { - const [token, username, password, additionalHeaders] = await Promise.all([ - // @ts-ignore - resolve(options, config.TOKEN), - // @ts-ignore - resolve(options, config.USERNAME), - // @ts-ignore - resolve(options, config.PASSWORD), - // @ts-ignore - resolve(options, config.HEADERS), - ]); - - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - }) - .filter(([, value]) => value !== undefined && value !== null) - .reduce((headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), {} as Record); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return new Headers(headers); -}; - -export const getRequestBody = (options: ApiRequestOptions): unknown => { - if (options.body !== undefined) { - if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { - return JSON.stringify(options.body); - } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; -}; - -export const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: any, - formData: FormData | undefined, - headers: Headers, - onCancel: OnCancel -): Promise => { - const controller = new AbortController(); - - let request: RequestInit = { - headers, - body: body ?? formData, - method: options.method, - signal: controller.signal, - }; - - if (config.WITH_CREDENTIALS) { - request.credentials = config.CREDENTIALS; - } - - for (const fn of config.interceptors.request._fns) { - request = await fn(request); - } - - onCancel(() => controller.abort()); - - return await fetch(url, request); -}; - -export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { - if (responseHeader) { - const content = response.headers.get(responseHeader); - if (isString(content)) { - return content; - } - } - return undefined; -}; - -export const getResponseBody = async (response: Response): Promise => { - if (response.status !== 204) { - try { - const contentType = response.headers.get('Content-Type'); - if (contentType) { - const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; - if (contentType.includes('application/json') || contentType.includes('+json')) { - return await response.json(); - } else if (binaryTypes.some(type => contentType.includes(type))) { - return await response.blob(); - } else if (contentType.includes('multipart/form-data')) { - return await response.formData(); - } else if (contentType.includes('text/')) { - return await response.text(); - } - } - } catch (error) { - console.error(error); - } - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 405: 'Method Not Allowed', - 406: 'Not Acceptable', - 407: 'Proxy Authentication Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Payload Too Large', - 414: 'URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Range Not Satisfiable', - 417: 'Expectation Failed', - 418: 'Im a teapot', - 421: 'Misdirected Request', - 422: 'Unprocessable Content', - 423: 'Locked', - 424: 'Failed Dependency', - 425: 'Too Early', - 426: 'Upgrade Required', - 428: 'Precondition Required', - 429: 'Too Many Requests', - 431: 'Request Header Fields Too Large', - 451: 'Unavailable For Legal Reasons', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported', - 506: 'Variant Also Negotiates', - 507: 'Insufficient Storage', - 508: 'Loop Detected', - 510: 'Not Extended', - 511: 'Network Authentication Required', - ...options.errors, - } - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError(options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ -export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options); - - if (!onCancel.isCancelled) { - let response = await sendRequest(config, options, url, body, formData, headers, onCancel); - - for (const fn of config.interceptors.response._fns) { - response = await fn(response); - } - - const responseBody = await getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - let transformedBody = responseBody; - if (options.responseTransformer && response.ok) { - transformedBody = await options.responseTransformer(responseBody) - } - - const result: ApiResult = { - url, - ok: response.ok, - status: response.status, - statusText: response.statusText, - body: responseHeader ?? transformedBody, - }; - - catchErrorCodes(options, result); - - resolve(result.body); - } - } catch (error) { - reject(error); - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/index.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/index.ts deleted file mode 100644 index 7e12dd663..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client_transform/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export { ApiClient } from './ApiClient'; -export { ApiError } from './core/ApiError'; -export { BaseHttpRequest } from './core/BaseHttpRequest'; -export { CancelablePromise, CancelError } from './core/CancelablePromise'; -export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/sdk.gen.ts deleted file mode 100644 index e83516e47..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client_transform/sdk.gen.ts +++ /dev/null @@ -1,81 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { CancelablePromise } from './core/CancelablePromise'; -import type { BaseHttpRequest } from './core/BaseHttpRequest'; -import { type ParentModelWithDatesResponse, type ModelWithDatesResponse, type ModelWithDatesArrayResponse, type ArrayOfDatesResponse, type DateResponse, type MultipleResponsesResponse, ParentModelWithDatesResponseTransformer, ModelWithDatesResponseTransformer, ModelWithDatesArrayResponseTransformer } from './types.gen'; - -export class DefaultService { - constructor(public readonly httpRequest: BaseHttpRequest) { } - - /** - * @returns ParentModelWithDates Success - * @returns unknown Success - * @throws ApiError - */ - public parentModelWithDates(): CancelablePromise { - return this.httpRequest.request({ - method: 'POST', - url: '/api/model-with-dates', - responseTransformer: ParentModelWithDatesResponseTransformer - }); - } - - /** - * @returns ModelWithDates Success - * @throws ApiError - */ - public modelWithDates(): CancelablePromise { - return this.httpRequest.request({ - method: 'PUT', - url: '/api/model-with-dates', - responseTransformer: ModelWithDatesResponseTransformer - }); - } - - /** - * @returns ModelWithDates Success - * @throws ApiError - */ - public modelWithDatesArray(): CancelablePromise { - return this.httpRequest.request({ - method: 'PUT', - url: '/api/model-with-dates-array', - responseTransformer: ModelWithDatesArrayResponseTransformer - }); - } - - /** - * @returns string Success - * @throws ApiError - */ - public arrayOfDates(): CancelablePromise { - return this.httpRequest.request({ - method: 'PUT', - url: '/api/array-of-dates' - }); - } - - /** - * @returns string Success - * @throws ApiError - */ - public date(): CancelablePromise { - return this.httpRequest.request({ - method: 'PUT', - url: '/api/date' - }); - } - - /** - * @returns ModelWithDates Updated - * @returns SimpleModel Created - * @throws ApiError - */ - public multipleResponses(): CancelablePromise { - return this.httpRequest.request({ - method: 'PUT', - url: '/api/multiple-responses' - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_client_transform/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_client_transform/types.gen.ts deleted file mode 100644 index 8c9227850..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_client_transform/types.gen.ts +++ /dev/null @@ -1,106 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * This is a model that contains a some dates - */ -export type ModelWithDates = { - id: number; - name: string; - readonly enabled: boolean; - readonly modified: Date; - readonly expires?: Date; -}; - -/** - * This is a model that contains a some dates and arrays - */ -export type ParentModelWithDates = { - id: number; - readonly modified?: Date; - items?: Array; - item?: ModelWithDates; - 'nullable-date'?: Array<(Date | null)>; - simpleItems?: Array; - simpleItem?: SimpleModel; - dates?: Array<(Date)>; - strings?: Array<(string)>; -}; - -/** - * This is a model that contains a some dates - */ -export type SimpleModel = { - id: number; - name: string; - readonly enabled: boolean; -}; - -export type ParentModelWithDatesResponse = (ParentModelWithDates | unknown); - -export type ModelWithDatesResponse = (ModelWithDates); - -export type ModelWithDatesArrayResponse = (Array); - -export type ArrayOfDatesResponse = (Array<(Date)>); - -export type DateResponse = (Date); - -export type MultipleResponsesResponse = (Array | Array); - -export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; - -export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; - -export type ModelWithDatesModelResponseTransformer = (data: any) => ModelWithDates; - -export const ModelWithDatesModelResponseTransformer: ModelWithDatesModelResponseTransformer = data => { - if (data?.modified) { - data.modified = new Date(data.modified); - } - if (data?.expires) { - data.expires = new Date(data.expires); - } - return data; -}; - -export const ParentModelWithDatesModelResponseTransformer: ParentModelWithDatesModelResponseTransformer = data => { - if (data?.modified) { - data.modified = new Date(data.modified); - } - if (Array.isArray(data?.items)) { - data.items.forEach(ModelWithDatesModelResponseTransformer); - } - if (data?.item) { - ModelWithDatesModelResponseTransformer(data.item); - } - if (Array.isArray(data?.['nullable-date'])) { - data['nullable-date'] = data['nullable-date'].map(item => item ? new Date(item) : item); - } - if (Array.isArray(data?.dates)) { - data.dates = data.dates.map(item => item ? new Date(item) : item); - } - return data; -}; - -export const ParentModelWithDatesResponseTransformer: ParentModelWithDatesResponseTransformer = async (data) => { - if (data) { - ParentModelWithDatesModelResponseTransformer(data); - } - return data; -}; - -export type ModelWithDatesResponseTransformer = (data: any) => Promise; - -export const ModelWithDatesResponseTransformer: ModelWithDatesResponseTransformer = async (data) => { - ModelWithDatesModelResponseTransformer(data); - return data; -}; - -export type ModelWithDatesArrayResponseTransformer = (data: any) => Promise; - -export const ModelWithDatesArrayResponseTransformer: ModelWithDatesArrayResponseTransformer = async (data) => { - if (Array.isArray(data)) { - data.forEach(ModelWithDatesModelResponseTransformer); - } - return data; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_date/index.ts b/packages/openapi-ts-tests/test/generated/v3_date/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_date/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_date/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_date/types.gen.ts deleted file mode 100644 index 19860aec8..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_date/types.gen.ts +++ /dev/null @@ -1,967 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _3e_num_1Период = 'Bird' | 'Dog'; - -/** - * Model with number-only name - */ -export type _400 = string; - -export type _default = { - name?: string; -}; - -/** - * Model with restricted keyword name - */ -export type _import = string; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: (number) | undefined; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AnyOfAnyAndNull = { - data?: (unknown | null); -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<({ - foo?: string; -} | { - bar?: string; -})>; -}; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<({ - foo?: string; -} | { - bar?: string; -})>; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array<(boolean)>; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array<(number)>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: camelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array<(string)>; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type camelCaseCommentWithBreaks = number; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - firstName: string; - lastname: string; - age: number; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: (({ - boolean?: boolean; -} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: (Array<(_3e_num_1Период | ConstValue)> | null); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(number | string)>; -}); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: ParameterSimpleParameter; -} | { - bar: NonAsciiStringæøåÆØÅöôêÊ字符串; -}) & { - baz: (number) | null; - qux: number; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(boolean)>; -}); -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: (boolean | { - [key: string]: (number); -}); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; - -export type ConstValue = "ConstValue"; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: (string); - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: (string | number | boolean) | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: (string); -}; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -export type File = { - readonly id?: string; - readonly updated_at?: Date; - readonly created_at?: Date; - mime: string; - readonly file?: string; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { - item?: boolean; - error?: (string) | null; - readonly hasError?: boolean; - data?: { - [key: string]: unknown; - }; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_String_ = { - item?: (string) | null; - error?: (string) | null; - readonly hasError?: boolean; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type Model_From_Zendesk = string; - -/** - * Circle - */ -export type ModelCircle = { - kind: 'circle'; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: 'square'; - sideLength?: number; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string; -}; - -export type ModelWithAnyOfConstantSizeArray = [ - (number | string), - (number | string), - (number | string) -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - (number & string), - (number & string) -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - ((number) | null | string), - ((number) | null | string), - ((number) | null | string) -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - (number | _import), - (number | _import) -]; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnly = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -export type ModelWithConst = { - String?: "String"; - number?: 0; - null?: null; - withType?: "Some string"; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: (string); - }; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: boolean; -}; - -/** - * This is a simple enum with strings - */ -export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - -/** - * These are the HTTP error code enums - */ -export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -export type foo_bar_baz_qux = '3.0'; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array<(string)>; - data?: (ModelWithNestedArrayEnumsData); -}; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedCompositionEnums = { - foo?: (ModelWithNestedArrayEnumsDataFoo); -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: ('Success' | 'Warning' | 'Error'); - }; - dictionaryWithEnumFromDescription?: { - [key: string]: (number); - }; - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; - arrayWithDescription?: Array<(number)>; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedProperties = { - readonly first: { - readonly second: { - readonly third: (string) | null; - } | null; - } | null; -}; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: (string) | null; - /** - * This is a simple string property - */ - nullableProp2?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: (string) | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Период - */ -export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; - -export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { - baz: (number) | null; - qux: number; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: Date; - foo: 'Quux'; -} | { - content: [ - (Date | string), - (Date | string) - ]; - foo: 'Corge'; -}; - -export type foo = 'Bar'; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPattern = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: Date; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - (number | string), - string -]; - -/** - * This is a model with one nested property - */ -export type ModelWithProperties = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: (string) | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -export type ModelWithReadOnlyAndWriteOnly = { - foo: string; - readonly bar: string; - baz: string; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReference = { - prop?: ModelWithProperties; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: (Array<(string | boolean)> | null); -}; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array<(string)>; -}; - -/** - * This is a reusable parameter - */ -export type ParameterSimpleParameter = string; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Parameter with illegal characters - */ -export type Parameterx_Foo_Bar = ModelWithString; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<({ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; -})>; -}; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple file - */ -export type SimpleFile = (Blob | File); - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = (string) | null; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiError.ts deleted file mode 100644 index 36675d288..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiError.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: unknown; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiRequestOptions.ts deleted file mode 100644 index 939a0aa4c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiRequestOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type ApiRequestOptions = { - readonly body?: any; - readonly cookies?: Record; - readonly errors?: Record; - readonly formData?: Record | any[] | Blob | File; - readonly headers?: Record; - readonly mediaType?: string; - readonly method: - | 'DELETE' - | 'GET' - | 'HEAD' - | 'OPTIONS' - | 'PATCH' - | 'POST' - | 'PUT'; - readonly path?: Record; - readonly query?: Record; - readonly responseHeader?: string; - readonly responseTransformer?: (data: unknown) => Promise; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiResult.ts deleted file mode 100644 index 4c58e3913..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/ApiResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ApiResult = { - readonly body: TData; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/CancelablePromise.ts deleted file mode 100644 index ccc082e8f..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/CancelablePromise.ts +++ /dev/null @@ -1,126 +0,0 @@ -export class CancelError extends Error { - constructor(message: string) { - super(message); - this.name = 'CancelError'; - } - - public get isCancelled(): boolean { - return true; - } -} - -export interface OnCancel { - readonly isResolved: boolean; - readonly isRejected: boolean; - readonly isCancelled: boolean; - - (cancelHandler: () => void): void; -} - -export class CancelablePromise implements Promise { - private _isResolved: boolean; - private _isRejected: boolean; - private _isCancelled: boolean; - readonly cancelHandlers: (() => void)[]; - readonly promise: Promise; - private _resolve?: (value: T | PromiseLike) => void; - private _reject?: (reason?: unknown) => void; - - constructor( - executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: unknown) => void, - onCancel: OnCancel - ) => void - ) { - this._isResolved = false; - this._isRejected = false; - this._isCancelled = false; - this.cancelHandlers = []; - this.promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - - const onResolve = (value: T | PromiseLike): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isResolved = true; - if (this._resolve) this._resolve(value); - }; - - const onReject = (reason?: unknown): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isRejected = true; - if (this._reject) this._reject(reason); - }; - - const onCancel = (cancelHandler: () => void): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this.cancelHandlers.push(cancelHandler); - }; - - Object.defineProperty(onCancel, 'isResolved', { - get: (): boolean => this._isResolved, - }); - - Object.defineProperty(onCancel, 'isRejected', { - get: (): boolean => this._isRejected, - }); - - Object.defineProperty(onCancel, 'isCancelled', { - get: (): boolean => this._isCancelled, - }); - - return executor(onResolve, onReject, onCancel as OnCancel); - }); - } - - get [Symbol.toStringTag]() { - return "Cancellable Promise"; - } - - public then( - onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null - ): Promise { - return this.promise.then(onFulfilled, onRejected); - } - - public catch( - onRejected?: ((reason: unknown) => TResult | PromiseLike) | null - ): Promise { - return this.promise.catch(onRejected); - } - - public finally(onFinally?: (() => void) | null): Promise { - return this.promise.finally(onFinally); - } - - public cancel(): void { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isCancelled = true; - if (this.cancelHandlers.length) { - try { - for (const cancelHandler of this.cancelHandlers) { - cancelHandler(); - } - } catch (error) { - console.warn('Cancellation threw an error', error); - return; - } - } - this.cancelHandlers.length = 0; - if (this._reject) this._reject(new CancelError('Request aborted')); - } - - public get isCancelled(): boolean { - return this._isCancelled; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/OpenAPI.ts deleted file mode 100644 index 144e25744..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/OpenAPI.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; - -type Headers = Record; -type Middleware = (value: T) => T | Promise; -type Resolver = (options: ApiRequestOptions) => Promise; - -export class Interceptors { - _fns: Middleware[]; - - constructor() { - this._fns = []; - } - - eject(fn: Middleware): void { - const index = this._fns.indexOf(fn); - if (index !== -1) { - this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; - } - } - - use(fn: Middleware): void { - this._fns = [...this._fns, fn]; - } -} - -export type OpenAPIConfig = { - BASE: string; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - ENCODE_PATH?: ((path: string) => string) | undefined; - HEADERS?: Headers | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - VERSION: string; - WITH_CREDENTIALS: boolean; - interceptors: { - request: Interceptors; - response: Interceptors; - }; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: 'http://localhost:3000/base', - CREDENTIALS: 'include', - ENCODE_PATH: undefined, - HEADERS: undefined, - PASSWORD: undefined, - TOKEN: undefined, - USERNAME: undefined, - VERSION: '1.0', - WITH_CREDENTIALS: false, - interceptors: { - request: new Interceptors(), - response: new Interceptors(), - }, -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/request.ts deleted file mode 100644 index 5458a2899..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/core/request.ts +++ /dev/null @@ -1,350 +0,0 @@ -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import { CancelablePromise } from './CancelablePromise'; -import type { OnCancel } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const isString = (value: unknown): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: any): value is Blob => { - return value instanceof Blob; -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const encodePair = (key: string, value: unknown) => { - if (value === undefined || value === null) { - return; - } - - if (value instanceof Date) { - append(key, value.toISOString()); - } else if (Array.isArray(value)) { - value.forEach(v => encodePair(key, v)); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); - } else { - append(key, value); - } - }; - - Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - - return qs.length ? `?${qs.join('&')}` : ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = config.BASE + path; - return options.query ? url + getQueryString(options.query) : url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([, value]) => value !== undefined && value !== null) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { - const [token, username, password, additionalHeaders] = await Promise.all([ - // @ts-ignore - resolve(options, config.TOKEN), - // @ts-ignore - resolve(options, config.USERNAME), - // @ts-ignore - resolve(options, config.PASSWORD), - // @ts-ignore - resolve(options, config.HEADERS), - ]); - - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - }) - .filter(([, value]) => value !== undefined && value !== null) - .reduce((headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), {} as Record); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return new Headers(headers); -}; - -export const getRequestBody = (options: ApiRequestOptions): unknown => { - if (options.body !== undefined) { - if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { - return JSON.stringify(options.body); - } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; -}; - -export const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: any, - formData: FormData | undefined, - headers: Headers, - onCancel: OnCancel -): Promise => { - const controller = new AbortController(); - - let request: RequestInit = { - headers, - body: body ?? formData, - method: options.method, - signal: controller.signal, - }; - - if (config.WITH_CREDENTIALS) { - request.credentials = config.CREDENTIALS; - } - - for (const fn of config.interceptors.request._fns) { - request = await fn(request); - } - - onCancel(() => controller.abort()); - - return await fetch(url, request); -}; - -export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { - if (responseHeader) { - const content = response.headers.get(responseHeader); - if (isString(content)) { - return content; - } - } - return undefined; -}; - -export const getResponseBody = async (response: Response): Promise => { - if (response.status !== 204) { - try { - const contentType = response.headers.get('Content-Type'); - if (contentType) { - const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; - if (contentType.includes('application/json') || contentType.includes('+json')) { - return await response.json(); - } else if (binaryTypes.some(type => contentType.includes(type))) { - return await response.blob(); - } else if (contentType.includes('multipart/form-data')) { - return await response.formData(); - } else if (contentType.includes('text/')) { - return await response.text(); - } - } - } catch (error) { - console.error(error); - } - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 405: 'Method Not Allowed', - 406: 'Not Acceptable', - 407: 'Proxy Authentication Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Payload Too Large', - 414: 'URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Range Not Satisfiable', - 417: 'Expectation Failed', - 418: 'Im a teapot', - 421: 'Misdirected Request', - 422: 'Unprocessable Content', - 423: 'Locked', - 424: 'Failed Dependency', - 425: 'Too Early', - 426: 'Upgrade Required', - 428: 'Precondition Required', - 429: 'Too Many Requests', - 431: 'Request Header Fields Too Large', - 451: 'Unavailable For Legal Reasons', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported', - 506: 'Variant Also Negotiates', - 507: 'Insufficient Storage', - 508: 'Loop Detected', - 510: 'Not Extended', - 511: 'Network Authentication Required', - ...options.errors, - } - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError(options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ -export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options); - - if (!onCancel.isCancelled) { - let response = await sendRequest(config, options, url, body, formData, headers, onCancel); - - for (const fn of config.interceptors.response._fns) { - response = await fn(response); - } - - const responseBody = await getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - let transformedBody = responseBody; - if (options.responseTransformer && response.ok) { - transformedBody = await options.responseTransformer(responseBody) - } - - const result: ApiResult = { - url, - ok: response.ok, - status: response.status, - statusText: response.statusText, - body: responseHeader ?? transformedBody, - }; - - catchErrorCodes(options, result); - - resolve(result.body); - } - } catch (error) { - reject(error); - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/index.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/index.ts deleted file mode 100644 index 50a1dd734..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export { ApiError } from './core/ApiError'; -export { CancelablePromise, CancelError } from './core/CancelablePromise'; -export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/sdk.gen.ts deleted file mode 100644 index f62288bcf..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/sdk.gen.ts +++ /dev/null @@ -1,913 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { CancelablePromise } from './core/CancelablePromise'; -import { OpenAPI } from './core/OpenAPI'; -import { request as __request } from './core/request'; -import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; - -export class CollectionFormatService { - /** - * @param data The data for the request. - * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) - * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) - * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) - * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) - * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) - * @throws ApiError - */ - public static collectionFormat(data: CollectionFormatData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/collectionFormat', - query: { - parameterArrayCSV: data.parameterArrayCsv, - parameterArraySSV: data.parameterArraySsv, - parameterArrayTSV: data.parameterArrayTsv, - parameterArrayPipes: data.parameterArrayPipes, - parameterArrayMulti: data.parameterArrayMulti - } - }); - } - -} - -export class ComplexService { - /** - * @param data The data for the request. - * @param data.parameterObject Parameter containing object - * @param data.parameterReference Parameter containing reference - * @returns ModelWithString Successful response - * @throws ApiError - */ - public static complexTypes(data: ComplexTypesData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/complex', - query: { - parameterObject: data.parameterObject, - parameterReference: data.parameterReference - }, - errors: { - 400: '400 `server` error', - 500: '500 server error' - } - }); - } - - /** - * @param data The data for the request. - * @param data.id - * @param data.requestBody - * @returns ModelWithString Success - * @throws ApiError - */ - public static complexParams(data: ComplexParamsData): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/complex/{id}', - path: { - id: data.id - }, - body: data.requestBody, - mediaType: 'application/json-patch+json' - }); - } - -} - -export class DefaultService { - /** - * @throws ApiError - */ - public static export(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public static patchApiNoTag(): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @param data The data for the request. - * @param data.requestBody - * @returns Model_From_Zendesk Success - * @returns ModelWithReadOnlyAndWriteOnly Default success response - * @throws ApiError - */ - public static import(data: ImportData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/no+tag', - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public static fooWow(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @param data The data for the request. - * @param data.fooParam foo in method - * @returns number Response is a simple number - * @throws ApiError - */ - public static getApiSimpleOperation(data: GetApiSimpleOperationData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple:operation', - path: { - foo_param: data.fooParam - }, - errors: { - default: 'Default error response' - } - }); - } - -} - -export class DefaultsService { - /** - * @param data The data for the request. - * @param data.parameterString This is a simple string with default value - * @param data.parameterNumber This is a simple number with default value - * @param data.parameterBoolean This is a simple boolean with default value - * @param data.parameterEnum This is a simple enum with default value - * @param data.parameterModel This is a simple model with default value - * @throws ApiError - */ - public static callWithDefaultParameters(data: CallWithDefaultParametersData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterString This is a simple string that is optional with default value - * @param data.parameterNumber This is a simple number that is optional with default value - * @param data.parameterBoolean This is a simple boolean that is optional with default value - * @param data.parameterEnum This is a simple enum that is optional with default value - * @param data.parameterModel This is a simple model that is optional with default value - * @throws ApiError - */ - public static callWithDefaultOptionalParameters(data: CallWithDefaultOptionalParametersData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterStringWithNoDefault This is a string with no default - * @param data.parameterOptionalStringWithDefault This is a optional string with default - * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default - * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default - * @param data.parameterStringWithDefault This is a string with default - * @param data.parameterStringWithEmptyDefault This is a string with empty default - * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default - * @param data.parameterStringNullableWithDefault This is a string that can be null with default - * @throws ApiError - */ - public static callToTestOrderOfParams(data: CallToTestOrderOfParamsData): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/defaults', - query: { - parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, - parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, - parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, - parameterStringWithDefault: data.parameterStringWithDefault, - parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, - parameterStringWithNoDefault: data.parameterStringWithNoDefault, - parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, - parameterStringNullableWithDefault: data.parameterStringNullableWithDefault - } - }); - } - -} - -export class DeprecatedService { - /** - * @deprecated - * @param data The data for the request. - * @param data.parameter This parameter is deprecated - * @throws ApiError - */ - public static deprecatedCall(data: DeprecatedCallData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/deprecated', - headers: { - parameter: data.parameter - } - }); - } - -} - -export class DescriptionsService { - /** - * @param data The data for the request. - * @param data.parameterWithBreaks Testing multiline comments in string: First line - * Second line - * - * Fourth line - * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work - * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work - * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work - * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work - * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work - * @throws ApiError - */ - public static callWithDescriptions(data: CallWithDescriptionsData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/descriptions/', - query: { - parameterWithBreaks: data.parameterWithBreaks, - parameterWithBackticks: data.parameterWithBackticks, - parameterWithSlashes: data.parameterWithSlashes, - parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders, - parameterWithQuotes: data.parameterWithQuotes, - parameterWithReservedCharacters: data.parameterWithReservedCharacters - } - }); - } - -} - -export class DuplicateService { - /** - * @throws ApiError - */ - public static duplicateName(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public static duplicateName1(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public static duplicateName2(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public static duplicateName3(): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/duplicate' - }); - } - -} - -export class ErrorService { - /** - * @param data The data for the request. - * @param data.status Status code to return - * @returns unknown Custom message: Successful response - * @throws ApiError - */ - public static testErrorCode(data: TestErrorCodeData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/error', - query: { - status: data.status - }, - errors: { - 500: 'Custom message: Internal Server Error', - 501: 'Custom message: Not Implemented', - 502: 'Custom message: Bad Gateway', - 503: 'Custom message: Service Unavailable' - } - }); - } - -} - -export class FileResponseService { - /** - * @param data The data for the request. - * @param data.id - * @returns binary Success - * @throws ApiError - */ - public static fileResponse(data: FileResponseData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/file/{id}', - path: { - id: data.id - } - }); - } - -} - -export class FormDataService { - /** - * @param data The data for the request. - * @param data.parameter This is a reusable parameter - * @param data.formData A reusable request body - * @throws ApiError - */ - public static postApiFormData(data: PostApiFormDataData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/formData/', - query: { - parameter: data.parameter - }, - formData: data.formData, - mediaType: 'multipart/form-data' - }); - } - -} - -export class HeaderService { - /** - * @returns string Successful response - * @throws ApiError - */ - public static callWithResultFromHeader(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/header', - responseHeader: 'operation-location', - errors: { - 400: '400 server error', - 500: '500 server error' - } - }); - } - -} - -export class MultipartService { - /** - * @param data The data for the request. - * @param data.formData - * @throws ApiError - */ - public static multipartRequest(data: MultipartRequestData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/multipart', - formData: data.formData, - mediaType: 'multipart/form-data' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public static multipartResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multipart' - }); - } - -} - -export class MultipleTags1Service { - /** - * @returns _400 - * @throws ApiError - */ - public static dummyA(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/a' - }); - } - - /** - * @returns void Success - * @throws ApiError - */ - public static dummyB(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class MultipleTags2Service { - /** - * @returns _400 - * @throws ApiError - */ - public static dummyA(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/a' - }); - } - - /** - * @returns void Success - * @throws ApiError - */ - public static dummyB(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class MultipleTags3Service { - /** - * @returns void Success - * @throws ApiError - */ - public static dummyB(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class NoContentService { - /** - * @returns void Success - * @throws ApiError - */ - public static callWithNoContentResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/no-content' - }); - } - - /** - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public static callWithResponseAndNoContentResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/response-and-no-content' - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - /** - * @param data The data for the request. - * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param - * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response - * @throws ApiError - */ - public static nonAsciiæøåÆøÅöôêÊ字符串(data: NonAsciiæøåÆøÅöôêÊ字符串Data): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - query: { - 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ - } - }); - } - - /** - * Login User - * @param data The data for the request. - * @param data.formData - * @throws ApiError - */ - public static putWithFormUrlEncoded(data: PutWithFormUrlEncodedData): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - formData: data.formData, - mediaType: 'application/x-www-form-urlencoded' - }); - } - -} - -export class ParametersService { - /** - * @param data The data for the request. - * @param data.fooParam foo in method - * @param data.barParam bar in method - * @param data.xFooBar Parameter with illegal characters - * @throws ApiError - */ - public static deleteFoo(data: DeleteFooData3): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - path: { - foo_param: data.fooParam, - BarParam: data.barParam - }, - headers: { - 'x-Foo-Bar': data.xFooBar - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the header - * @param data.fooAllOfEnum - * @param data.cursor This is the parameter that goes into the query params - * @param data.parameterCookie This is the parameter that goes into the cookie - * @param data.parameterPath This is the parameter that goes into the path - * @param data.requestBody This is the parameter that goes into the body - * @param data.fooRefEnum - * @throws ApiError - */ - public static callWithParameters(data: CallWithParametersData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/{parameterPath}', - path: { - parameterPath: data.parameterPath - }, - cookies: { - parameterCookie: data.parameterCookie - }, - headers: { - parameterHeader: data.parameterHeader - }, - query: { - foo_ref_enum: data.fooRefEnum, - foo_all_of_enum: data.fooAllOfEnum, - cursor: data.cursor - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the request header - * @param data.parameterQuery This is the parameter that goes into the request query params - * @param data.parameterCookie This is the parameter that goes into the cookie - * @param data.requestBody This is the parameter that goes into the body - * @param data.parameterPath1 This is the parameter that goes into the path - * @param data.parameterPath2 This is the parameter that goes into the path - * @param data.parameterPath3 This is the parameter that goes into the path - * @param data._default This is the parameter with a reserved keyword - * @throws ApiError - */ - public static callWithWeirdParameterNames(data: CallWithWeirdParameterNamesData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - path: { - 'parameter.path.1': data.parameterPath1, - 'parameter-path-2': data.parameterPath2, - 'PARAMETER-PATH-3': data.parameterPath3 - }, - cookies: { - 'PARAMETER-COOKIE': data.parameterCookie - }, - headers: { - 'parameter.header': data.parameterHeader - }, - query: { - default: data._default, - 'parameter-query': data.parameterQuery - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.requestBody This is a required parameter - * @param data.page This is an optional parameter - * @throws ApiError - */ - public static getCallWithOptionalParam(data: GetCallWithOptionalParamData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/parameters/', - query: { - page: data.page - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.parameter This is a required parameter - * @param data.requestBody This is an optional parameter - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public static postCallWithOptionalParam(data: PostCallWithOptionalParamData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/', - query: { - parameter: data.parameter - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - -} - -export class RequestBodyService { - /** - * @param data The data for the request. - * @param data.parameter This is a reusable parameter - * @param data.foo A reusable request body - * @throws ApiError - */ - public static postApiRequestBody(data: PostApiRequestBodyData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/requestBody/', - query: { - parameter: data.parameter - }, - body: data.foo, - mediaType: 'application/json' - }); - } - -} - -export class ResponseService { - /** - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public static callWithResponseAndNoContentResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/response-and-no-content' - }); - } - - /** - * @returns import - * @throws ApiError - */ - public static callWithResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/response' - }); - } - - /** - * @returns unknown Message for 200 response - * @returns ModelWithString Message for 201 response - * @returns ModelWithString Message for 202 response - * @throws ApiError - */ - public static callWithDuplicateResponses(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/response', - errors: { - 500: 'Message for 500 error', - 501: 'Message for 501 error', - 502: 'Message for 502 error', - '4XX': 'Message for 4XX errors', - default: 'Default error response' - } - }); - } - - /** - * @returns unknown Message for 200 response - * @returns ModelThatExtends Message for 201 response - * @returns ModelThatExtendsExtends Message for 202 response - * @throws ApiError - */ - public static callWithResponses(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/response', - errors: { - 500: 'Message for 500 error', - 501: 'Message for 501 error', - 502: 'Message for 502 error', - default: 'Message for default response' - } - }); - } - -} - -export class SimpleService { - /** - * @returns Model_From_Zendesk Success - * @throws ApiError - */ - public static apiVVersionODataControllerCount(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple/$count' - }); - } - - /** - * @throws ApiError - */ - public static getCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static putCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static postCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static deleteCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static optionsCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'OPTIONS', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static headCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'HEAD', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static patchCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v{api-version}/simple' - }); - } - -} - -export class TypesService { - /** - * @param data The data for the request. - * @param data.parameterArray This is an array parameter - * @param data.parameterDictionary This is a dictionary parameter - * @param data.parameterEnum This is an enum parameter - * @param data.parameterTuple This is tuple parameter - * @param data.parameterNumber This is a number parameter - * @param data.parameterString This is a string parameter - * @param data.parameterBoolean This is a boolean parameter - * @param data.parameterObject This is an object parameter - * @param data.id This is a number parameter - * @returns number Response is a simple number - * @returns string Response is a simple string - * @returns boolean Response is a simple boolean - * @returns unknown Response is a simple object - * @throws ApiError - */ - public static types(data: TypesData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/types', - path: { - id: data.id - }, - query: { - parameterNumber: data.parameterNumber, - parameterString: data.parameterString, - parameterBoolean: data.parameterBoolean, - parameterObject: data.parameterObject, - parameterArray: data.parameterArray, - parameterDictionary: data.parameterDictionary, - parameterEnum: data.parameterEnum, - parameterTuple: data.parameterTuple - } - }); - } - -} - -export class UploadService { - /** - * @param data The data for the request. - * @param data.formData - * @returns boolean - * @throws ApiError - */ - public static uploadFile(data: UploadFileData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/upload', - formData: data.formData, - mediaType: 'application/x-www-form-urlencoded' - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript/types.gen.ts deleted file mode 100644 index 1cdfa295c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_enums_typescript/types.gen.ts +++ /dev/null @@ -1,1493 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export enum _3e_num_1Период { - BIRD = 'Bird', - DOG = 'Dog' -} - -/** - * Model with number-only name - */ -export type _400 = string; - -export type _default = { - name?: string; -}; - -/** - * Model with restricted keyword name - */ -export type _import = string; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: (number) | undefined; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AnyOfAnyAndNull = { - data?: (unknown | null); -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<({ - foo?: string; -} | { - bar?: string; -})>; -}; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<({ - foo?: string; -} | { - bar?: string; -})>; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array<(boolean)>; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array<(number)>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: camelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array<(string)>; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type camelCaseCommentWithBreaks = number; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - firstName: string; - lastname: string; - age: number; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: (({ - boolean?: boolean; -} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: (Array<(_3e_num_1Период | ConstValue)> | null); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(number | string)>; -}); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: ParameterSimpleParameter; -} | { - bar: NonAsciiStringæøåÆØÅöôêÊ字符串; -}) & { - baz: (number) | null; - qux: number; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(boolean)>; -}); -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: (boolean | { - [key: string]: (number); -}); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; - -export type ConstValue = "ConstValue"; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: (string); - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: (string | number | boolean) | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: (string); -}; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export enum EnumWithExtensions { - /** - * Used when the status of something is successful - */ - CUSTOM_SUCCESS = 200, - /** - * Used when the status of something has a warning - */ - CUSTOM_WARNING = 400, - /** - * Used when the status of something has an error - */ - CUSTOM_ERROR = 500 -} - -/** - * This is a simple enum with numbers - */ -export enum EnumWithNumbers { - '_1' = 1, - '_2' = 2, - '_3' = 3, - '_1.1' = 1.1, - '_1.2' = 1.2, - '_1.3' = 1.3, - '_100' = 100, - '_200' = 200, - '_300' = 300, - '_-100' = -100, - '_-200' = -200, - '_-300' = -300, - '_-1.1' = -1.1, - '_-1.2' = -1.2, - '_-1.3' = -1.3 -} - -export enum EnumWithReplacedCharacters { - _SINGLE_QUOTE_ = "'Single Quote'", - _DOUBLE_QUOTES_ = '"Double Quotes"', - ØÆÅÔÖ_ØÆÅÔÖ字符串 = 'øæåôöØÆÅÔÖ字符串', - '_3.1' = 3.1, - EMPTY_STRING = '' -} - -/** - * This is a simple enum with strings - */ -export enum EnumWithStrings { - SUCCESS = 'Success', - WARNING = 'Warning', - ERROR = 'Error', - _SINGLE_QUOTE_ = "'Single Quote'", - _DOUBLE_QUOTES_ = '"Double Quotes"', - NON_ASCII__ØÆÅÔÖ_ØÆÅÔÖ字符串 = 'Non-ascii: øæåôöØÆÅÔÖ字符串' -} - -export enum EnumWithXEnumNames { - zero = 0, - one = 1, - two = 2 -} - -export type File = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { - item?: boolean; - error?: (string) | null; - readonly hasError?: boolean; - data?: { - [key: string]: unknown; - }; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_String_ = { - item?: (string) | null; - error?: (string) | null; - readonly hasError?: boolean; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type Model_From_Zendesk = string; - -/** - * Circle - */ -export type ModelCircle = { - kind: 'circle'; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: 'square'; - sideLength?: number; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string; -}; - -export type ModelWithAnyOfConstantSizeArray = [ - (number | string), - (number | string), - (number | string) -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - (number & string), - (number & string) -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - ((number) | null | string), - ((number) | null | string), - ((number) | null | string) -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - (number | _import), - (number | _import) -]; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnly = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -export type ModelWithConst = { - String?: "String"; - number?: 0; - null?: null; - withType?: "Some string"; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: (string); - }; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: boolean; -}; - -/** - * This is a simple enum with strings - */ -export enum foo_bar_enum { - SUCCESS = 'Success', - WARNING = 'Warning', - ERROR = 'Error', - ØÆÅ字符串 = 'ØÆÅ字符串' -} - -/** - * These are the HTTP error code enums - */ -export enum statusCode { - _100 = '100', - _200_FOO = '200 FOO', - _300_FOO_BAR = '300 FOO_BAR', - _400_FOO_BAR = '400 foo-bar', - _500_FOO_BAR = '500 foo.bar', - _600_FOO_BAR = '600 foo&bar' -} - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -export enum foo_bar_baz_qux { - _3_0 = '3.0' -} - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array<(string)>; - data?: (ModelWithNestedArrayEnumsData); -}; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export enum ModelWithNestedArrayEnumsDataBar { - BAZ = 'baz', - QUX = 'qux' -} - -export enum ModelWithNestedArrayEnumsDataFoo { - FOO = 'foo', - BAR = 'bar' -} - -export type ModelWithNestedCompositionEnums = { - foo?: (ModelWithNestedArrayEnumsDataFoo); -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: ('Success' | 'Warning' | 'Error'); - }; - dictionaryWithEnumFromDescription?: { - [key: string]: (number); - }; - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; - arrayWithDescription?: Array<(number)>; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedProperties = { - readonly first: { - readonly second: { - readonly third: (string) | null; - } | null; - } | null; -}; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: (string) | null; - /** - * This is a simple string property - */ - nullableProp2?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: (string) | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Период - */ -export enum value { - '_-10' = -10, - '_-1' = -1, - '_0' = 0, - '_1' = 1, - '_3' = 3, - '_6' = 6, - '_12' = 12 -} - -export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { - baz: (number) | null; - qux: number; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - (string), - (string) - ]; - foo: 'Corge'; -}; - -export enum foo { - BAR = 'Bar' -} - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPattern = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - (number | string), - string -]; - -/** - * This is a model with one nested property - */ -export type ModelWithProperties = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: (string) | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -export type ModelWithReadOnlyAndWriteOnly = { - foo: string; - readonly bar: string; - baz: string; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReference = { - prop?: ModelWithProperties; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: (Array<(string | boolean)> | null); -}; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array<(string)>; -}; - -/** - * This is a reusable parameter - */ -export type ParameterSimpleParameter = string; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Parameter with illegal characters - */ -export type Parameterx_Foo_Bar = ModelWithString; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<({ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; -})>; -}; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple file - */ -export type SimpleFile = (Blob | File); - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = (string) | null; - -export type CollectionFormatData = { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCsv: Array<(string)> | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array<(string)> | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array<(string)> | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySsv: Array<(string)> | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTsv: Array<(string)> | null; -}; - -export type ComplexTypesData = { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; -}; - -export type ComplexTypesResponse = (Array); - -export type ComplexParamsData = { - id: number; - requestBody?: { - readonly key: (string) | null; - name: (string) | null; - enabled?: boolean; - readonly type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array<(string)> | null; - parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); - readonly user?: { - readonly id?: number; - readonly name?: (string) | null; - }; - }; -}; - -export type ComplexParamsResponse = (ModelWithString); - -export type PatchApiNoTagResponse = (unknown); - -export type ImportData = { - requestBody: (ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly); -}; - -export type ImportResponse = (Model_From_Zendesk | ModelWithReadOnlyAndWriteOnly); - -export type FooWowResponse = (unknown); - -export type GetApiSimpleOperationData = { - /** - * foo in method - */ - fooParam: string; -}; - -export type GetApiSimpleOperationResponse = (number); - -export type CallWithDefaultParametersData = { - /** - * This is a simple boolean with default value - */ - parameterBoolean?: (boolean) | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: (ModelWithString) | null; - /** - * This is a simple number with default value - */ - parameterNumber?: (number) | null; - /** - * This is a simple string with default value - */ - parameterString?: (string) | null; -}; - -export type CallWithDefaultOptionalParametersData = { - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; -}; - -export type CallToTestOrderOfParamsData = { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: (string) | null; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: (string) | null; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; -}; - -export type DeprecatedCallData = { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: (DeprecatedModel) | null; -}; - -export type CallWithDescriptionsData = { - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: unknown; - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: unknown; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: unknown; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: unknown; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: unknown; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: unknown; -}; - -export type TestErrorCodeData = { - /** - * Status code to return - */ - status: number; -}; - -export type TestErrorCodeResponse = (unknown); - -export type FileResponseData = { - id: string; -}; - -export type FileResponseResponse = ((Blob | File)); - -export type PostApiFormDataData = { - /** - * A reusable request body - */ - formData?: ModelWithString; - /** - * This is a reusable parameter - */ - parameter?: string; -}; - -export type CallWithResultFromHeaderResponse = (string); - -export type MultipartRequestData = { - formData?: { - content?: (Blob | File); - data?: ((ModelWithString) | null); - }; -}; - -export type MultipartResponseResponse = ({ - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; -}); - -export type DummyAResponse = (_400); - -export type DummyBResponse = (void); - -export type CallWithNoContentResponseResponse = (void); - -export type CallWithResponseAndNoContentResponseResponse = (number | void); - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - /** - * Dummy input param - */ - nonAsciiParamæøåÆøÅöôêÊ: number; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = (Array); - -export type PutWithFormUrlEncodedData = { - formData: ArrayWithStrings; -}; - -export type DeleteFooData3 = { - /** - * bar in method - */ - barParam: string; - /** - * foo in method - */ - fooParam: string; - /** - * Parameter with illegal characters - */ - xFooBar: ModelWithString; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the query params - */ - cursor: (string) | null; - fooAllOfEnum: (ModelWithNestedArrayEnumsDataFoo); - fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the cookie - */ - parameterCookie: (string) | null; - /** - * This is the parameter that goes into the header - */ - parameterHeader: (string) | null; - /** - * This is the parameter that goes into the path - */ - parameterPath: (string) | null; - /** - * This is the parameter that goes into the body - */ - requestBody: { - [key: string]: unknown; - } | null; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter with a reserved keyword - */ - _default?: string; - /** - * This is the parameter that goes into the cookie - */ - parameterCookie: (string) | null; - /** - * This is the parameter that goes into the request header - */ - parameterHeader: (string) | null; - /** - * This is the parameter that goes into the path - */ - parameterPath1?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath2?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath3?: string; - /** - * This is the parameter that goes into the request query params - */ - parameterQuery: (string) | null; - /** - * This is the parameter that goes into the body - */ - requestBody: (ModelWithString) | null; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - page?: number; - /** - * This is a required parameter - */ - requestBody: ModelWithOneOfEnum; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is a required parameter - */ - parameter: Pageable; - /** - * This is an optional parameter - */ - requestBody?: { - offset?: (number) | null; - }; -}; - -export type PostCallWithOptionalParamResponse = (number | void); - -export type PostApiRequestBodyData = { - /** - * A reusable request body - */ - foo?: ModelWithString; - /** - * This is a reusable parameter - */ - parameter?: string; -}; - -export type CallWithResponseResponse = (_import); - -export type CallWithDuplicateResponsesResponse = ((ModelWithBoolean & ModelWithInteger) | ModelWithString); - -export type CallWithResponsesResponse = ({ - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; -} | ModelThatExtends | ModelThatExtendsExtends); - -export type ApiVVersionODataControllerCountResponse = (Model_From_Zendesk); - -export type TypesData = { - /** - * This is a number parameter - */ - id?: number; - /** - * This is an array parameter - */ - parameterArray: Array<(string)> | null; - /** - * This is a boolean parameter - */ - parameterBoolean: (boolean) | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: ('Success' | 'Warning' | 'Error') | null; - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is a string parameter - */ - parameterString: (string) | null; - /** - * This is tuple parameter - */ - parameterTuple: [ - number, - number, - number, - number - ]; -}; - -export type TypesResponse = (number | string | boolean | { - [key: string]: unknown; -}); - -export type UploadFileData = { - formData: (Blob | File); -}; - -export type UploadFileResponse = (boolean); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiError.ts deleted file mode 100644 index 36675d288..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiError.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: unknown; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiRequestOptions.ts deleted file mode 100644 index 939a0aa4c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiRequestOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type ApiRequestOptions = { - readonly body?: any; - readonly cookies?: Record; - readonly errors?: Record; - readonly formData?: Record | any[] | Blob | File; - readonly headers?: Record; - readonly mediaType?: string; - readonly method: - | 'DELETE' - | 'GET' - | 'HEAD' - | 'OPTIONS' - | 'PATCH' - | 'POST' - | 'PUT'; - readonly path?: Record; - readonly query?: Record; - readonly responseHeader?: string; - readonly responseTransformer?: (data: unknown) => Promise; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiResult.ts deleted file mode 100644 index 4c58e3913..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/ApiResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ApiResult = { - readonly body: TData; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/CancelablePromise.ts deleted file mode 100644 index ccc082e8f..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/CancelablePromise.ts +++ /dev/null @@ -1,126 +0,0 @@ -export class CancelError extends Error { - constructor(message: string) { - super(message); - this.name = 'CancelError'; - } - - public get isCancelled(): boolean { - return true; - } -} - -export interface OnCancel { - readonly isResolved: boolean; - readonly isRejected: boolean; - readonly isCancelled: boolean; - - (cancelHandler: () => void): void; -} - -export class CancelablePromise implements Promise { - private _isResolved: boolean; - private _isRejected: boolean; - private _isCancelled: boolean; - readonly cancelHandlers: (() => void)[]; - readonly promise: Promise; - private _resolve?: (value: T | PromiseLike) => void; - private _reject?: (reason?: unknown) => void; - - constructor( - executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: unknown) => void, - onCancel: OnCancel - ) => void - ) { - this._isResolved = false; - this._isRejected = false; - this._isCancelled = false; - this.cancelHandlers = []; - this.promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - - const onResolve = (value: T | PromiseLike): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isResolved = true; - if (this._resolve) this._resolve(value); - }; - - const onReject = (reason?: unknown): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isRejected = true; - if (this._reject) this._reject(reason); - }; - - const onCancel = (cancelHandler: () => void): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this.cancelHandlers.push(cancelHandler); - }; - - Object.defineProperty(onCancel, 'isResolved', { - get: (): boolean => this._isResolved, - }); - - Object.defineProperty(onCancel, 'isRejected', { - get: (): boolean => this._isRejected, - }); - - Object.defineProperty(onCancel, 'isCancelled', { - get: (): boolean => this._isCancelled, - }); - - return executor(onResolve, onReject, onCancel as OnCancel); - }); - } - - get [Symbol.toStringTag]() { - return "Cancellable Promise"; - } - - public then( - onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null - ): Promise { - return this.promise.then(onFulfilled, onRejected); - } - - public catch( - onRejected?: ((reason: unknown) => TResult | PromiseLike) | null - ): Promise { - return this.promise.catch(onRejected); - } - - public finally(onFinally?: (() => void) | null): Promise { - return this.promise.finally(onFinally); - } - - public cancel(): void { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isCancelled = true; - if (this.cancelHandlers.length) { - try { - for (const cancelHandler of this.cancelHandlers) { - cancelHandler(); - } - } catch (error) { - console.warn('Cancellation threw an error', error); - return; - } - } - this.cancelHandlers.length = 0; - if (this._reject) this._reject(new CancelError('Request aborted')); - } - - public get isCancelled(): boolean { - return this._isCancelled; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/OpenAPI.ts deleted file mode 100644 index 144e25744..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/OpenAPI.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; - -type Headers = Record; -type Middleware = (value: T) => T | Promise; -type Resolver = (options: ApiRequestOptions) => Promise; - -export class Interceptors { - _fns: Middleware[]; - - constructor() { - this._fns = []; - } - - eject(fn: Middleware): void { - const index = this._fns.indexOf(fn); - if (index !== -1) { - this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; - } - } - - use(fn: Middleware): void { - this._fns = [...this._fns, fn]; - } -} - -export type OpenAPIConfig = { - BASE: string; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - ENCODE_PATH?: ((path: string) => string) | undefined; - HEADERS?: Headers | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - VERSION: string; - WITH_CREDENTIALS: boolean; - interceptors: { - request: Interceptors; - response: Interceptors; - }; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: 'http://localhost:3000/base', - CREDENTIALS: 'include', - ENCODE_PATH: undefined, - HEADERS: undefined, - PASSWORD: undefined, - TOKEN: undefined, - USERNAME: undefined, - VERSION: '1.0', - WITH_CREDENTIALS: false, - interceptors: { - request: new Interceptors(), - response: new Interceptors(), - }, -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/request.ts deleted file mode 100644 index 5458a2899..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/core/request.ts +++ /dev/null @@ -1,350 +0,0 @@ -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import { CancelablePromise } from './CancelablePromise'; -import type { OnCancel } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const isString = (value: unknown): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: any): value is Blob => { - return value instanceof Blob; -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const encodePair = (key: string, value: unknown) => { - if (value === undefined || value === null) { - return; - } - - if (value instanceof Date) { - append(key, value.toISOString()); - } else if (Array.isArray(value)) { - value.forEach(v => encodePair(key, v)); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); - } else { - append(key, value); - } - }; - - Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - - return qs.length ? `?${qs.join('&')}` : ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = config.BASE + path; - return options.query ? url + getQueryString(options.query) : url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([, value]) => value !== undefined && value !== null) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { - const [token, username, password, additionalHeaders] = await Promise.all([ - // @ts-ignore - resolve(options, config.TOKEN), - // @ts-ignore - resolve(options, config.USERNAME), - // @ts-ignore - resolve(options, config.PASSWORD), - // @ts-ignore - resolve(options, config.HEADERS), - ]); - - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - }) - .filter(([, value]) => value !== undefined && value !== null) - .reduce((headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), {} as Record); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return new Headers(headers); -}; - -export const getRequestBody = (options: ApiRequestOptions): unknown => { - if (options.body !== undefined) { - if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { - return JSON.stringify(options.body); - } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; -}; - -export const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: any, - formData: FormData | undefined, - headers: Headers, - onCancel: OnCancel -): Promise => { - const controller = new AbortController(); - - let request: RequestInit = { - headers, - body: body ?? formData, - method: options.method, - signal: controller.signal, - }; - - if (config.WITH_CREDENTIALS) { - request.credentials = config.CREDENTIALS; - } - - for (const fn of config.interceptors.request._fns) { - request = await fn(request); - } - - onCancel(() => controller.abort()); - - return await fetch(url, request); -}; - -export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { - if (responseHeader) { - const content = response.headers.get(responseHeader); - if (isString(content)) { - return content; - } - } - return undefined; -}; - -export const getResponseBody = async (response: Response): Promise => { - if (response.status !== 204) { - try { - const contentType = response.headers.get('Content-Type'); - if (contentType) { - const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; - if (contentType.includes('application/json') || contentType.includes('+json')) { - return await response.json(); - } else if (binaryTypes.some(type => contentType.includes(type))) { - return await response.blob(); - } else if (contentType.includes('multipart/form-data')) { - return await response.formData(); - } else if (contentType.includes('text/')) { - return await response.text(); - } - } - } catch (error) { - console.error(error); - } - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 405: 'Method Not Allowed', - 406: 'Not Acceptable', - 407: 'Proxy Authentication Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Payload Too Large', - 414: 'URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Range Not Satisfiable', - 417: 'Expectation Failed', - 418: 'Im a teapot', - 421: 'Misdirected Request', - 422: 'Unprocessable Content', - 423: 'Locked', - 424: 'Failed Dependency', - 425: 'Too Early', - 426: 'Upgrade Required', - 428: 'Precondition Required', - 429: 'Too Many Requests', - 431: 'Request Header Fields Too Large', - 451: 'Unavailable For Legal Reasons', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported', - 506: 'Variant Also Negotiates', - 507: 'Insufficient Storage', - 508: 'Loop Detected', - 510: 'Not Extended', - 511: 'Network Authentication Required', - ...options.errors, - } - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError(options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ -export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options); - - if (!onCancel.isCancelled) { - let response = await sendRequest(config, options, url, body, formData, headers, onCancel); - - for (const fn of config.interceptors.response._fns) { - response = await fn(response); - } - - const responseBody = await getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - let transformedBody = responseBody; - if (options.responseTransformer && response.ok) { - transformedBody = await options.responseTransformer(responseBody) - } - - const result: ApiResult = { - url, - ok: response.ok, - status: response.status, - statusText: response.statusText, - body: responseHeader ?? transformedBody, - }; - - catchErrorCodes(options, result); - - resolve(result.body); - } - } catch (error) { - reject(error); - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/index.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/index.ts deleted file mode 100644 index 50a1dd734..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export { ApiError } from './core/ApiError'; -export { CancelablePromise, CancelError } from './core/CancelablePromise'; -export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/sdk.gen.ts deleted file mode 100644 index f62288bcf..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/sdk.gen.ts +++ /dev/null @@ -1,913 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { CancelablePromise } from './core/CancelablePromise'; -import { OpenAPI } from './core/OpenAPI'; -import { request as __request } from './core/request'; -import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; - -export class CollectionFormatService { - /** - * @param data The data for the request. - * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) - * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) - * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) - * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) - * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) - * @throws ApiError - */ - public static collectionFormat(data: CollectionFormatData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/collectionFormat', - query: { - parameterArrayCSV: data.parameterArrayCsv, - parameterArraySSV: data.parameterArraySsv, - parameterArrayTSV: data.parameterArrayTsv, - parameterArrayPipes: data.parameterArrayPipes, - parameterArrayMulti: data.parameterArrayMulti - } - }); - } - -} - -export class ComplexService { - /** - * @param data The data for the request. - * @param data.parameterObject Parameter containing object - * @param data.parameterReference Parameter containing reference - * @returns ModelWithString Successful response - * @throws ApiError - */ - public static complexTypes(data: ComplexTypesData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/complex', - query: { - parameterObject: data.parameterObject, - parameterReference: data.parameterReference - }, - errors: { - 400: '400 `server` error', - 500: '500 server error' - } - }); - } - - /** - * @param data The data for the request. - * @param data.id - * @param data.requestBody - * @returns ModelWithString Success - * @throws ApiError - */ - public static complexParams(data: ComplexParamsData): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/complex/{id}', - path: { - id: data.id - }, - body: data.requestBody, - mediaType: 'application/json-patch+json' - }); - } - -} - -export class DefaultService { - /** - * @throws ApiError - */ - public static export(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public static patchApiNoTag(): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @param data The data for the request. - * @param data.requestBody - * @returns Model_From_Zendesk Success - * @returns ModelWithReadOnlyAndWriteOnly Default success response - * @throws ApiError - */ - public static import(data: ImportData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/no+tag', - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public static fooWow(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @param data The data for the request. - * @param data.fooParam foo in method - * @returns number Response is a simple number - * @throws ApiError - */ - public static getApiSimpleOperation(data: GetApiSimpleOperationData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple:operation', - path: { - foo_param: data.fooParam - }, - errors: { - default: 'Default error response' - } - }); - } - -} - -export class DefaultsService { - /** - * @param data The data for the request. - * @param data.parameterString This is a simple string with default value - * @param data.parameterNumber This is a simple number with default value - * @param data.parameterBoolean This is a simple boolean with default value - * @param data.parameterEnum This is a simple enum with default value - * @param data.parameterModel This is a simple model with default value - * @throws ApiError - */ - public static callWithDefaultParameters(data: CallWithDefaultParametersData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterString This is a simple string that is optional with default value - * @param data.parameterNumber This is a simple number that is optional with default value - * @param data.parameterBoolean This is a simple boolean that is optional with default value - * @param data.parameterEnum This is a simple enum that is optional with default value - * @param data.parameterModel This is a simple model that is optional with default value - * @throws ApiError - */ - public static callWithDefaultOptionalParameters(data: CallWithDefaultOptionalParametersData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterStringWithNoDefault This is a string with no default - * @param data.parameterOptionalStringWithDefault This is a optional string with default - * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default - * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default - * @param data.parameterStringWithDefault This is a string with default - * @param data.parameterStringWithEmptyDefault This is a string with empty default - * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default - * @param data.parameterStringNullableWithDefault This is a string that can be null with default - * @throws ApiError - */ - public static callToTestOrderOfParams(data: CallToTestOrderOfParamsData): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/defaults', - query: { - parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, - parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, - parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, - parameterStringWithDefault: data.parameterStringWithDefault, - parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, - parameterStringWithNoDefault: data.parameterStringWithNoDefault, - parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, - parameterStringNullableWithDefault: data.parameterStringNullableWithDefault - } - }); - } - -} - -export class DeprecatedService { - /** - * @deprecated - * @param data The data for the request. - * @param data.parameter This parameter is deprecated - * @throws ApiError - */ - public static deprecatedCall(data: DeprecatedCallData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/deprecated', - headers: { - parameter: data.parameter - } - }); - } - -} - -export class DescriptionsService { - /** - * @param data The data for the request. - * @param data.parameterWithBreaks Testing multiline comments in string: First line - * Second line - * - * Fourth line - * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work - * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work - * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work - * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work - * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work - * @throws ApiError - */ - public static callWithDescriptions(data: CallWithDescriptionsData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/descriptions/', - query: { - parameterWithBreaks: data.parameterWithBreaks, - parameterWithBackticks: data.parameterWithBackticks, - parameterWithSlashes: data.parameterWithSlashes, - parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders, - parameterWithQuotes: data.parameterWithQuotes, - parameterWithReservedCharacters: data.parameterWithReservedCharacters - } - }); - } - -} - -export class DuplicateService { - /** - * @throws ApiError - */ - public static duplicateName(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public static duplicateName1(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public static duplicateName2(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public static duplicateName3(): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/duplicate' - }); - } - -} - -export class ErrorService { - /** - * @param data The data for the request. - * @param data.status Status code to return - * @returns unknown Custom message: Successful response - * @throws ApiError - */ - public static testErrorCode(data: TestErrorCodeData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/error', - query: { - status: data.status - }, - errors: { - 500: 'Custom message: Internal Server Error', - 501: 'Custom message: Not Implemented', - 502: 'Custom message: Bad Gateway', - 503: 'Custom message: Service Unavailable' - } - }); - } - -} - -export class FileResponseService { - /** - * @param data The data for the request. - * @param data.id - * @returns binary Success - * @throws ApiError - */ - public static fileResponse(data: FileResponseData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/file/{id}', - path: { - id: data.id - } - }); - } - -} - -export class FormDataService { - /** - * @param data The data for the request. - * @param data.parameter This is a reusable parameter - * @param data.formData A reusable request body - * @throws ApiError - */ - public static postApiFormData(data: PostApiFormDataData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/formData/', - query: { - parameter: data.parameter - }, - formData: data.formData, - mediaType: 'multipart/form-data' - }); - } - -} - -export class HeaderService { - /** - * @returns string Successful response - * @throws ApiError - */ - public static callWithResultFromHeader(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/header', - responseHeader: 'operation-location', - errors: { - 400: '400 server error', - 500: '500 server error' - } - }); - } - -} - -export class MultipartService { - /** - * @param data The data for the request. - * @param data.formData - * @throws ApiError - */ - public static multipartRequest(data: MultipartRequestData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/multipart', - formData: data.formData, - mediaType: 'multipart/form-data' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public static multipartResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multipart' - }); - } - -} - -export class MultipleTags1Service { - /** - * @returns _400 - * @throws ApiError - */ - public static dummyA(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/a' - }); - } - - /** - * @returns void Success - * @throws ApiError - */ - public static dummyB(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class MultipleTags2Service { - /** - * @returns _400 - * @throws ApiError - */ - public static dummyA(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/a' - }); - } - - /** - * @returns void Success - * @throws ApiError - */ - public static dummyB(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class MultipleTags3Service { - /** - * @returns void Success - * @throws ApiError - */ - public static dummyB(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class NoContentService { - /** - * @returns void Success - * @throws ApiError - */ - public static callWithNoContentResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/no-content' - }); - } - - /** - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public static callWithResponseAndNoContentResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/response-and-no-content' - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - /** - * @param data The data for the request. - * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param - * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response - * @throws ApiError - */ - public static nonAsciiæøåÆøÅöôêÊ字符串(data: NonAsciiæøåÆøÅöôêÊ字符串Data): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - query: { - 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ - } - }); - } - - /** - * Login User - * @param data The data for the request. - * @param data.formData - * @throws ApiError - */ - public static putWithFormUrlEncoded(data: PutWithFormUrlEncodedData): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - formData: data.formData, - mediaType: 'application/x-www-form-urlencoded' - }); - } - -} - -export class ParametersService { - /** - * @param data The data for the request. - * @param data.fooParam foo in method - * @param data.barParam bar in method - * @param data.xFooBar Parameter with illegal characters - * @throws ApiError - */ - public static deleteFoo(data: DeleteFooData3): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - path: { - foo_param: data.fooParam, - BarParam: data.barParam - }, - headers: { - 'x-Foo-Bar': data.xFooBar - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the header - * @param data.fooAllOfEnum - * @param data.cursor This is the parameter that goes into the query params - * @param data.parameterCookie This is the parameter that goes into the cookie - * @param data.parameterPath This is the parameter that goes into the path - * @param data.requestBody This is the parameter that goes into the body - * @param data.fooRefEnum - * @throws ApiError - */ - public static callWithParameters(data: CallWithParametersData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/{parameterPath}', - path: { - parameterPath: data.parameterPath - }, - cookies: { - parameterCookie: data.parameterCookie - }, - headers: { - parameterHeader: data.parameterHeader - }, - query: { - foo_ref_enum: data.fooRefEnum, - foo_all_of_enum: data.fooAllOfEnum, - cursor: data.cursor - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the request header - * @param data.parameterQuery This is the parameter that goes into the request query params - * @param data.parameterCookie This is the parameter that goes into the cookie - * @param data.requestBody This is the parameter that goes into the body - * @param data.parameterPath1 This is the parameter that goes into the path - * @param data.parameterPath2 This is the parameter that goes into the path - * @param data.parameterPath3 This is the parameter that goes into the path - * @param data._default This is the parameter with a reserved keyword - * @throws ApiError - */ - public static callWithWeirdParameterNames(data: CallWithWeirdParameterNamesData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - path: { - 'parameter.path.1': data.parameterPath1, - 'parameter-path-2': data.parameterPath2, - 'PARAMETER-PATH-3': data.parameterPath3 - }, - cookies: { - 'PARAMETER-COOKIE': data.parameterCookie - }, - headers: { - 'parameter.header': data.parameterHeader - }, - query: { - default: data._default, - 'parameter-query': data.parameterQuery - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.requestBody This is a required parameter - * @param data.page This is an optional parameter - * @throws ApiError - */ - public static getCallWithOptionalParam(data: GetCallWithOptionalParamData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/parameters/', - query: { - page: data.page - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.parameter This is a required parameter - * @param data.requestBody This is an optional parameter - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public static postCallWithOptionalParam(data: PostCallWithOptionalParamData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/', - query: { - parameter: data.parameter - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - -} - -export class RequestBodyService { - /** - * @param data The data for the request. - * @param data.parameter This is a reusable parameter - * @param data.foo A reusable request body - * @throws ApiError - */ - public static postApiRequestBody(data: PostApiRequestBodyData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/requestBody/', - query: { - parameter: data.parameter - }, - body: data.foo, - mediaType: 'application/json' - }); - } - -} - -export class ResponseService { - /** - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public static callWithResponseAndNoContentResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/response-and-no-content' - }); - } - - /** - * @returns import - * @throws ApiError - */ - public static callWithResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/response' - }); - } - - /** - * @returns unknown Message for 200 response - * @returns ModelWithString Message for 201 response - * @returns ModelWithString Message for 202 response - * @throws ApiError - */ - public static callWithDuplicateResponses(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/response', - errors: { - 500: 'Message for 500 error', - 501: 'Message for 501 error', - 502: 'Message for 502 error', - '4XX': 'Message for 4XX errors', - default: 'Default error response' - } - }); - } - - /** - * @returns unknown Message for 200 response - * @returns ModelThatExtends Message for 201 response - * @returns ModelThatExtendsExtends Message for 202 response - * @throws ApiError - */ - public static callWithResponses(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/response', - errors: { - 500: 'Message for 500 error', - 501: 'Message for 501 error', - 502: 'Message for 502 error', - default: 'Message for default response' - } - }); - } - -} - -export class SimpleService { - /** - * @returns Model_From_Zendesk Success - * @throws ApiError - */ - public static apiVVersionODataControllerCount(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple/$count' - }); - } - - /** - * @throws ApiError - */ - public static getCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static putCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static postCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static deleteCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static optionsCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'OPTIONS', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static headCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'HEAD', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static patchCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v{api-version}/simple' - }); - } - -} - -export class TypesService { - /** - * @param data The data for the request. - * @param data.parameterArray This is an array parameter - * @param data.parameterDictionary This is a dictionary parameter - * @param data.parameterEnum This is an enum parameter - * @param data.parameterTuple This is tuple parameter - * @param data.parameterNumber This is a number parameter - * @param data.parameterString This is a string parameter - * @param data.parameterBoolean This is a boolean parameter - * @param data.parameterObject This is an object parameter - * @param data.id This is a number parameter - * @returns number Response is a simple number - * @returns string Response is a simple string - * @returns boolean Response is a simple boolean - * @returns unknown Response is a simple object - * @throws ApiError - */ - public static types(data: TypesData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/types', - path: { - id: data.id - }, - query: { - parameterNumber: data.parameterNumber, - parameterString: data.parameterString, - parameterBoolean: data.parameterBoolean, - parameterObject: data.parameterObject, - parameterArray: data.parameterArray, - parameterDictionary: data.parameterDictionary, - parameterEnum: data.parameterEnum, - parameterTuple: data.parameterTuple - } - }); - } - -} - -export class UploadService { - /** - * @param data The data for the request. - * @param data.formData - * @returns boolean - * @throws ApiError - */ - public static uploadFile(data: UploadFileData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/upload', - formData: data.formData, - mediaType: 'application/x-www-form-urlencoded' - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/types.gen.ts deleted file mode 100644 index 77f604255..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_enums_typescript_namespace/types.gen.ts +++ /dev/null @@ -1,1524 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export enum _3e_num_1Период { - BIRD = 'Bird', - DOG = 'Dog' -} - -/** - * Model with number-only name - */ -export type _400 = string; - -export type _default = { - name?: string; -}; - -/** - * Model with restricted keyword name - */ -export type _import = string; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: (number) | undefined; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AnyOfAnyAndNull = { - data?: (unknown | null); -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<({ - foo?: string; -} | { - bar?: string; -})>; -}; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<({ - foo?: string; -} | { - bar?: string; -})>; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array<(boolean)>; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array<(number)>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: camelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array<(string)>; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type camelCaseCommentWithBreaks = number; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - firstName: string; - lastname: string; - age: number; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: (({ - boolean?: boolean; -} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: (Array<(_3e_num_1Период | ConstValue)> | null); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(number | string)>; -}); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: ParameterSimpleParameter; -} | { - bar: NonAsciiStringæøåÆØÅöôêÊ字符串; -}) & { - baz: (number) | null; - qux: number; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(boolean)>; -}); -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: (boolean | { - [key: string]: (number); -}); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; - -export type ConstValue = "ConstValue"; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: (string); - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: (string | number | boolean) | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: (string); -}; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export enum EnumWithExtensions { - /** - * Used when the status of something is successful - */ - CUSTOM_SUCCESS = 200, - /** - * Used when the status of something has a warning - */ - CUSTOM_WARNING = 400, - /** - * Used when the status of something has an error - */ - CUSTOM_ERROR = 500 -} - -/** - * This is a simple enum with numbers - */ -export enum EnumWithNumbers { - '_1' = 1, - '_2' = 2, - '_3' = 3, - '_1.1' = 1.1, - '_1.2' = 1.2, - '_1.3' = 1.3, - '_100' = 100, - '_200' = 200, - '_300' = 300, - '_-100' = -100, - '_-200' = -200, - '_-300' = -300, - '_-1.1' = -1.1, - '_-1.2' = -1.2, - '_-1.3' = -1.3 -} - -export enum EnumWithReplacedCharacters { - _SINGLE_QUOTE_ = "'Single Quote'", - _DOUBLE_QUOTES_ = '"Double Quotes"', - ØÆÅÔÖ_ØÆÅÔÖ字符串 = 'øæåôöØÆÅÔÖ字符串', - '_3.1' = 3.1, - EMPTY_STRING = '' -} - -/** - * This is a simple enum with strings - */ -export enum EnumWithStrings { - SUCCESS = 'Success', - WARNING = 'Warning', - ERROR = 'Error', - _SINGLE_QUOTE_ = "'Single Quote'", - _DOUBLE_QUOTES_ = '"Double Quotes"', - NON_ASCII__ØÆÅÔÖ_ØÆÅÔÖ字符串 = 'Non-ascii: øæåôöØÆÅÔÖ字符串' -} - -export enum EnumWithXEnumNames { - zero = 0, - one = 1, - two = 2 -} - -export type File = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { - item?: boolean; - error?: (string) | null; - readonly hasError?: boolean; - data?: { - [key: string]: unknown; - }; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_String_ = { - item?: (string) | null; - error?: (string) | null; - readonly hasError?: boolean; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type Model_From_Zendesk = string; - -/** - * Circle - */ -export type ModelCircle = { - kind: 'circle'; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: 'square'; - sideLength?: number; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string; -}; - -export type ModelWithAnyOfConstantSizeArray = [ - (number | string), - (number | string), - (number | string) -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - (number & string), - (number & string) -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - ((number) | null | string), - ((number) | null | string), - ((number) | null | string) -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - (number | _import), - (number | _import) -]; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnly = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -export type ModelWithConst = { - String?: "String"; - number?: 0; - null?: null; - withType?: "Some string"; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: (string); - }; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: boolean; -}; - -export namespace ModelWithEnum { - /** - * This is a simple enum with strings - */ - export enum foo_bar_enum { - SUCCESS = 'Success', - WARNING = 'Warning', - ERROR = 'Error', - ØÆÅ字符串 = 'ØÆÅ字符串' - } - /** - * These are the HTTP error code enums - */ - export enum statusCode { - _100 = '100', - _200_FOO = '200 FOO', - _300_FOO_BAR = '300 FOO_BAR', - _400_FOO_BAR = '400 foo-bar', - _500_FOO_BAR = '500 foo.bar', - _600_FOO_BAR = '600 foo&bar' - } -} - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -export namespace ModelWithEnumWithHyphen { - export enum foo_bar_baz_qux { - _3_0 = '3.0' - } -} - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array<(string)>; - data?: (ModelWithNestedArrayEnumsData); -}; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export enum ModelWithNestedArrayEnumsDataBar { - BAZ = 'baz', - QUX = 'qux' -} - -export enum ModelWithNestedArrayEnumsDataFoo { - FOO = 'foo', - BAR = 'bar' -} - -export type ModelWithNestedCompositionEnums = { - foo?: (ModelWithNestedArrayEnumsDataFoo); -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: ('Success' | 'Warning' | 'Error'); - }; - dictionaryWithEnumFromDescription?: { - [key: string]: (number); - }; - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; - arrayWithDescription?: Array<(number)>; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -export namespace ModelWithNestedEnums { - /** - * This is a simple enum with strings - */ - export enum foo_bar_enum { - SUCCESS = 'Success', - WARNING = 'Warning', - ERROR = 'Error', - ØÆÅ字符串 = 'ØÆÅ字符串' - } -} - -/** - * This is a model with one nested property - */ -export type ModelWithNestedProperties = { - readonly first: { - readonly second: { - readonly third: (string) | null; - } | null; - } | null; -}; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: (string) | null; - /** - * This is a simple string property - */ - nullableProp2?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: (string) | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -export namespace ModelWithNullableString { - /** - * This is a simple enum with strings - */ - export enum foo_bar_enum { - SUCCESS = 'Success', - WARNING = 'Warning', - ERROR = 'Error', - ØÆÅ字符串 = 'ØÆÅ字符串' - } -} - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -export namespace ModelWithNumericEnumUnion { - /** - * Период - */ - export enum value { - '_-10' = -10, - '_-1' = -1, - '_0' = 0, - '_1' = 1, - '_3' = 3, - '_6' = 6, - '_12' = 12 - } -} - -export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { - baz: (number) | null; - qux: number; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - (string), - (string) - ]; - foo: 'Corge'; -}; - -export namespace ModelWithOneOfEnum { - export enum foo { - BAR = 'Bar' - } -} - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPattern = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - (number | string), - string -]; - -/** - * This is a model with one nested property - */ -export type ModelWithProperties = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: (string) | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -export type ModelWithReadOnlyAndWriteOnly = { - foo: string; - readonly bar: string; - baz: string; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReference = { - prop?: ModelWithProperties; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: (Array<(string | boolean)> | null); -}; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array<(string)>; -}; - -/** - * This is a reusable parameter - */ -export type ParameterSimpleParameter = string; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Parameter with illegal characters - */ -export type Parameterx_Foo_Bar = ModelWithString; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<({ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; -})>; -}; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple file - */ -export type SimpleFile = (Blob | File); - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = (string) | null; - -export type CollectionFormatData = { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCsv: Array<(string)> | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array<(string)> | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array<(string)> | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySsv: Array<(string)> | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTsv: Array<(string)> | null; -}; - -export type ComplexTypesData = { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; -}; - -export type ComplexTypesResponse = (Array); - -export type ComplexParamsData = { - id: number; - requestBody?: { - readonly key: (string) | null; - name: (string) | null; - enabled?: boolean; - readonly type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array<(string)> | null; - parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); - readonly user?: { - readonly id?: number; - readonly name?: (string) | null; - }; - }; -}; - -export type ComplexParamsResponse = (ModelWithString); - -export type PatchApiNoTagResponse = (unknown); - -export type ImportData = { - requestBody: (ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly); -}; - -export type ImportResponse = (Model_From_Zendesk | ModelWithReadOnlyAndWriteOnly); - -export type FooWowResponse = (unknown); - -export type GetApiSimpleOperationData = { - /** - * foo in method - */ - fooParam: string; -}; - -export type GetApiSimpleOperationResponse = (number); - -export type CallWithDefaultParametersData = { - /** - * This is a simple boolean with default value - */ - parameterBoolean?: (boolean) | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: (ModelWithString) | null; - /** - * This is a simple number with default value - */ - parameterNumber?: (number) | null; - /** - * This is a simple string with default value - */ - parameterString?: (string) | null; -}; - -export type CallWithDefaultOptionalParametersData = { - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; -}; - -export type CallToTestOrderOfParamsData = { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: (string) | null; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: (string) | null; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; -}; - -export type DeprecatedCallData = { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: (DeprecatedModel) | null; -}; - -export type CallWithDescriptionsData = { - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: unknown; - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: unknown; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: unknown; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: unknown; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: unknown; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: unknown; -}; - -export type TestErrorCodeData = { - /** - * Status code to return - */ - status: number; -}; - -export type TestErrorCodeResponse = (unknown); - -export type FileResponseData = { - id: string; -}; - -export type FileResponseResponse = ((Blob | File)); - -export type PostApiFormDataData = { - /** - * A reusable request body - */ - formData?: ModelWithString; - /** - * This is a reusable parameter - */ - parameter?: string; -}; - -export type CallWithResultFromHeaderResponse = (string); - -export type MultipartRequestData = { - formData?: { - content?: (Blob | File); - data?: ((ModelWithString) | null); - }; -}; - -export type MultipartResponseResponse = ({ - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; -}); - -export type DummyAResponse = (_400); - -export type DummyBResponse = (void); - -export type CallWithNoContentResponseResponse = (void); - -export type CallWithResponseAndNoContentResponseResponse = (number | void); - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - /** - * Dummy input param - */ - nonAsciiParamæøåÆøÅöôêÊ: number; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = (Array); - -export type PutWithFormUrlEncodedData = { - formData: ArrayWithStrings; -}; - -export type DeleteFooData3 = { - /** - * bar in method - */ - barParam: string; - /** - * foo in method - */ - fooParam: string; - /** - * Parameter with illegal characters - */ - xFooBar: ModelWithString; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the query params - */ - cursor: (string) | null; - fooAllOfEnum: (ModelWithNestedArrayEnumsDataFoo); - fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the cookie - */ - parameterCookie: (string) | null; - /** - * This is the parameter that goes into the header - */ - parameterHeader: (string) | null; - /** - * This is the parameter that goes into the path - */ - parameterPath: (string) | null; - /** - * This is the parameter that goes into the body - */ - requestBody: { - [key: string]: unknown; - } | null; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter with a reserved keyword - */ - _default?: string; - /** - * This is the parameter that goes into the cookie - */ - parameterCookie: (string) | null; - /** - * This is the parameter that goes into the request header - */ - parameterHeader: (string) | null; - /** - * This is the parameter that goes into the path - */ - parameterPath1?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath2?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath3?: string; - /** - * This is the parameter that goes into the request query params - */ - parameterQuery: (string) | null; - /** - * This is the parameter that goes into the body - */ - requestBody: (ModelWithString) | null; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - page?: number; - /** - * This is a required parameter - */ - requestBody: ModelWithOneOfEnum; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is a required parameter - */ - parameter: Pageable; - /** - * This is an optional parameter - */ - requestBody?: { - offset?: (number) | null; - }; -}; - -export type PostCallWithOptionalParamResponse = (number | void); - -export type PostApiRequestBodyData = { - /** - * A reusable request body - */ - foo?: ModelWithString; - /** - * This is a reusable parameter - */ - parameter?: string; -}; - -export type CallWithResponseResponse = (_import); - -export type CallWithDuplicateResponsesResponse = ((ModelWithBoolean & ModelWithInteger) | ModelWithString); - -export type CallWithResponsesResponse = ({ - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; -} | ModelThatExtends | ModelThatExtendsExtends); - -export type ApiVVersionODataControllerCountResponse = (Model_From_Zendesk); - -export type TypesData = { - /** - * This is a number parameter - */ - id?: number; - /** - * This is an array parameter - */ - parameterArray: Array<(string)> | null; - /** - * This is a boolean parameter - */ - parameterBoolean: (boolean) | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: ('Success' | 'Warning' | 'Error') | null; - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is a string parameter - */ - parameterString: (string) | null; - /** - * This is tuple parameter - */ - parameterTuple: [ - number, - number, - number, - number - ]; -}; - -export type TypesResponse = (number | string | boolean | { - [key: string]: unknown; -}); - -export type UploadFileData = { - formData: (Blob | File); -}; - -export type UploadFileResponse = (boolean); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiError.ts deleted file mode 100644 index 36675d288..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiError.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: unknown; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiRequestOptions.ts deleted file mode 100644 index 939a0aa4c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiRequestOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type ApiRequestOptions = { - readonly body?: any; - readonly cookies?: Record; - readonly errors?: Record; - readonly formData?: Record | any[] | Blob | File; - readonly headers?: Record; - readonly mediaType?: string; - readonly method: - | 'DELETE' - | 'GET' - | 'HEAD' - | 'OPTIONS' - | 'PATCH' - | 'POST' - | 'PUT'; - readonly path?: Record; - readonly query?: Record; - readonly responseHeader?: string; - readonly responseTransformer?: (data: unknown) => Promise; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiResult.ts deleted file mode 100644 index 4c58e3913..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/ApiResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ApiResult = { - readonly body: TData; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/CancelablePromise.ts deleted file mode 100644 index ccc082e8f..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/CancelablePromise.ts +++ /dev/null @@ -1,126 +0,0 @@ -export class CancelError extends Error { - constructor(message: string) { - super(message); - this.name = 'CancelError'; - } - - public get isCancelled(): boolean { - return true; - } -} - -export interface OnCancel { - readonly isResolved: boolean; - readonly isRejected: boolean; - readonly isCancelled: boolean; - - (cancelHandler: () => void): void; -} - -export class CancelablePromise implements Promise { - private _isResolved: boolean; - private _isRejected: boolean; - private _isCancelled: boolean; - readonly cancelHandlers: (() => void)[]; - readonly promise: Promise; - private _resolve?: (value: T | PromiseLike) => void; - private _reject?: (reason?: unknown) => void; - - constructor( - executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: unknown) => void, - onCancel: OnCancel - ) => void - ) { - this._isResolved = false; - this._isRejected = false; - this._isCancelled = false; - this.cancelHandlers = []; - this.promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - - const onResolve = (value: T | PromiseLike): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isResolved = true; - if (this._resolve) this._resolve(value); - }; - - const onReject = (reason?: unknown): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isRejected = true; - if (this._reject) this._reject(reason); - }; - - const onCancel = (cancelHandler: () => void): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this.cancelHandlers.push(cancelHandler); - }; - - Object.defineProperty(onCancel, 'isResolved', { - get: (): boolean => this._isResolved, - }); - - Object.defineProperty(onCancel, 'isRejected', { - get: (): boolean => this._isRejected, - }); - - Object.defineProperty(onCancel, 'isCancelled', { - get: (): boolean => this._isCancelled, - }); - - return executor(onResolve, onReject, onCancel as OnCancel); - }); - } - - get [Symbol.toStringTag]() { - return "Cancellable Promise"; - } - - public then( - onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null - ): Promise { - return this.promise.then(onFulfilled, onRejected); - } - - public catch( - onRejected?: ((reason: unknown) => TResult | PromiseLike) | null - ): Promise { - return this.promise.catch(onRejected); - } - - public finally(onFinally?: (() => void) | null): Promise { - return this.promise.finally(onFinally); - } - - public cancel(): void { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isCancelled = true; - if (this.cancelHandlers.length) { - try { - for (const cancelHandler of this.cancelHandlers) { - cancelHandler(); - } - } catch (error) { - console.warn('Cancellation threw an error', error); - return; - } - } - this.cancelHandlers.length = 0; - if (this._reject) this._reject(new CancelError('Request aborted')); - } - - public get isCancelled(): boolean { - return this._isCancelled; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/OpenAPI.ts deleted file mode 100644 index 144e25744..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/OpenAPI.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; - -type Headers = Record; -type Middleware = (value: T) => T | Promise; -type Resolver = (options: ApiRequestOptions) => Promise; - -export class Interceptors { - _fns: Middleware[]; - - constructor() { - this._fns = []; - } - - eject(fn: Middleware): void { - const index = this._fns.indexOf(fn); - if (index !== -1) { - this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; - } - } - - use(fn: Middleware): void { - this._fns = [...this._fns, fn]; - } -} - -export type OpenAPIConfig = { - BASE: string; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - ENCODE_PATH?: ((path: string) => string) | undefined; - HEADERS?: Headers | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - VERSION: string; - WITH_CREDENTIALS: boolean; - interceptors: { - request: Interceptors; - response: Interceptors; - }; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: 'http://localhost:3000/base', - CREDENTIALS: 'include', - ENCODE_PATH: undefined, - HEADERS: undefined, - PASSWORD: undefined, - TOKEN: undefined, - USERNAME: undefined, - VERSION: '1.0', - WITH_CREDENTIALS: false, - interceptors: { - request: new Interceptors(), - response: new Interceptors(), - }, -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/request.ts deleted file mode 100644 index 5458a2899..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/core/request.ts +++ /dev/null @@ -1,350 +0,0 @@ -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import { CancelablePromise } from './CancelablePromise'; -import type { OnCancel } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const isString = (value: unknown): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: any): value is Blob => { - return value instanceof Blob; -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const encodePair = (key: string, value: unknown) => { - if (value === undefined || value === null) { - return; - } - - if (value instanceof Date) { - append(key, value.toISOString()); - } else if (Array.isArray(value)) { - value.forEach(v => encodePair(key, v)); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); - } else { - append(key, value); - } - }; - - Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - - return qs.length ? `?${qs.join('&')}` : ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = config.BASE + path; - return options.query ? url + getQueryString(options.query) : url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([, value]) => value !== undefined && value !== null) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { - const [token, username, password, additionalHeaders] = await Promise.all([ - // @ts-ignore - resolve(options, config.TOKEN), - // @ts-ignore - resolve(options, config.USERNAME), - // @ts-ignore - resolve(options, config.PASSWORD), - // @ts-ignore - resolve(options, config.HEADERS), - ]); - - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - }) - .filter(([, value]) => value !== undefined && value !== null) - .reduce((headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), {} as Record); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return new Headers(headers); -}; - -export const getRequestBody = (options: ApiRequestOptions): unknown => { - if (options.body !== undefined) { - if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { - return JSON.stringify(options.body); - } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; -}; - -export const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: any, - formData: FormData | undefined, - headers: Headers, - onCancel: OnCancel -): Promise => { - const controller = new AbortController(); - - let request: RequestInit = { - headers, - body: body ?? formData, - method: options.method, - signal: controller.signal, - }; - - if (config.WITH_CREDENTIALS) { - request.credentials = config.CREDENTIALS; - } - - for (const fn of config.interceptors.request._fns) { - request = await fn(request); - } - - onCancel(() => controller.abort()); - - return await fetch(url, request); -}; - -export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { - if (responseHeader) { - const content = response.headers.get(responseHeader); - if (isString(content)) { - return content; - } - } - return undefined; -}; - -export const getResponseBody = async (response: Response): Promise => { - if (response.status !== 204) { - try { - const contentType = response.headers.get('Content-Type'); - if (contentType) { - const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; - if (contentType.includes('application/json') || contentType.includes('+json')) { - return await response.json(); - } else if (binaryTypes.some(type => contentType.includes(type))) { - return await response.blob(); - } else if (contentType.includes('multipart/form-data')) { - return await response.formData(); - } else if (contentType.includes('text/')) { - return await response.text(); - } - } - } catch (error) { - console.error(error); - } - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 405: 'Method Not Allowed', - 406: 'Not Acceptable', - 407: 'Proxy Authentication Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Payload Too Large', - 414: 'URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Range Not Satisfiable', - 417: 'Expectation Failed', - 418: 'Im a teapot', - 421: 'Misdirected Request', - 422: 'Unprocessable Content', - 423: 'Locked', - 424: 'Failed Dependency', - 425: 'Too Early', - 426: 'Upgrade Required', - 428: 'Precondition Required', - 429: 'Too Many Requests', - 431: 'Request Header Fields Too Large', - 451: 'Unavailable For Legal Reasons', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported', - 506: 'Variant Also Negotiates', - 507: 'Insufficient Storage', - 508: 'Loop Detected', - 510: 'Not Extended', - 511: 'Network Authentication Required', - ...options.errors, - } - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError(options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ -export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options); - - if (!onCancel.isCancelled) { - let response = await sendRequest(config, options, url, body, formData, headers, onCancel); - - for (const fn of config.interceptors.response._fns) { - response = await fn(response); - } - - const responseBody = await getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - let transformedBody = responseBody; - if (options.responseTransformer && response.ok) { - transformedBody = await options.responseTransformer(responseBody) - } - - const result: ApiResult = { - url, - ok: response.ok, - status: response.status, - statusText: response.statusText, - body: responseHeader ?? transformedBody, - }; - - catchErrorCodes(options, result); - - resolve(result.body); - } - } catch (error) { - reject(error); - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/index.ts b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/index.ts deleted file mode 100644 index 50a1dd734..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export { ApiError } from './core/ApiError'; -export { CancelablePromise, CancelError } from './core/CancelablePromise'; -export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/sdk.gen.ts deleted file mode 100644 index 6856f018b..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/sdk.gen.ts +++ /dev/null @@ -1,85 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { CancelablePromise } from './core/CancelablePromise'; -import { OpenAPI } from './core/OpenAPI'; -import { request as __request } from './core/request'; -import type { CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData } from './types.gen'; - -export class DefaultsService { - /** - * @param parameterString This is a simple string with default value - * @param parameterNumber This is a simple number with default value - * @param parameterBoolean This is a simple boolean with default value - * @param parameterEnum This is a simple enum with default value - * @param parameterModel This is a simple model with default value - * @throws ApiError - */ - public static callWithDefaultParameters(parameterString: CallWithDefaultParametersData['parameterString'] = 'Hello World!', parameterNumber: CallWithDefaultParametersData['parameterNumber'] = 123, parameterBoolean: CallWithDefaultParametersData['parameterBoolean'] = true, parameterEnum: CallWithDefaultParametersData['parameterEnum'] = 'Success', parameterModel: CallWithDefaultParametersData['parameterModel'] = { - prop: 'Hello World!' - }): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/defaults', - query: { - parameterString, - parameterNumber, - parameterBoolean, - parameterEnum, - parameterModel - } - }); - } - - /** - * @param parameterString This is a simple string that is optional with default value - * @param parameterNumber This is a simple number that is optional with default value - * @param parameterBoolean This is a simple boolean that is optional with default value - * @param parameterEnum This is a simple enum that is optional with default value - * @param parameterModel This is a simple model that is optional with default value - * @throws ApiError - */ - public static callWithDefaultOptionalParameters(parameterString: CallWithDefaultOptionalParametersData['parameterString'] = 'Hello World!', parameterNumber: CallWithDefaultOptionalParametersData['parameterNumber'] = 123, parameterBoolean: CallWithDefaultOptionalParametersData['parameterBoolean'] = true, parameterEnum: CallWithDefaultOptionalParametersData['parameterEnum'] = 'Success', parameterModel: CallWithDefaultOptionalParametersData['parameterModel'] = { - prop: 'Hello World!' - }): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/defaults', - query: { - parameterString, - parameterNumber, - parameterBoolean, - parameterEnum, - parameterModel - } - }); - } - - /** - * @param parameterStringWithNoDefault This is a string with no default - * @param parameterOptionalStringWithDefault This is a optional string with default - * @param parameterOptionalStringWithEmptyDefault This is a optional string with empty default - * @param parameterOptionalStringWithNoDefault This is a optional string with no default - * @param parameterStringWithDefault This is a string with default - * @param parameterStringWithEmptyDefault This is a string with empty default - * @param parameterStringNullableWithNoDefault This is a string that can be null with no default - * @param parameterStringNullableWithDefault This is a string that can be null with default - * @throws ApiError - */ - public static callToTestOrderOfParams(parameterStringWithNoDefault: CallToTestOrderOfParamsData['parameterStringWithNoDefault'], parameterOptionalStringWithDefault: CallToTestOrderOfParamsData['parameterOptionalStringWithDefault'] = 'Hello World!', parameterOptionalStringWithEmptyDefault: CallToTestOrderOfParamsData['parameterOptionalStringWithEmptyDefault'] = '', parameterOptionalStringWithNoDefault?: CallToTestOrderOfParamsData['parameterOptionalStringWithNoDefault'], parameterStringWithDefault: CallToTestOrderOfParamsData['parameterStringWithDefault'] = 'Hello World!', parameterStringWithEmptyDefault: CallToTestOrderOfParamsData['parameterStringWithEmptyDefault'] = '', parameterStringNullableWithNoDefault?: CallToTestOrderOfParamsData['parameterStringNullableWithNoDefault'], parameterStringNullableWithDefault: CallToTestOrderOfParamsData['parameterStringNullableWithDefault'] = null): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/defaults', - query: { - parameterOptionalStringWithDefault, - parameterOptionalStringWithEmptyDefault, - parameterOptionalStringWithNoDefault, - parameterStringWithDefault, - parameterStringWithEmptyDefault, - parameterStringWithNoDefault, - parameterStringNullableWithNoDefault, - parameterStringNullableWithDefault - } - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/types.gen.ts deleted file mode 100644 index 3ee5e285c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_legacy_positional_args/types.gen.ts +++ /dev/null @@ -1,102 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -export type CallWithDefaultParametersData = { - /** - * This is a simple boolean with default value - */ - parameterBoolean?: (boolean) | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: (ModelWithString) | null; - /** - * This is a simple number with default value - */ - parameterNumber?: (number) | null; - /** - * This is a simple string with default value - */ - parameterString?: (string) | null; -}; - -export type CallWithDefaultOptionalParametersData = { - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; -}; - -export type CallToTestOrderOfParamsData = { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: (string) | null; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: (string) | null; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_no_index/client.gen.ts b/packages/openapi-ts-tests/test/generated/v3_no_index/client.gen.ts deleted file mode 100644 index fdbaafa48..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_no_index/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from './types.gen'; -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = (override?: Config) => Config & T>; - -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_no_index/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_no_index/types.gen.ts deleted file mode 100644 index f6a6095e3..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_no_index/types.gen.ts +++ /dev/null @@ -1,1970 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = unknown; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string; - /** - * This is a simple string property - */ - nullableRequiredProp1: string; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReference = { - prop?: ModelWithProperties; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnly = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: { - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithProperties = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedProperties = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPattern = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type File = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - unknown, - unknown - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnly = { - foo: string; - readonly bar: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | string, - number | string, - number | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: unknown; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssue = ((ConstValue | GenericSchemaDuplicateIssue1SystemBoolean) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemString; - -export type GenericSchemaDuplicateIssue1SystemBoolean = { - item?: boolean; - error?: string; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemString = { - item?: string; - error?: string; - readonly hasError?: boolean; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnly; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: unknown; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: unknown; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: unknown; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: unknown; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: unknown; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: unknown; - }; - url: '/api/v{api-version}/descriptions/'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - }; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters/'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters/'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody/'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData/'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string; - /** - * This is a simple number with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - }; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - /** - * This is tuple parameter - */ - parameterTuple: [ - number, - number, - number, - number - ]; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: unknown; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: unknown; -}; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - readonly key: string; - name: string; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array; - listOfStrings?: Array; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - readonly user?: { - readonly id?: number; - readonly name?: string; - }; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_node/core/ApiError.ts deleted file mode 100644 index 36675d288..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_node/core/ApiError.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: unknown; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_node/core/ApiRequestOptions.ts deleted file mode 100644 index 939a0aa4c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_node/core/ApiRequestOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type ApiRequestOptions = { - readonly body?: any; - readonly cookies?: Record; - readonly errors?: Record; - readonly formData?: Record | any[] | Blob | File; - readonly headers?: Record; - readonly mediaType?: string; - readonly method: - | 'DELETE' - | 'GET' - | 'HEAD' - | 'OPTIONS' - | 'PATCH' - | 'POST' - | 'PUT'; - readonly path?: Record; - readonly query?: Record; - readonly responseHeader?: string; - readonly responseTransformer?: (data: unknown) => Promise; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_node/core/ApiResult.ts deleted file mode 100644 index 4c58e3913..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_node/core/ApiResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ApiResult = { - readonly body: TData; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_node/core/CancelablePromise.ts deleted file mode 100644 index ccc082e8f..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_node/core/CancelablePromise.ts +++ /dev/null @@ -1,126 +0,0 @@ -export class CancelError extends Error { - constructor(message: string) { - super(message); - this.name = 'CancelError'; - } - - public get isCancelled(): boolean { - return true; - } -} - -export interface OnCancel { - readonly isResolved: boolean; - readonly isRejected: boolean; - readonly isCancelled: boolean; - - (cancelHandler: () => void): void; -} - -export class CancelablePromise implements Promise { - private _isResolved: boolean; - private _isRejected: boolean; - private _isCancelled: boolean; - readonly cancelHandlers: (() => void)[]; - readonly promise: Promise; - private _resolve?: (value: T | PromiseLike) => void; - private _reject?: (reason?: unknown) => void; - - constructor( - executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: unknown) => void, - onCancel: OnCancel - ) => void - ) { - this._isResolved = false; - this._isRejected = false; - this._isCancelled = false; - this.cancelHandlers = []; - this.promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - - const onResolve = (value: T | PromiseLike): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isResolved = true; - if (this._resolve) this._resolve(value); - }; - - const onReject = (reason?: unknown): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isRejected = true; - if (this._reject) this._reject(reason); - }; - - const onCancel = (cancelHandler: () => void): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this.cancelHandlers.push(cancelHandler); - }; - - Object.defineProperty(onCancel, 'isResolved', { - get: (): boolean => this._isResolved, - }); - - Object.defineProperty(onCancel, 'isRejected', { - get: (): boolean => this._isRejected, - }); - - Object.defineProperty(onCancel, 'isCancelled', { - get: (): boolean => this._isCancelled, - }); - - return executor(onResolve, onReject, onCancel as OnCancel); - }); - } - - get [Symbol.toStringTag]() { - return "Cancellable Promise"; - } - - public then( - onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null - ): Promise { - return this.promise.then(onFulfilled, onRejected); - } - - public catch( - onRejected?: ((reason: unknown) => TResult | PromiseLike) | null - ): Promise { - return this.promise.catch(onRejected); - } - - public finally(onFinally?: (() => void) | null): Promise { - return this.promise.finally(onFinally); - } - - public cancel(): void { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isCancelled = true; - if (this.cancelHandlers.length) { - try { - for (const cancelHandler of this.cancelHandlers) { - cancelHandler(); - } - } catch (error) { - console.warn('Cancellation threw an error', error); - return; - } - } - this.cancelHandlers.length = 0; - if (this._reject) this._reject(new CancelError('Request aborted')); - } - - public get isCancelled(): boolean { - return this._isCancelled; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_node/core/OpenAPI.ts deleted file mode 100644 index 90c96f9a3..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_node/core/OpenAPI.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { RequestInit, Response } from 'node-fetch'; -import type { ApiRequestOptions } from './ApiRequestOptions'; - -type Headers = Record; -type Middleware = (value: T) => T | Promise; -type Resolver = (options: ApiRequestOptions) => Promise; - -export class Interceptors { - _fns: Middleware[]; - - constructor() { - this._fns = []; - } - - eject(fn: Middleware): void { - const index = this._fns.indexOf(fn); - if (index !== -1) { - this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; - } - } - - use(fn: Middleware): void { - this._fns = [...this._fns, fn]; - } -} - -export type OpenAPIConfig = { - BASE: string; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - ENCODE_PATH?: ((path: string) => string) | undefined; - HEADERS?: Headers | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - VERSION: string; - WITH_CREDENTIALS: boolean; - interceptors: { - request: Interceptors; - response: Interceptors; - }; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: 'http://localhost:3000/base', - CREDENTIALS: 'include', - ENCODE_PATH: undefined, - HEADERS: undefined, - PASSWORD: undefined, - TOKEN: undefined, - USERNAME: undefined, - VERSION: '1.0', - WITH_CREDENTIALS: false, - interceptors: { - request: new Interceptors(), - response: new Interceptors(), - }, -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_node/core/request.ts deleted file mode 100644 index fa1ed3862..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_node/core/request.ts +++ /dev/null @@ -1,350 +0,0 @@ -import fetch, { FormData, Headers } from 'node-fetch'; -import type { RequestInit, Response } from 'node-fetch'; - -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import { CancelablePromise } from './CancelablePromise'; -import type { OnCancel } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const isString = (value: unknown): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: any): value is Blob => { - return value instanceof Blob; -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const encodePair = (key: string, value: unknown) => { - if (value === undefined || value === null) { - return; - } - - if (value instanceof Date) { - append(key, value.toISOString()); - } else if (Array.isArray(value)) { - value.forEach(v => encodePair(key, v)); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); - } else { - append(key, value); - } - }; - - Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - - return qs.length ? `?${qs.join('&')}` : ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = config.BASE + path; - return options.query ? url + getQueryString(options.query) : url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([, value]) => value !== undefined && value !== null) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { - const [token, username, password, additionalHeaders] = await Promise.all([ - // @ts-ignore - resolve(options, config.TOKEN), - // @ts-ignore - resolve(options, config.USERNAME), - // @ts-ignore - resolve(options, config.PASSWORD), - // @ts-ignore - resolve(options, config.HEADERS), - ]); - - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - }) - .filter(([, value]) => value !== undefined && value !== null) - .reduce((headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), {} as Record); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return new Headers(headers); -}; - -export const getRequestBody = (options: ApiRequestOptions): unknown => { - if (options.body !== undefined) { - if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { - return JSON.stringify(options.body); - } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; -}; - -export const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: any, - formData: FormData | undefined, - headers: Headers, - onCancel: OnCancel -): Promise => { - const controller = new AbortController(); - - let request: RequestInit = { - headers, - body: body ?? formData, - method: options.method, - signal: controller.signal, - }; - - - for (const fn of config.interceptors.request._fns) { - request = await fn(request); - } - - onCancel(() => controller.abort()); - - return await fetch(url, request); -}; - -export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { - if (responseHeader) { - const content = response.headers.get(responseHeader); - if (isString(content)) { - return content; - } - } - return undefined; -}; - -export const getResponseBody = async (response: Response): Promise => { - if (response.status !== 204) { - try { - const contentType = response.headers.get('Content-Type'); - if (contentType) { - const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; - if (contentType.includes('application/json') || contentType.includes('+json')) { - return await response.json(); - } else if (binaryTypes.some(type => contentType.includes(type))) { - return await response.blob(); - } else if (contentType.includes('multipart/form-data')) { - return await response.formData(); - } else if (contentType.includes('text/')) { - return await response.text(); - } - } - } catch (error) { - console.error(error); - } - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 405: 'Method Not Allowed', - 406: 'Not Acceptable', - 407: 'Proxy Authentication Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Payload Too Large', - 414: 'URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Range Not Satisfiable', - 417: 'Expectation Failed', - 418: 'Im a teapot', - 421: 'Misdirected Request', - 422: 'Unprocessable Content', - 423: 'Locked', - 424: 'Failed Dependency', - 425: 'Too Early', - 426: 'Upgrade Required', - 428: 'Precondition Required', - 429: 'Too Many Requests', - 431: 'Request Header Fields Too Large', - 451: 'Unavailable For Legal Reasons', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported', - 506: 'Variant Also Negotiates', - 507: 'Insufficient Storage', - 508: 'Loop Detected', - 510: 'Not Extended', - 511: 'Network Authentication Required', - ...options.errors, - } - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError(options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ -export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options); - - if (!onCancel.isCancelled) { - let response = await sendRequest(config, options, url, body, formData, headers, onCancel); - - for (const fn of config.interceptors.response._fns) { - response = await fn(response); - } - - const responseBody = await getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - let transformedBody = responseBody; - if (options.responseTransformer && response.ok) { - transformedBody = await options.responseTransformer(responseBody) - } - - const result: ApiResult = { - url, - ok: response.ok, - status: response.status, - statusText: response.statusText, - body: responseHeader ?? transformedBody, - }; - - catchErrorCodes(options, result); - - resolve(result.body); - } - } catch (error) { - reject(error); - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node/index.ts b/packages/openapi-ts-tests/test/generated/v3_node/index.ts deleted file mode 100644 index 50a1dd734..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_node/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export { ApiError } from './core/ApiError'; -export { CancelablePromise, CancelError } from './core/CancelablePromise'; -export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_node/sdk.gen.ts deleted file mode 100644 index f62288bcf..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_node/sdk.gen.ts +++ /dev/null @@ -1,913 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { CancelablePromise } from './core/CancelablePromise'; -import { OpenAPI } from './core/OpenAPI'; -import { request as __request } from './core/request'; -import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; - -export class CollectionFormatService { - /** - * @param data The data for the request. - * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) - * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) - * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) - * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) - * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) - * @throws ApiError - */ - public static collectionFormat(data: CollectionFormatData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/collectionFormat', - query: { - parameterArrayCSV: data.parameterArrayCsv, - parameterArraySSV: data.parameterArraySsv, - parameterArrayTSV: data.parameterArrayTsv, - parameterArrayPipes: data.parameterArrayPipes, - parameterArrayMulti: data.parameterArrayMulti - } - }); - } - -} - -export class ComplexService { - /** - * @param data The data for the request. - * @param data.parameterObject Parameter containing object - * @param data.parameterReference Parameter containing reference - * @returns ModelWithString Successful response - * @throws ApiError - */ - public static complexTypes(data: ComplexTypesData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/complex', - query: { - parameterObject: data.parameterObject, - parameterReference: data.parameterReference - }, - errors: { - 400: '400 `server` error', - 500: '500 server error' - } - }); - } - - /** - * @param data The data for the request. - * @param data.id - * @param data.requestBody - * @returns ModelWithString Success - * @throws ApiError - */ - public static complexParams(data: ComplexParamsData): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/complex/{id}', - path: { - id: data.id - }, - body: data.requestBody, - mediaType: 'application/json-patch+json' - }); - } - -} - -export class DefaultService { - /** - * @throws ApiError - */ - public static export(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public static patchApiNoTag(): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @param data The data for the request. - * @param data.requestBody - * @returns Model_From_Zendesk Success - * @returns ModelWithReadOnlyAndWriteOnly Default success response - * @throws ApiError - */ - public static import(data: ImportData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/no+tag', - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public static fooWow(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @param data The data for the request. - * @param data.fooParam foo in method - * @returns number Response is a simple number - * @throws ApiError - */ - public static getApiSimpleOperation(data: GetApiSimpleOperationData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple:operation', - path: { - foo_param: data.fooParam - }, - errors: { - default: 'Default error response' - } - }); - } - -} - -export class DefaultsService { - /** - * @param data The data for the request. - * @param data.parameterString This is a simple string with default value - * @param data.parameterNumber This is a simple number with default value - * @param data.parameterBoolean This is a simple boolean with default value - * @param data.parameterEnum This is a simple enum with default value - * @param data.parameterModel This is a simple model with default value - * @throws ApiError - */ - public static callWithDefaultParameters(data: CallWithDefaultParametersData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterString This is a simple string that is optional with default value - * @param data.parameterNumber This is a simple number that is optional with default value - * @param data.parameterBoolean This is a simple boolean that is optional with default value - * @param data.parameterEnum This is a simple enum that is optional with default value - * @param data.parameterModel This is a simple model that is optional with default value - * @throws ApiError - */ - public static callWithDefaultOptionalParameters(data: CallWithDefaultOptionalParametersData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterStringWithNoDefault This is a string with no default - * @param data.parameterOptionalStringWithDefault This is a optional string with default - * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default - * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default - * @param data.parameterStringWithDefault This is a string with default - * @param data.parameterStringWithEmptyDefault This is a string with empty default - * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default - * @param data.parameterStringNullableWithDefault This is a string that can be null with default - * @throws ApiError - */ - public static callToTestOrderOfParams(data: CallToTestOrderOfParamsData): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/defaults', - query: { - parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, - parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, - parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, - parameterStringWithDefault: data.parameterStringWithDefault, - parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, - parameterStringWithNoDefault: data.parameterStringWithNoDefault, - parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, - parameterStringNullableWithDefault: data.parameterStringNullableWithDefault - } - }); - } - -} - -export class DeprecatedService { - /** - * @deprecated - * @param data The data for the request. - * @param data.parameter This parameter is deprecated - * @throws ApiError - */ - public static deprecatedCall(data: DeprecatedCallData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/deprecated', - headers: { - parameter: data.parameter - } - }); - } - -} - -export class DescriptionsService { - /** - * @param data The data for the request. - * @param data.parameterWithBreaks Testing multiline comments in string: First line - * Second line - * - * Fourth line - * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work - * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work - * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work - * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work - * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work - * @throws ApiError - */ - public static callWithDescriptions(data: CallWithDescriptionsData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/descriptions/', - query: { - parameterWithBreaks: data.parameterWithBreaks, - parameterWithBackticks: data.parameterWithBackticks, - parameterWithSlashes: data.parameterWithSlashes, - parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders, - parameterWithQuotes: data.parameterWithQuotes, - parameterWithReservedCharacters: data.parameterWithReservedCharacters - } - }); - } - -} - -export class DuplicateService { - /** - * @throws ApiError - */ - public static duplicateName(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public static duplicateName1(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public static duplicateName2(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public static duplicateName3(): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/duplicate' - }); - } - -} - -export class ErrorService { - /** - * @param data The data for the request. - * @param data.status Status code to return - * @returns unknown Custom message: Successful response - * @throws ApiError - */ - public static testErrorCode(data: TestErrorCodeData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/error', - query: { - status: data.status - }, - errors: { - 500: 'Custom message: Internal Server Error', - 501: 'Custom message: Not Implemented', - 502: 'Custom message: Bad Gateway', - 503: 'Custom message: Service Unavailable' - } - }); - } - -} - -export class FileResponseService { - /** - * @param data The data for the request. - * @param data.id - * @returns binary Success - * @throws ApiError - */ - public static fileResponse(data: FileResponseData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/file/{id}', - path: { - id: data.id - } - }); - } - -} - -export class FormDataService { - /** - * @param data The data for the request. - * @param data.parameter This is a reusable parameter - * @param data.formData A reusable request body - * @throws ApiError - */ - public static postApiFormData(data: PostApiFormDataData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/formData/', - query: { - parameter: data.parameter - }, - formData: data.formData, - mediaType: 'multipart/form-data' - }); - } - -} - -export class HeaderService { - /** - * @returns string Successful response - * @throws ApiError - */ - public static callWithResultFromHeader(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/header', - responseHeader: 'operation-location', - errors: { - 400: '400 server error', - 500: '500 server error' - } - }); - } - -} - -export class MultipartService { - /** - * @param data The data for the request. - * @param data.formData - * @throws ApiError - */ - public static multipartRequest(data: MultipartRequestData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/multipart', - formData: data.formData, - mediaType: 'multipart/form-data' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public static multipartResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multipart' - }); - } - -} - -export class MultipleTags1Service { - /** - * @returns _400 - * @throws ApiError - */ - public static dummyA(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/a' - }); - } - - /** - * @returns void Success - * @throws ApiError - */ - public static dummyB(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class MultipleTags2Service { - /** - * @returns _400 - * @throws ApiError - */ - public static dummyA(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/a' - }); - } - - /** - * @returns void Success - * @throws ApiError - */ - public static dummyB(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class MultipleTags3Service { - /** - * @returns void Success - * @throws ApiError - */ - public static dummyB(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class NoContentService { - /** - * @returns void Success - * @throws ApiError - */ - public static callWithNoContentResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/no-content' - }); - } - - /** - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public static callWithResponseAndNoContentResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/response-and-no-content' - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - /** - * @param data The data for the request. - * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param - * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response - * @throws ApiError - */ - public static nonAsciiæøåÆøÅöôêÊ字符串(data: NonAsciiæøåÆøÅöôêÊ字符串Data): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - query: { - 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ - } - }); - } - - /** - * Login User - * @param data The data for the request. - * @param data.formData - * @throws ApiError - */ - public static putWithFormUrlEncoded(data: PutWithFormUrlEncodedData): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - formData: data.formData, - mediaType: 'application/x-www-form-urlencoded' - }); - } - -} - -export class ParametersService { - /** - * @param data The data for the request. - * @param data.fooParam foo in method - * @param data.barParam bar in method - * @param data.xFooBar Parameter with illegal characters - * @throws ApiError - */ - public static deleteFoo(data: DeleteFooData3): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - path: { - foo_param: data.fooParam, - BarParam: data.barParam - }, - headers: { - 'x-Foo-Bar': data.xFooBar - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the header - * @param data.fooAllOfEnum - * @param data.cursor This is the parameter that goes into the query params - * @param data.parameterCookie This is the parameter that goes into the cookie - * @param data.parameterPath This is the parameter that goes into the path - * @param data.requestBody This is the parameter that goes into the body - * @param data.fooRefEnum - * @throws ApiError - */ - public static callWithParameters(data: CallWithParametersData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/{parameterPath}', - path: { - parameterPath: data.parameterPath - }, - cookies: { - parameterCookie: data.parameterCookie - }, - headers: { - parameterHeader: data.parameterHeader - }, - query: { - foo_ref_enum: data.fooRefEnum, - foo_all_of_enum: data.fooAllOfEnum, - cursor: data.cursor - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the request header - * @param data.parameterQuery This is the parameter that goes into the request query params - * @param data.parameterCookie This is the parameter that goes into the cookie - * @param data.requestBody This is the parameter that goes into the body - * @param data.parameterPath1 This is the parameter that goes into the path - * @param data.parameterPath2 This is the parameter that goes into the path - * @param data.parameterPath3 This is the parameter that goes into the path - * @param data._default This is the parameter with a reserved keyword - * @throws ApiError - */ - public static callWithWeirdParameterNames(data: CallWithWeirdParameterNamesData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - path: { - 'parameter.path.1': data.parameterPath1, - 'parameter-path-2': data.parameterPath2, - 'PARAMETER-PATH-3': data.parameterPath3 - }, - cookies: { - 'PARAMETER-COOKIE': data.parameterCookie - }, - headers: { - 'parameter.header': data.parameterHeader - }, - query: { - default: data._default, - 'parameter-query': data.parameterQuery - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.requestBody This is a required parameter - * @param data.page This is an optional parameter - * @throws ApiError - */ - public static getCallWithOptionalParam(data: GetCallWithOptionalParamData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/parameters/', - query: { - page: data.page - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.parameter This is a required parameter - * @param data.requestBody This is an optional parameter - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public static postCallWithOptionalParam(data: PostCallWithOptionalParamData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/', - query: { - parameter: data.parameter - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - -} - -export class RequestBodyService { - /** - * @param data The data for the request. - * @param data.parameter This is a reusable parameter - * @param data.foo A reusable request body - * @throws ApiError - */ - public static postApiRequestBody(data: PostApiRequestBodyData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/requestBody/', - query: { - parameter: data.parameter - }, - body: data.foo, - mediaType: 'application/json' - }); - } - -} - -export class ResponseService { - /** - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public static callWithResponseAndNoContentResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/response-and-no-content' - }); - } - - /** - * @returns import - * @throws ApiError - */ - public static callWithResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/response' - }); - } - - /** - * @returns unknown Message for 200 response - * @returns ModelWithString Message for 201 response - * @returns ModelWithString Message for 202 response - * @throws ApiError - */ - public static callWithDuplicateResponses(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/response', - errors: { - 500: 'Message for 500 error', - 501: 'Message for 501 error', - 502: 'Message for 502 error', - '4XX': 'Message for 4XX errors', - default: 'Default error response' - } - }); - } - - /** - * @returns unknown Message for 200 response - * @returns ModelThatExtends Message for 201 response - * @returns ModelThatExtendsExtends Message for 202 response - * @throws ApiError - */ - public static callWithResponses(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/response', - errors: { - 500: 'Message for 500 error', - 501: 'Message for 501 error', - 502: 'Message for 502 error', - default: 'Message for default response' - } - }); - } - -} - -export class SimpleService { - /** - * @returns Model_From_Zendesk Success - * @throws ApiError - */ - public static apiVVersionODataControllerCount(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple/$count' - }); - } - - /** - * @throws ApiError - */ - public static getCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static putCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static postCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static deleteCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static optionsCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'OPTIONS', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static headCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'HEAD', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static patchCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v{api-version}/simple' - }); - } - -} - -export class TypesService { - /** - * @param data The data for the request. - * @param data.parameterArray This is an array parameter - * @param data.parameterDictionary This is a dictionary parameter - * @param data.parameterEnum This is an enum parameter - * @param data.parameterTuple This is tuple parameter - * @param data.parameterNumber This is a number parameter - * @param data.parameterString This is a string parameter - * @param data.parameterBoolean This is a boolean parameter - * @param data.parameterObject This is an object parameter - * @param data.id This is a number parameter - * @returns number Response is a simple number - * @returns string Response is a simple string - * @returns boolean Response is a simple boolean - * @returns unknown Response is a simple object - * @throws ApiError - */ - public static types(data: TypesData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/types', - path: { - id: data.id - }, - query: { - parameterNumber: data.parameterNumber, - parameterString: data.parameterString, - parameterBoolean: data.parameterBoolean, - parameterObject: data.parameterObject, - parameterArray: data.parameterArray, - parameterDictionary: data.parameterDictionary, - parameterEnum: data.parameterEnum, - parameterTuple: data.parameterTuple - } - }); - } - -} - -export class UploadService { - /** - * @param data The data for the request. - * @param data.formData - * @returns boolean - * @throws ApiError - */ - public static uploadFile(data: UploadFileData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/upload', - formData: data.formData, - mediaType: 'application/x-www-form-urlencoded' - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_node/types.gen.ts deleted file mode 100644 index d20c92660..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_node/types.gen.ts +++ /dev/null @@ -1,1537 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _3e_num_1Период = 'Bird' | 'Dog'; - -export const _3e_num_1Период = { - BIRD: 'Bird', - DOG: 'Dog' -} as const; - -/** - * Model with number-only name - */ -export type _400 = string; - -export type _default = { - name?: string; -}; - -/** - * Model with restricted keyword name - */ -export type _import = string; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: (number) | undefined; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AnyOfAnyAndNull = { - data?: (unknown | null); -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<({ - foo?: string; -} | { - bar?: string; -})>; -}; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<({ - foo?: string; -} | { - bar?: string; -})>; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array<(boolean)>; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array<(number)>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: camelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array<(string)>; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type camelCaseCommentWithBreaks = number; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - firstName: string; - lastname: string; - age: number; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: (({ - boolean?: boolean; -} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: (Array<(_3e_num_1Период | ConstValue)> | null); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(number | string)>; -}); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: ParameterSimpleParameter; -} | { - bar: NonAsciiStringæøåÆØÅöôêÊ字符串; -}) & { - baz: (number) | null; - qux: number; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(boolean)>; -}); -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: (boolean | { - [key: string]: (number); -}); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; - -export type ConstValue = "ConstValue"; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: (string); - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: (string | number | boolean) | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: (string); -}; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple enum with numbers - */ -export const EnumWithExtensions = { - /** - * Used when the status of something is successful - */ - CUSTOM_SUCCESS: 200, - /** - * Used when the status of something has a warning - */ - CUSTOM_WARNING: 400, - /** - * Used when the status of something has an error - */ - CUSTOM_ERROR: 500 -} as const; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * This is a simple enum with numbers - */ -export const EnumWithNumbers = { - '_1': 1, - '_2': 2, - '_3': 3, - '_1.1': 1.1, - '_1.2': 1.2, - '_1.3': 1.3, - '_100': 100, - '_200': 200, - '_300': 300, - '_-100': -100, - '_-200': -200, - '_-300': -300, - '_-1.1': -1.1, - '_-1.2': -1.2, - '_-1.3': -1.3 -} as const; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -export const EnumWithReplacedCharacters = { - _SINGLE_QUOTE_: "'Single Quote'", - _DOUBLE_QUOTES_: '"Double Quotes"', - 'ØÆÅÔÖ_ØÆÅÔÖ字符串': 'øæåôöØÆÅÔÖ字符串', - '_3.1': 3.1, - EMPTY_STRING: '' -} as const; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with strings - */ -export const EnumWithStrings = { - SUCCESS: 'Success', - WARNING: 'Warning', - ERROR: 'Error', - _SINGLE_QUOTE_: "'Single Quote'", - _DOUBLE_QUOTES_: '"Double Quotes"', - 'NON_ASCII__ØÆÅÔÖ_ØÆÅÔÖ字符串': 'Non-ascii: øæåôöØÆÅÔÖ字符串' -} as const; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -export const EnumWithXEnumNames = { - zero: 0, - one: 1, - two: 2 -} as const; - -export type File = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { - item?: boolean; - error?: (string) | null; - readonly hasError?: boolean; - data?: { - [key: string]: unknown; - }; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_String_ = { - item?: (string) | null; - error?: (string) | null; - readonly hasError?: boolean; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type Model_From_Zendesk = string; - -/** - * Circle - */ -export type ModelCircle = { - kind: 'circle'; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: 'square'; - sideLength?: number; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string; -}; - -export type ModelWithAnyOfConstantSizeArray = [ - (number | string), - (number | string), - (number | string) -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - (number & string), - (number & string) -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - ((number) | null | string), - ((number) | null | string), - ((number) | null | string) -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - (number | _import), - (number | _import) -]; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnly = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -export type ModelWithConst = { - String?: "String"; - number?: 0; - null?: null; - withType?: "Some string"; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: (string); - }; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: boolean; -}; - -/** - * This is a simple enum with strings - */ -export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - -/** - * This is a simple enum with strings - */ -export const foo_bar_enum = { - SUCCESS: 'Success', - WARNING: 'Warning', - ERROR: 'Error', - 'ØÆÅ字符串': 'ØÆÅ字符串' -} as const; - -/** - * These are the HTTP error code enums - */ -export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - -/** - * These are the HTTP error code enums - */ -export const statusCode = { - _100: '100', - _200_FOO: '200 FOO', - _300_FOO_BAR: '300 FOO_BAR', - _400_FOO_BAR: '400 foo-bar', - _500_FOO_BAR: '500 foo.bar', - _600_FOO_BAR: '600 foo&bar' -} as const; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -export type foo_bar_baz_qux = '3.0'; - -export const foo_bar_baz_qux = { - _3_0: '3.0' -} as const; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array<(string)>; - data?: (ModelWithNestedArrayEnumsData); -}; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export const ModelWithNestedArrayEnumsDataBar = { - BAZ: 'baz', - QUX: 'qux' -} as const; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export const ModelWithNestedArrayEnumsDataFoo = { - FOO: 'foo', - BAR: 'bar' -} as const; - -export type ModelWithNestedCompositionEnums = { - foo?: (ModelWithNestedArrayEnumsDataFoo); -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: ('Success' | 'Warning' | 'Error'); - }; - dictionaryWithEnumFromDescription?: { - [key: string]: (number); - }; - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; - arrayWithDescription?: Array<(number)>; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedProperties = { - readonly first: { - readonly second: { - readonly third: (string) | null; - } | null; - } | null; -}; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: (string) | null; - /** - * This is a simple string property - */ - nullableProp2?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: (string) | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Период - */ -export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; - -/** - * Период - */ -export const value = { - '_-10': -10, - '_-1': -1, - '_0': 0, - '_1': 1, - '_3': 3, - '_6': 6, - '_12': 12 -} as const; - -export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { - baz: (number) | null; - qux: number; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - (string), - (string) - ]; - foo: 'Corge'; -}; - -export type foo = 'Bar'; - -export const foo = { - BAR: 'Bar' -} as const; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPattern = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - (number | string), - string -]; - -/** - * This is a model with one nested property - */ -export type ModelWithProperties = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: (string) | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -export type ModelWithReadOnlyAndWriteOnly = { - foo: string; - readonly bar: string; - baz: string; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReference = { - prop?: ModelWithProperties; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: (Array<(string | boolean)> | null); -}; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array<(string)>; -}; - -/** - * This is a reusable parameter - */ -export type ParameterSimpleParameter = string; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Parameter with illegal characters - */ -export type Parameterx_Foo_Bar = ModelWithString; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<({ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; -})>; -}; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple file - */ -export type SimpleFile = (Blob | File); - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = (string) | null; - -export type CollectionFormatData = { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCsv: Array<(string)> | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array<(string)> | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array<(string)> | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySsv: Array<(string)> | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTsv: Array<(string)> | null; -}; - -export type ComplexTypesData = { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; -}; - -export type ComplexTypesResponse = (Array); - -export type ComplexParamsData = { - id: number; - requestBody?: { - readonly key: (string) | null; - name: (string) | null; - enabled?: boolean; - readonly type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array<(string)> | null; - parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); - readonly user?: { - readonly id?: number; - readonly name?: (string) | null; - }; - }; -}; - -export type ComplexParamsResponse = (ModelWithString); - -export type PatchApiNoTagResponse = (unknown); - -export type ImportData = { - requestBody: (ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly); -}; - -export type ImportResponse = (Model_From_Zendesk | ModelWithReadOnlyAndWriteOnly); - -export type FooWowResponse = (unknown); - -export type GetApiSimpleOperationData = { - /** - * foo in method - */ - fooParam: string; -}; - -export type GetApiSimpleOperationResponse = (number); - -export type CallWithDefaultParametersData = { - /** - * This is a simple boolean with default value - */ - parameterBoolean?: (boolean) | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: (ModelWithString) | null; - /** - * This is a simple number with default value - */ - parameterNumber?: (number) | null; - /** - * This is a simple string with default value - */ - parameterString?: (string) | null; -}; - -export type CallWithDefaultOptionalParametersData = { - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; -}; - -export type CallToTestOrderOfParamsData = { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: (string) | null; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: (string) | null; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; -}; - -export type DeprecatedCallData = { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: (DeprecatedModel) | null; -}; - -export type CallWithDescriptionsData = { - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: unknown; - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: unknown; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: unknown; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: unknown; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: unknown; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: unknown; -}; - -export type TestErrorCodeData = { - /** - * Status code to return - */ - status: number; -}; - -export type TestErrorCodeResponse = (unknown); - -export type FileResponseData = { - id: string; -}; - -export type FileResponseResponse = ((Blob | File)); - -export type PostApiFormDataData = { - /** - * A reusable request body - */ - formData?: ModelWithString; - /** - * This is a reusable parameter - */ - parameter?: string; -}; - -export type CallWithResultFromHeaderResponse = (string); - -export type MultipartRequestData = { - formData?: { - content?: (Blob | File); - data?: ((ModelWithString) | null); - }; -}; - -export type MultipartResponseResponse = ({ - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; -}); - -export type DummyAResponse = (_400); - -export type DummyBResponse = (void); - -export type CallWithNoContentResponseResponse = (void); - -export type CallWithResponseAndNoContentResponseResponse = (number | void); - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - /** - * Dummy input param - */ - nonAsciiParamæøåÆøÅöôêÊ: number; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = (Array); - -export type PutWithFormUrlEncodedData = { - formData: ArrayWithStrings; -}; - -export type DeleteFooData3 = { - /** - * bar in method - */ - barParam: string; - /** - * foo in method - */ - fooParam: string; - /** - * Parameter with illegal characters - */ - xFooBar: ModelWithString; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the query params - */ - cursor: (string) | null; - fooAllOfEnum: (ModelWithNestedArrayEnumsDataFoo); - fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the cookie - */ - parameterCookie: (string) | null; - /** - * This is the parameter that goes into the header - */ - parameterHeader: (string) | null; - /** - * This is the parameter that goes into the path - */ - parameterPath: (string) | null; - /** - * This is the parameter that goes into the body - */ - requestBody: { - [key: string]: unknown; - } | null; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter with a reserved keyword - */ - _default?: string; - /** - * This is the parameter that goes into the cookie - */ - parameterCookie: (string) | null; - /** - * This is the parameter that goes into the request header - */ - parameterHeader: (string) | null; - /** - * This is the parameter that goes into the path - */ - parameterPath1?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath2?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath3?: string; - /** - * This is the parameter that goes into the request query params - */ - parameterQuery: (string) | null; - /** - * This is the parameter that goes into the body - */ - requestBody: (ModelWithString) | null; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - page?: number; - /** - * This is a required parameter - */ - requestBody: ModelWithOneOfEnum; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is a required parameter - */ - parameter: Pageable; - /** - * This is an optional parameter - */ - requestBody?: { - offset?: (number) | null; - }; -}; - -export type PostCallWithOptionalParamResponse = (number | void); - -export type PostApiRequestBodyData = { - /** - * A reusable request body - */ - foo?: ModelWithString; - /** - * This is a reusable parameter - */ - parameter?: string; -}; - -export type CallWithResponseResponse = (_import); - -export type CallWithDuplicateResponsesResponse = ((ModelWithBoolean & ModelWithInteger) | ModelWithString); - -export type CallWithResponsesResponse = ({ - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; -} | ModelThatExtends | ModelThatExtendsExtends); - -export type ApiVVersionODataControllerCountResponse = (Model_From_Zendesk); - -export type TypesData = { - /** - * This is a number parameter - */ - id?: number; - /** - * This is an array parameter - */ - parameterArray: Array<(string)> | null; - /** - * This is a boolean parameter - */ - parameterBoolean: (boolean) | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: ('Success' | 'Warning' | 'Error') | null; - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is a string parameter - */ - parameterString: (string) | null; - /** - * This is tuple parameter - */ - parameterTuple: [ - number, - number, - number, - number - ]; -}; - -export type TypesResponse = (number | string | boolean | { - [key: string]: unknown; -}); - -export type UploadFileData = { - formData: (Blob | File); -}; - -export type UploadFileResponse = (boolean); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiError.ts deleted file mode 100644 index 36675d288..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiError.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: unknown; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiRequestOptions.ts deleted file mode 100644 index 939a0aa4c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiRequestOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type ApiRequestOptions = { - readonly body?: any; - readonly cookies?: Record; - readonly errors?: Record; - readonly formData?: Record | any[] | Blob | File; - readonly headers?: Record; - readonly mediaType?: string; - readonly method: - | 'DELETE' - | 'GET' - | 'HEAD' - | 'OPTIONS' - | 'PATCH' - | 'POST' - | 'PUT'; - readonly path?: Record; - readonly query?: Record; - readonly responseHeader?: string; - readonly responseTransformer?: (data: unknown) => Promise; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiResult.ts deleted file mode 100644 index 4c58e3913..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_node_transform/core/ApiResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ApiResult = { - readonly body: TData; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node_transform/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_node_transform/core/CancelablePromise.ts deleted file mode 100644 index ccc082e8f..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_node_transform/core/CancelablePromise.ts +++ /dev/null @@ -1,126 +0,0 @@ -export class CancelError extends Error { - constructor(message: string) { - super(message); - this.name = 'CancelError'; - } - - public get isCancelled(): boolean { - return true; - } -} - -export interface OnCancel { - readonly isResolved: boolean; - readonly isRejected: boolean; - readonly isCancelled: boolean; - - (cancelHandler: () => void): void; -} - -export class CancelablePromise implements Promise { - private _isResolved: boolean; - private _isRejected: boolean; - private _isCancelled: boolean; - readonly cancelHandlers: (() => void)[]; - readonly promise: Promise; - private _resolve?: (value: T | PromiseLike) => void; - private _reject?: (reason?: unknown) => void; - - constructor( - executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: unknown) => void, - onCancel: OnCancel - ) => void - ) { - this._isResolved = false; - this._isRejected = false; - this._isCancelled = false; - this.cancelHandlers = []; - this.promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - - const onResolve = (value: T | PromiseLike): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isResolved = true; - if (this._resolve) this._resolve(value); - }; - - const onReject = (reason?: unknown): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isRejected = true; - if (this._reject) this._reject(reason); - }; - - const onCancel = (cancelHandler: () => void): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this.cancelHandlers.push(cancelHandler); - }; - - Object.defineProperty(onCancel, 'isResolved', { - get: (): boolean => this._isResolved, - }); - - Object.defineProperty(onCancel, 'isRejected', { - get: (): boolean => this._isRejected, - }); - - Object.defineProperty(onCancel, 'isCancelled', { - get: (): boolean => this._isCancelled, - }); - - return executor(onResolve, onReject, onCancel as OnCancel); - }); - } - - get [Symbol.toStringTag]() { - return "Cancellable Promise"; - } - - public then( - onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null - ): Promise { - return this.promise.then(onFulfilled, onRejected); - } - - public catch( - onRejected?: ((reason: unknown) => TResult | PromiseLike) | null - ): Promise { - return this.promise.catch(onRejected); - } - - public finally(onFinally?: (() => void) | null): Promise { - return this.promise.finally(onFinally); - } - - public cancel(): void { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isCancelled = true; - if (this.cancelHandlers.length) { - try { - for (const cancelHandler of this.cancelHandlers) { - cancelHandler(); - } - } catch (error) { - console.warn('Cancellation threw an error', error); - return; - } - } - this.cancelHandlers.length = 0; - if (this._reject) this._reject(new CancelError('Request aborted')); - } - - public get isCancelled(): boolean { - return this._isCancelled; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node_transform/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_node_transform/core/OpenAPI.ts deleted file mode 100644 index 90c96f9a3..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_node_transform/core/OpenAPI.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { RequestInit, Response } from 'node-fetch'; -import type { ApiRequestOptions } from './ApiRequestOptions'; - -type Headers = Record; -type Middleware = (value: T) => T | Promise; -type Resolver = (options: ApiRequestOptions) => Promise; - -export class Interceptors { - _fns: Middleware[]; - - constructor() { - this._fns = []; - } - - eject(fn: Middleware): void { - const index = this._fns.indexOf(fn); - if (index !== -1) { - this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; - } - } - - use(fn: Middleware): void { - this._fns = [...this._fns, fn]; - } -} - -export type OpenAPIConfig = { - BASE: string; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - ENCODE_PATH?: ((path: string) => string) | undefined; - HEADERS?: Headers | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - VERSION: string; - WITH_CREDENTIALS: boolean; - interceptors: { - request: Interceptors; - response: Interceptors; - }; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: 'http://localhost:3000/base', - CREDENTIALS: 'include', - ENCODE_PATH: undefined, - HEADERS: undefined, - PASSWORD: undefined, - TOKEN: undefined, - USERNAME: undefined, - VERSION: '1.0', - WITH_CREDENTIALS: false, - interceptors: { - request: new Interceptors(), - response: new Interceptors(), - }, -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node_transform/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_node_transform/core/request.ts deleted file mode 100644 index fa1ed3862..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_node_transform/core/request.ts +++ /dev/null @@ -1,350 +0,0 @@ -import fetch, { FormData, Headers } from 'node-fetch'; -import type { RequestInit, Response } from 'node-fetch'; - -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import { CancelablePromise } from './CancelablePromise'; -import type { OnCancel } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const isString = (value: unknown): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: any): value is Blob => { - return value instanceof Blob; -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const encodePair = (key: string, value: unknown) => { - if (value === undefined || value === null) { - return; - } - - if (value instanceof Date) { - append(key, value.toISOString()); - } else if (Array.isArray(value)) { - value.forEach(v => encodePair(key, v)); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); - } else { - append(key, value); - } - }; - - Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - - return qs.length ? `?${qs.join('&')}` : ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = config.BASE + path; - return options.query ? url + getQueryString(options.query) : url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([, value]) => value !== undefined && value !== null) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { - const [token, username, password, additionalHeaders] = await Promise.all([ - // @ts-ignore - resolve(options, config.TOKEN), - // @ts-ignore - resolve(options, config.USERNAME), - // @ts-ignore - resolve(options, config.PASSWORD), - // @ts-ignore - resolve(options, config.HEADERS), - ]); - - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - }) - .filter(([, value]) => value !== undefined && value !== null) - .reduce((headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), {} as Record); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return new Headers(headers); -}; - -export const getRequestBody = (options: ApiRequestOptions): unknown => { - if (options.body !== undefined) { - if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { - return JSON.stringify(options.body); - } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; -}; - -export const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: any, - formData: FormData | undefined, - headers: Headers, - onCancel: OnCancel -): Promise => { - const controller = new AbortController(); - - let request: RequestInit = { - headers, - body: body ?? formData, - method: options.method, - signal: controller.signal, - }; - - - for (const fn of config.interceptors.request._fns) { - request = await fn(request); - } - - onCancel(() => controller.abort()); - - return await fetch(url, request); -}; - -export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { - if (responseHeader) { - const content = response.headers.get(responseHeader); - if (isString(content)) { - return content; - } - } - return undefined; -}; - -export const getResponseBody = async (response: Response): Promise => { - if (response.status !== 204) { - try { - const contentType = response.headers.get('Content-Type'); - if (contentType) { - const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; - if (contentType.includes('application/json') || contentType.includes('+json')) { - return await response.json(); - } else if (binaryTypes.some(type => contentType.includes(type))) { - return await response.blob(); - } else if (contentType.includes('multipart/form-data')) { - return await response.formData(); - } else if (contentType.includes('text/')) { - return await response.text(); - } - } - } catch (error) { - console.error(error); - } - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 405: 'Method Not Allowed', - 406: 'Not Acceptable', - 407: 'Proxy Authentication Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Payload Too Large', - 414: 'URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Range Not Satisfiable', - 417: 'Expectation Failed', - 418: 'Im a teapot', - 421: 'Misdirected Request', - 422: 'Unprocessable Content', - 423: 'Locked', - 424: 'Failed Dependency', - 425: 'Too Early', - 426: 'Upgrade Required', - 428: 'Precondition Required', - 429: 'Too Many Requests', - 431: 'Request Header Fields Too Large', - 451: 'Unavailable For Legal Reasons', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported', - 506: 'Variant Also Negotiates', - 507: 'Insufficient Storage', - 508: 'Loop Detected', - 510: 'Not Extended', - 511: 'Network Authentication Required', - ...options.errors, - } - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError(options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ -export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options); - - if (!onCancel.isCancelled) { - let response = await sendRequest(config, options, url, body, formData, headers, onCancel); - - for (const fn of config.interceptors.response._fns) { - response = await fn(response); - } - - const responseBody = await getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - let transformedBody = responseBody; - if (options.responseTransformer && response.ok) { - transformedBody = await options.responseTransformer(responseBody) - } - - const result: ApiResult = { - url, - ok: response.ok, - status: response.status, - statusText: response.statusText, - body: responseHeader ?? transformedBody, - }; - - catchErrorCodes(options, result); - - resolve(result.body); - } - } catch (error) { - reject(error); - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node_transform/index.ts b/packages/openapi-ts-tests/test/generated/v3_node_transform/index.ts deleted file mode 100644 index 50a1dd734..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_node_transform/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export { ApiError } from './core/ApiError'; -export { CancelablePromise, CancelError } from './core/CancelablePromise'; -export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node_transform/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_node_transform/sdk.gen.ts deleted file mode 100644 index 5211e9979..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_node_transform/sdk.gen.ts +++ /dev/null @@ -1,80 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { CancelablePromise } from './core/CancelablePromise'; -import { OpenAPI } from './core/OpenAPI'; -import { request as __request } from './core/request'; -import { type ParentModelWithDatesResponse, type ModelWithDatesResponse, type ModelWithDatesArrayResponse, type ArrayOfDatesResponse, type DateResponse, type MultipleResponsesResponse, ParentModelWithDatesResponseTransformer, ModelWithDatesResponseTransformer, ModelWithDatesArrayResponseTransformer } from './types.gen'; - -export class DefaultService { - /** - * @returns ParentModelWithDates Success - * @returns unknown Success - * @throws ApiError - */ - public static parentModelWithDates(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/model-with-dates', - responseTransformer: ParentModelWithDatesResponseTransformer - }); - } - - /** - * @returns ModelWithDates Success - * @throws ApiError - */ - public static modelWithDates(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/model-with-dates', - responseTransformer: ModelWithDatesResponseTransformer - }); - } - - /** - * @returns ModelWithDates Success - * @throws ApiError - */ - public static modelWithDatesArray(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/model-with-dates-array', - responseTransformer: ModelWithDatesArrayResponseTransformer - }); - } - - /** - * @returns string Success - * @throws ApiError - */ - public static arrayOfDates(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/array-of-dates' - }); - } - - /** - * @returns string Success - * @throws ApiError - */ - public static date(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/date' - }); - } - - /** - * @returns ModelWithDates Updated - * @returns SimpleModel Created - * @throws ApiError - */ - public static multipleResponses(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/multiple-responses' - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_node_transform/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_node_transform/types.gen.ts deleted file mode 100644 index 8c9227850..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_node_transform/types.gen.ts +++ /dev/null @@ -1,106 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * This is a model that contains a some dates - */ -export type ModelWithDates = { - id: number; - name: string; - readonly enabled: boolean; - readonly modified: Date; - readonly expires?: Date; -}; - -/** - * This is a model that contains a some dates and arrays - */ -export type ParentModelWithDates = { - id: number; - readonly modified?: Date; - items?: Array; - item?: ModelWithDates; - 'nullable-date'?: Array<(Date | null)>; - simpleItems?: Array; - simpleItem?: SimpleModel; - dates?: Array<(Date)>; - strings?: Array<(string)>; -}; - -/** - * This is a model that contains a some dates - */ -export type SimpleModel = { - id: number; - name: string; - readonly enabled: boolean; -}; - -export type ParentModelWithDatesResponse = (ParentModelWithDates | unknown); - -export type ModelWithDatesResponse = (ModelWithDates); - -export type ModelWithDatesArrayResponse = (Array); - -export type ArrayOfDatesResponse = (Array<(Date)>); - -export type DateResponse = (Date); - -export type MultipleResponsesResponse = (Array | Array); - -export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; - -export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; - -export type ModelWithDatesModelResponseTransformer = (data: any) => ModelWithDates; - -export const ModelWithDatesModelResponseTransformer: ModelWithDatesModelResponseTransformer = data => { - if (data?.modified) { - data.modified = new Date(data.modified); - } - if (data?.expires) { - data.expires = new Date(data.expires); - } - return data; -}; - -export const ParentModelWithDatesModelResponseTransformer: ParentModelWithDatesModelResponseTransformer = data => { - if (data?.modified) { - data.modified = new Date(data.modified); - } - if (Array.isArray(data?.items)) { - data.items.forEach(ModelWithDatesModelResponseTransformer); - } - if (data?.item) { - ModelWithDatesModelResponseTransformer(data.item); - } - if (Array.isArray(data?.['nullable-date'])) { - data['nullable-date'] = data['nullable-date'].map(item => item ? new Date(item) : item); - } - if (Array.isArray(data?.dates)) { - data.dates = data.dates.map(item => item ? new Date(item) : item); - } - return data; -}; - -export const ParentModelWithDatesResponseTransformer: ParentModelWithDatesResponseTransformer = async (data) => { - if (data) { - ParentModelWithDatesModelResponseTransformer(data); - } - return data; -}; - -export type ModelWithDatesResponseTransformer = (data: any) => Promise; - -export const ModelWithDatesResponseTransformer: ModelWithDatesResponseTransformer = async (data) => { - ModelWithDatesModelResponseTransformer(data); - return data; -}; - -export type ModelWithDatesArrayResponseTransformer = (data: any) => Promise; - -export const ModelWithDatesArrayResponseTransformer: ModelWithDatesArrayResponseTransformer = async (data) => { - if (Array.isArray(data)) { - data.forEach(ModelWithDatesModelResponseTransformer); - } - return data; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_options/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_options/core/ApiError.ts deleted file mode 100644 index 36675d288..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_options/core/ApiError.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: unknown; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_options/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_options/core/ApiRequestOptions.ts deleted file mode 100644 index 939a0aa4c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_options/core/ApiRequestOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type ApiRequestOptions = { - readonly body?: any; - readonly cookies?: Record; - readonly errors?: Record; - readonly formData?: Record | any[] | Blob | File; - readonly headers?: Record; - readonly mediaType?: string; - readonly method: - | 'DELETE' - | 'GET' - | 'HEAD' - | 'OPTIONS' - | 'PATCH' - | 'POST' - | 'PUT'; - readonly path?: Record; - readonly query?: Record; - readonly responseHeader?: string; - readonly responseTransformer?: (data: unknown) => Promise; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_options/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_options/core/ApiResult.ts deleted file mode 100644 index 4c58e3913..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_options/core/ApiResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ApiResult = { - readonly body: TData; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_options/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_options/core/CancelablePromise.ts deleted file mode 100644 index ccc082e8f..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_options/core/CancelablePromise.ts +++ /dev/null @@ -1,126 +0,0 @@ -export class CancelError extends Error { - constructor(message: string) { - super(message); - this.name = 'CancelError'; - } - - public get isCancelled(): boolean { - return true; - } -} - -export interface OnCancel { - readonly isResolved: boolean; - readonly isRejected: boolean; - readonly isCancelled: boolean; - - (cancelHandler: () => void): void; -} - -export class CancelablePromise implements Promise { - private _isResolved: boolean; - private _isRejected: boolean; - private _isCancelled: boolean; - readonly cancelHandlers: (() => void)[]; - readonly promise: Promise; - private _resolve?: (value: T | PromiseLike) => void; - private _reject?: (reason?: unknown) => void; - - constructor( - executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: unknown) => void, - onCancel: OnCancel - ) => void - ) { - this._isResolved = false; - this._isRejected = false; - this._isCancelled = false; - this.cancelHandlers = []; - this.promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - - const onResolve = (value: T | PromiseLike): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isResolved = true; - if (this._resolve) this._resolve(value); - }; - - const onReject = (reason?: unknown): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isRejected = true; - if (this._reject) this._reject(reason); - }; - - const onCancel = (cancelHandler: () => void): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this.cancelHandlers.push(cancelHandler); - }; - - Object.defineProperty(onCancel, 'isResolved', { - get: (): boolean => this._isResolved, - }); - - Object.defineProperty(onCancel, 'isRejected', { - get: (): boolean => this._isRejected, - }); - - Object.defineProperty(onCancel, 'isCancelled', { - get: (): boolean => this._isCancelled, - }); - - return executor(onResolve, onReject, onCancel as OnCancel); - }); - } - - get [Symbol.toStringTag]() { - return "Cancellable Promise"; - } - - public then( - onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null - ): Promise { - return this.promise.then(onFulfilled, onRejected); - } - - public catch( - onRejected?: ((reason: unknown) => TResult | PromiseLike) | null - ): Promise { - return this.promise.catch(onRejected); - } - - public finally(onFinally?: (() => void) | null): Promise { - return this.promise.finally(onFinally); - } - - public cancel(): void { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isCancelled = true; - if (this.cancelHandlers.length) { - try { - for (const cancelHandler of this.cancelHandlers) { - cancelHandler(); - } - } catch (error) { - console.warn('Cancellation threw an error', error); - return; - } - } - this.cancelHandlers.length = 0; - if (this._reject) this._reject(new CancelError('Request aborted')); - } - - public get isCancelled(): boolean { - return this._isCancelled; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_options/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_options/core/OpenAPI.ts deleted file mode 100644 index 144e25744..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_options/core/OpenAPI.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; - -type Headers = Record; -type Middleware = (value: T) => T | Promise; -type Resolver = (options: ApiRequestOptions) => Promise; - -export class Interceptors { - _fns: Middleware[]; - - constructor() { - this._fns = []; - } - - eject(fn: Middleware): void { - const index = this._fns.indexOf(fn); - if (index !== -1) { - this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; - } - } - - use(fn: Middleware): void { - this._fns = [...this._fns, fn]; - } -} - -export type OpenAPIConfig = { - BASE: string; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - ENCODE_PATH?: ((path: string) => string) | undefined; - HEADERS?: Headers | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - VERSION: string; - WITH_CREDENTIALS: boolean; - interceptors: { - request: Interceptors; - response: Interceptors; - }; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: 'http://localhost:3000/base', - CREDENTIALS: 'include', - ENCODE_PATH: undefined, - HEADERS: undefined, - PASSWORD: undefined, - TOKEN: undefined, - USERNAME: undefined, - VERSION: '1.0', - WITH_CREDENTIALS: false, - interceptors: { - request: new Interceptors(), - response: new Interceptors(), - }, -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_options/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_options/core/request.ts deleted file mode 100644 index 5458a2899..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_options/core/request.ts +++ /dev/null @@ -1,350 +0,0 @@ -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import { CancelablePromise } from './CancelablePromise'; -import type { OnCancel } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const isString = (value: unknown): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: any): value is Blob => { - return value instanceof Blob; -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const encodePair = (key: string, value: unknown) => { - if (value === undefined || value === null) { - return; - } - - if (value instanceof Date) { - append(key, value.toISOString()); - } else if (Array.isArray(value)) { - value.forEach(v => encodePair(key, v)); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); - } else { - append(key, value); - } - }; - - Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - - return qs.length ? `?${qs.join('&')}` : ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = config.BASE + path; - return options.query ? url + getQueryString(options.query) : url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([, value]) => value !== undefined && value !== null) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { - const [token, username, password, additionalHeaders] = await Promise.all([ - // @ts-ignore - resolve(options, config.TOKEN), - // @ts-ignore - resolve(options, config.USERNAME), - // @ts-ignore - resolve(options, config.PASSWORD), - // @ts-ignore - resolve(options, config.HEADERS), - ]); - - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - }) - .filter(([, value]) => value !== undefined && value !== null) - .reduce((headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), {} as Record); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return new Headers(headers); -}; - -export const getRequestBody = (options: ApiRequestOptions): unknown => { - if (options.body !== undefined) { - if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { - return JSON.stringify(options.body); - } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; -}; - -export const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: any, - formData: FormData | undefined, - headers: Headers, - onCancel: OnCancel -): Promise => { - const controller = new AbortController(); - - let request: RequestInit = { - headers, - body: body ?? formData, - method: options.method, - signal: controller.signal, - }; - - if (config.WITH_CREDENTIALS) { - request.credentials = config.CREDENTIALS; - } - - for (const fn of config.interceptors.request._fns) { - request = await fn(request); - } - - onCancel(() => controller.abort()); - - return await fetch(url, request); -}; - -export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { - if (responseHeader) { - const content = response.headers.get(responseHeader); - if (isString(content)) { - return content; - } - } - return undefined; -}; - -export const getResponseBody = async (response: Response): Promise => { - if (response.status !== 204) { - try { - const contentType = response.headers.get('Content-Type'); - if (contentType) { - const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; - if (contentType.includes('application/json') || contentType.includes('+json')) { - return await response.json(); - } else if (binaryTypes.some(type => contentType.includes(type))) { - return await response.blob(); - } else if (contentType.includes('multipart/form-data')) { - return await response.formData(); - } else if (contentType.includes('text/')) { - return await response.text(); - } - } - } catch (error) { - console.error(error); - } - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 405: 'Method Not Allowed', - 406: 'Not Acceptable', - 407: 'Proxy Authentication Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Payload Too Large', - 414: 'URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Range Not Satisfiable', - 417: 'Expectation Failed', - 418: 'Im a teapot', - 421: 'Misdirected Request', - 422: 'Unprocessable Content', - 423: 'Locked', - 424: 'Failed Dependency', - 425: 'Too Early', - 426: 'Upgrade Required', - 428: 'Precondition Required', - 429: 'Too Many Requests', - 431: 'Request Header Fields Too Large', - 451: 'Unavailable For Legal Reasons', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported', - 506: 'Variant Also Negotiates', - 507: 'Insufficient Storage', - 508: 'Loop Detected', - 510: 'Not Extended', - 511: 'Network Authentication Required', - ...options.errors, - } - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError(options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ -export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options); - - if (!onCancel.isCancelled) { - let response = await sendRequest(config, options, url, body, formData, headers, onCancel); - - for (const fn of config.interceptors.response._fns) { - response = await fn(response); - } - - const responseBody = await getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - let transformedBody = responseBody; - if (options.responseTransformer && response.ok) { - transformedBody = await options.responseTransformer(responseBody) - } - - const result: ApiResult = { - url, - ok: response.ok, - status: response.status, - statusText: response.statusText, - body: responseHeader ?? transformedBody, - }; - - catchErrorCodes(options, result); - - resolve(result.body); - } - } catch (error) { - reject(error); - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_options/index.ts b/packages/openapi-ts-tests/test/generated/v3_options/index.ts deleted file mode 100644 index 50a1dd734..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_options/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export { ApiError } from './core/ApiError'; -export { CancelablePromise, CancelError } from './core/CancelablePromise'; -export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_options/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_options/sdk.gen.ts deleted file mode 100644 index 5ba5878ab..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_options/sdk.gen.ts +++ /dev/null @@ -1,84 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { CancelablePromise } from './core/CancelablePromise'; -import { OpenAPI } from './core/OpenAPI'; -import { request as __request } from './core/request'; -import type { CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData } from './types.gen'; - -export class DefaultsService { - /** - * @param data The data for the request. - * @param data.parameterString This is a simple string with default value - * @param data.parameterNumber This is a simple number with default value - * @param data.parameterBoolean This is a simple boolean with default value - * @param data.parameterEnum This is a simple enum with default value - * @param data.parameterModel This is a simple model with default value - * @throws ApiError - */ - public static callWithDefaultParameters(data: CallWithDefaultParametersData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterString This is a simple string that is optional with default value - * @param data.parameterNumber This is a simple number that is optional with default value - * @param data.parameterBoolean This is a simple boolean that is optional with default value - * @param data.parameterEnum This is a simple enum that is optional with default value - * @param data.parameterModel This is a simple model that is optional with default value - * @throws ApiError - */ - public static callWithDefaultOptionalParameters(data: CallWithDefaultOptionalParametersData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterStringWithNoDefault This is a string with no default - * @param data.parameterOptionalStringWithDefault This is a optional string with default - * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default - * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default - * @param data.parameterStringWithDefault This is a string with default - * @param data.parameterStringWithEmptyDefault This is a string with empty default - * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default - * @param data.parameterStringNullableWithDefault This is a string that can be null with default - * @throws ApiError - */ - public static callToTestOrderOfParams(data: CallToTestOrderOfParamsData): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/defaults', - query: { - parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, - parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, - parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, - parameterStringWithDefault: data.parameterStringWithDefault, - parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, - parameterStringWithNoDefault: data.parameterStringWithNoDefault, - parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, - parameterStringNullableWithDefault: data.parameterStringNullableWithDefault - } - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_options/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_options/types.gen.ts deleted file mode 100644 index 3ee5e285c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_options/types.gen.ts +++ /dev/null @@ -1,102 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -export type CallWithDefaultParametersData = { - /** - * This is a simple boolean with default value - */ - parameterBoolean?: (boolean) | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: (ModelWithString) | null; - /** - * This is a simple number with default value - */ - parameterNumber?: (number) | null; - /** - * This is a simple string with default value - */ - parameterString?: (string) | null; -}; - -export type CallWithDefaultOptionalParametersData = { - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; -}; - -export type CallToTestOrderOfParamsData = { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: (string) | null; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: (string) | null; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_services_filter/index.ts b/packages/openapi-ts-tests/test/generated/v3_services_filter/index.ts deleted file mode 100644 index 81abc8221..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_services_filter/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_services_filter/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_services_filter/sdk.gen.ts deleted file mode 100644 index ab8cd7396..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_services_filter/sdk.gen.ts +++ /dev/null @@ -1,75 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { CancelablePromise } from './core/CancelablePromise'; -import { OpenAPI } from './core/OpenAPI'; -import { request as __request } from './core/request'; - -/** - * @throws ApiError - */ -export const getCallWithoutParametersAndResponse = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple' - }); -}; - -/** - * @throws ApiError - */ -export const putCallWithoutParametersAndResponse = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/simple' - }); -}; - -/** - * @throws ApiError - */ -export const postCallWithoutParametersAndResponse = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/simple' - }); -}; - -/** - * @throws ApiError - */ -export const deleteCallWithoutParametersAndResponse = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/simple' - }); -}; - -/** - * @throws ApiError - */ -export const optionsCallWithoutParametersAndResponse = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'OPTIONS', - url: '/api/v{api-version}/simple' - }); -}; - -/** - * @throws ApiError - */ -export const headCallWithoutParametersAndResponse = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'HEAD', - url: '/api/v{api-version}/simple' - }); -}; - -/** - * @throws ApiError - */ -export const patchCallWithoutParametersAndResponse = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v{api-version}/simple' - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_services_filter/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_services_filter/types.gen.ts deleted file mode 100644 index 0147d27ac..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_services_filter/types.gen.ts +++ /dev/null @@ -1,1090 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _3e_num_1Период = 'Bird' | 'Dog'; - -export const _3e_num_1Период = { - BIRD: 'Bird', - DOG: 'Dog' -} as const; - -/** - * Model with number-only name - */ -export type _400 = string; - -export type _default = { - name?: string; -}; - -/** - * Model with restricted keyword name - */ -export type _import = string; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: (number) | undefined; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AnyOfAnyAndNull = { - data?: (unknown | null); -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<({ - foo?: string; -} | { - bar?: string; -})>; -}; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<({ - foo?: string; -} | { - bar?: string; -})>; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array<(boolean)>; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array<(number)>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: camelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array<(string)>; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type camelCaseCommentWithBreaks = number; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - firstName: string; - lastname: string; - age: number; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: (({ - boolean?: boolean; -} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: (Array<(_3e_num_1Период | ConstValue)> | null); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(number | string)>; -}); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: ParameterSimpleParameter; -} | { - bar: NonAsciiStringæøåÆØÅöôêÊ字符串; -}) & { - baz: (number) | null; - qux: number; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(boolean)>; -}); -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: (boolean | { - [key: string]: (number); -}); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; - -export type ConstValue = "ConstValue"; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: (string); - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: (string | number | boolean) | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: (string); -}; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple enum with numbers - */ -export const EnumWithExtensions = { - /** - * Used when the status of something is successful - */ - CUSTOM_SUCCESS: 200, - /** - * Used when the status of something has a warning - */ - CUSTOM_WARNING: 400, - /** - * Used when the status of something has an error - */ - CUSTOM_ERROR: 500 -} as const; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * This is a simple enum with numbers - */ -export const EnumWithNumbers = { - '_1': 1, - '_2': 2, - '_3': 3, - '_1.1': 1.1, - '_1.2': 1.2, - '_1.3': 1.3, - '_100': 100, - '_200': 200, - '_300': 300, - '_-100': -100, - '_-200': -200, - '_-300': -300, - '_-1.1': -1.1, - '_-1.2': -1.2, - '_-1.3': -1.3 -} as const; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -export const EnumWithReplacedCharacters = { - _SINGLE_QUOTE_: "'Single Quote'", - _DOUBLE_QUOTES_: '"Double Quotes"', - 'ØÆÅÔÖ_ØÆÅÔÖ字符串': 'øæåôöØÆÅÔÖ字符串', - '_3.1': 3.1, - EMPTY_STRING: '' -} as const; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with strings - */ -export const EnumWithStrings = { - SUCCESS: 'Success', - WARNING: 'Warning', - ERROR: 'Error', - _SINGLE_QUOTE_: "'Single Quote'", - _DOUBLE_QUOTES_: '"Double Quotes"', - 'NON_ASCII__ØÆÅÔÖ_ØÆÅÔÖ字符串': 'Non-ascii: øæåôöØÆÅÔÖ字符串' -} as const; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -export const EnumWithXEnumNames = { - zero: 0, - one: 1, - two: 2 -} as const; - -export type File = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { - item?: boolean; - error?: (string) | null; - readonly hasError?: boolean; - data?: { - [key: string]: unknown; - }; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_String_ = { - item?: (string) | null; - error?: (string) | null; - readonly hasError?: boolean; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type Model_From_Zendesk = string; - -/** - * Circle - */ -export type ModelCircle = { - kind: 'circle'; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: 'square'; - sideLength?: number; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string; -}; - -export type ModelWithAnyOfConstantSizeArray = [ - (number | string), - (number | string), - (number | string) -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - (number & string), - (number & string) -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - ((number) | null | string), - ((number) | null | string), - ((number) | null | string) -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - (number | _import), - (number | _import) -]; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnly = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -export type ModelWithConst = { - String?: "String"; - number?: 0; - null?: null; - withType?: "Some string"; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: (string); - }; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: boolean; -}; - -/** - * This is a simple enum with strings - */ -export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - -/** - * This is a simple enum with strings - */ -export const foo_bar_enum = { - SUCCESS: 'Success', - WARNING: 'Warning', - ERROR: 'Error', - 'ØÆÅ字符串': 'ØÆÅ字符串' -} as const; - -/** - * These are the HTTP error code enums - */ -export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - -/** - * These are the HTTP error code enums - */ -export const statusCode = { - _100: '100', - _200_FOO: '200 FOO', - _300_FOO_BAR: '300 FOO_BAR', - _400_FOO_BAR: '400 foo-bar', - _500_FOO_BAR: '500 foo.bar', - _600_FOO_BAR: '600 foo&bar' -} as const; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -export type foo_bar_baz_qux = '3.0'; - -export const foo_bar_baz_qux = { - _3_0: '3.0' -} as const; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array<(string)>; - data?: (ModelWithNestedArrayEnumsData); -}; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export const ModelWithNestedArrayEnumsDataBar = { - BAZ: 'baz', - QUX: 'qux' -} as const; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export const ModelWithNestedArrayEnumsDataFoo = { - FOO: 'foo', - BAR: 'bar' -} as const; - -export type ModelWithNestedCompositionEnums = { - foo?: (ModelWithNestedArrayEnumsDataFoo); -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: ('Success' | 'Warning' | 'Error'); - }; - dictionaryWithEnumFromDescription?: { - [key: string]: (number); - }; - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; - arrayWithDescription?: Array<(number)>; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedProperties = { - readonly first: { - readonly second: { - readonly third: (string) | null; - } | null; - } | null; -}; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: (string) | null; - /** - * This is a simple string property - */ - nullableProp2?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: (string) | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Период - */ -export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; - -/** - * Период - */ -export const value = { - '_-10': -10, - '_-1': -1, - '_0': 0, - '_1': 1, - '_3': 3, - '_6': 6, - '_12': 12 -} as const; - -export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { - baz: (number) | null; - qux: number; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - (string), - (string) - ]; - foo: 'Corge'; -}; - -export type foo = 'Bar'; - -export const foo = { - BAR: 'Bar' -} as const; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPattern = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - (number | string), - string -]; - -/** - * This is a model with one nested property - */ -export type ModelWithProperties = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: (string) | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -export type ModelWithReadOnlyAndWriteOnly = { - foo: string; - readonly bar: string; - baz: string; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReference = { - prop?: ModelWithProperties; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: (Array<(string | boolean)> | null); -}; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array<(string)>; -}; - -/** - * This is a reusable parameter - */ -export type ParameterSimpleParameter = string; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Parameter with illegal characters - */ -export type Parameterx_Foo_Bar = ModelWithString; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<({ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; -})>; -}; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple file - */ -export type SimpleFile = (Blob | File); - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = (string) | null; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_services_name/index.ts b/packages/openapi-ts-tests/test/generated/v3_services_name/index.ts deleted file mode 100644 index 81abc8221..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_services_name/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_services_name/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_services_name/sdk.gen.ts deleted file mode 100644 index 9e9e50323..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_services_name/sdk.gen.ts +++ /dev/null @@ -1,222 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { CancelablePromise } from './core/CancelablePromise'; -import { OpenAPI } from './core/OpenAPI'; -import { request as __request } from './core/request'; -import type { DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, ApiVVersionODataControllerCountResponse } from './types.gen'; - -export class myAwesomeParametersApi { - /** - * @param data The data for the request. - * @param data.fooParam foo in method - * @param data.barParam bar in method - * @param data.xFooBar Parameter with illegal characters - * @throws ApiError - */ - public static deleteFoo(data: DeleteFooData3): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - path: { - foo_param: data.fooParam, - BarParam: data.barParam - }, - headers: { - 'x-Foo-Bar': data.xFooBar - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the header - * @param data.fooAllOfEnum - * @param data.cursor This is the parameter that goes into the query params - * @param data.parameterCookie This is the parameter that goes into the cookie - * @param data.parameterPath This is the parameter that goes into the path - * @param data.requestBody This is the parameter that goes into the body - * @param data.fooRefEnum - * @throws ApiError - */ - public static callWithParameters(data: CallWithParametersData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/{parameterPath}', - path: { - parameterPath: data.parameterPath - }, - cookies: { - parameterCookie: data.parameterCookie - }, - headers: { - parameterHeader: data.parameterHeader - }, - query: { - foo_ref_enum: data.fooRefEnum, - foo_all_of_enum: data.fooAllOfEnum, - cursor: data.cursor - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the request header - * @param data.parameterQuery This is the parameter that goes into the request query params - * @param data.parameterCookie This is the parameter that goes into the cookie - * @param data.requestBody This is the parameter that goes into the body - * @param data.parameterPath1 This is the parameter that goes into the path - * @param data.parameterPath2 This is the parameter that goes into the path - * @param data.parameterPath3 This is the parameter that goes into the path - * @param data._default This is the parameter with a reserved keyword - * @throws ApiError - */ - public static callWithWeirdParameterNames(data: CallWithWeirdParameterNamesData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - path: { - 'parameter.path.1': data.parameterPath1, - 'parameter-path-2': data.parameterPath2, - 'PARAMETER-PATH-3': data.parameterPath3 - }, - cookies: { - 'PARAMETER-COOKIE': data.parameterCookie - }, - headers: { - 'parameter.header': data.parameterHeader - }, - query: { - default: data._default, - 'parameter-query': data.parameterQuery - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.requestBody This is a required parameter - * @param data.page This is an optional parameter - * @throws ApiError - */ - public static getCallWithOptionalParam(data: GetCallWithOptionalParamData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/parameters/', - query: { - page: data.page - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.parameter This is a required parameter - * @param data.requestBody This is an optional parameter - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public static postCallWithOptionalParam(data: PostCallWithOptionalParamData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/', - query: { - parameter: data.parameter - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - -} - -export class myAwesomeSimpleApi { - /** - * @returns Model_From_Zendesk Success - * @throws ApiError - */ - public static apiVVersionODataControllerCount(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple/$count' - }); - } - - /** - * @throws ApiError - */ - public static getCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static putCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static postCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static deleteCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static optionsCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'OPTIONS', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static headCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'HEAD', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static patchCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v{api-version}/simple' - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_services_name/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_services_name/types.gen.ts deleted file mode 100644 index 4f5dc013c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_services_name/types.gen.ts +++ /dev/null @@ -1,1195 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _3e_num_1Период = 'Bird' | 'Dog'; - -export const _3e_num_1Период = { - BIRD: 'Bird', - DOG: 'Dog' -} as const; - -/** - * Model with number-only name - */ -export type _400 = string; - -export type _default = { - name?: string; -}; - -/** - * Model with restricted keyword name - */ -export type _import = string; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: (number) | undefined; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AnyOfAnyAndNull = { - data?: (unknown | null); -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<({ - foo?: string; -} | { - bar?: string; -})>; -}; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<({ - foo?: string; -} | { - bar?: string; -})>; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array<(boolean)>; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array<(number)>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: camelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array<(string)>; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type camelCaseCommentWithBreaks = number; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - firstName: string; - lastname: string; - age: number; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: (({ - boolean?: boolean; -} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: (Array<(_3e_num_1Период | ConstValue)> | null); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(number | string)>; -}); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: ParameterSimpleParameter; -} | { - bar: NonAsciiStringæøåÆØÅöôêÊ字符串; -}) & { - baz: (number) | null; - qux: number; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(boolean)>; -}); -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: (boolean | { - [key: string]: (number); -}); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; - -export type ConstValue = "ConstValue"; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: (string); - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: (string | number | boolean) | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: (string); -}; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple enum with numbers - */ -export const EnumWithExtensions = { - /** - * Used when the status of something is successful - */ - CUSTOM_SUCCESS: 200, - /** - * Used when the status of something has a warning - */ - CUSTOM_WARNING: 400, - /** - * Used when the status of something has an error - */ - CUSTOM_ERROR: 500 -} as const; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * This is a simple enum with numbers - */ -export const EnumWithNumbers = { - '_1': 1, - '_2': 2, - '_3': 3, - '_1.1': 1.1, - '_1.2': 1.2, - '_1.3': 1.3, - '_100': 100, - '_200': 200, - '_300': 300, - '_-100': -100, - '_-200': -200, - '_-300': -300, - '_-1.1': -1.1, - '_-1.2': -1.2, - '_-1.3': -1.3 -} as const; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -export const EnumWithReplacedCharacters = { - _SINGLE_QUOTE_: "'Single Quote'", - _DOUBLE_QUOTES_: '"Double Quotes"', - 'ØÆÅÔÖ_ØÆÅÔÖ字符串': 'øæåôöØÆÅÔÖ字符串', - '_3.1': 3.1, - EMPTY_STRING: '' -} as const; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with strings - */ -export const EnumWithStrings = { - SUCCESS: 'Success', - WARNING: 'Warning', - ERROR: 'Error', - _SINGLE_QUOTE_: "'Single Quote'", - _DOUBLE_QUOTES_: '"Double Quotes"', - 'NON_ASCII__ØÆÅÔÖ_ØÆÅÔÖ字符串': 'Non-ascii: øæåôöØÆÅÔÖ字符串' -} as const; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -export const EnumWithXEnumNames = { - zero: 0, - one: 1, - two: 2 -} as const; - -export type File = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { - item?: boolean; - error?: (string) | null; - readonly hasError?: boolean; - data?: { - [key: string]: unknown; - }; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_String_ = { - item?: (string) | null; - error?: (string) | null; - readonly hasError?: boolean; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type Model_From_Zendesk = string; - -/** - * Circle - */ -export type ModelCircle = { - kind: 'circle'; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: 'square'; - sideLength?: number; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string; -}; - -export type ModelWithAnyOfConstantSizeArray = [ - (number | string), - (number | string), - (number | string) -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - (number & string), - (number & string) -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - ((number) | null | string), - ((number) | null | string), - ((number) | null | string) -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - (number | _import), - (number | _import) -]; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnly = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -export type ModelWithConst = { - String?: "String"; - number?: 0; - null?: null; - withType?: "Some string"; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: (string); - }; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: boolean; -}; - -/** - * This is a simple enum with strings - */ -export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - -/** - * This is a simple enum with strings - */ -export const foo_bar_enum = { - SUCCESS: 'Success', - WARNING: 'Warning', - ERROR: 'Error', - 'ØÆÅ字符串': 'ØÆÅ字符串' -} as const; - -/** - * These are the HTTP error code enums - */ -export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - -/** - * These are the HTTP error code enums - */ -export const statusCode = { - _100: '100', - _200_FOO: '200 FOO', - _300_FOO_BAR: '300 FOO_BAR', - _400_FOO_BAR: '400 foo-bar', - _500_FOO_BAR: '500 foo.bar', - _600_FOO_BAR: '600 foo&bar' -} as const; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -export type foo_bar_baz_qux = '3.0'; - -export const foo_bar_baz_qux = { - _3_0: '3.0' -} as const; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array<(string)>; - data?: (ModelWithNestedArrayEnumsData); -}; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export const ModelWithNestedArrayEnumsDataBar = { - BAZ: 'baz', - QUX: 'qux' -} as const; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export const ModelWithNestedArrayEnumsDataFoo = { - FOO: 'foo', - BAR: 'bar' -} as const; - -export type ModelWithNestedCompositionEnums = { - foo?: (ModelWithNestedArrayEnumsDataFoo); -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: ('Success' | 'Warning' | 'Error'); - }; - dictionaryWithEnumFromDescription?: { - [key: string]: (number); - }; - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; - arrayWithDescription?: Array<(number)>; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedProperties = { - readonly first: { - readonly second: { - readonly third: (string) | null; - } | null; - } | null; -}; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: (string) | null; - /** - * This is a simple string property - */ - nullableProp2?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: (string) | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Период - */ -export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; - -/** - * Период - */ -export const value = { - '_-10': -10, - '_-1': -1, - '_0': 0, - '_1': 1, - '_3': 3, - '_6': 6, - '_12': 12 -} as const; - -export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { - baz: (number) | null; - qux: number; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - (string), - (string) - ]; - foo: 'Corge'; -}; - -export type foo = 'Bar'; - -export const foo = { - BAR: 'Bar' -} as const; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPattern = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - (number | string), - string -]; - -/** - * This is a model with one nested property - */ -export type ModelWithProperties = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: (string) | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -export type ModelWithReadOnlyAndWriteOnly = { - foo: string; - readonly bar: string; - baz: string; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReference = { - prop?: ModelWithProperties; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: (Array<(string | boolean)> | null); -}; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array<(string)>; -}; - -/** - * This is a reusable parameter - */ -export type ParameterSimpleParameter = string; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Parameter with illegal characters - */ -export type Parameterx_Foo_Bar = ModelWithString; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<({ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; -})>; -}; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple file - */ -export type SimpleFile = (Blob | File); - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = (string) | null; - -export type DeleteFooData3 = { - /** - * bar in method - */ - barParam: string; - /** - * foo in method - */ - fooParam: string; - /** - * Parameter with illegal characters - */ - xFooBar: ModelWithString; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the query params - */ - cursor: (string) | null; - fooAllOfEnum: (ModelWithNestedArrayEnumsDataFoo); - fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the cookie - */ - parameterCookie: (string) | null; - /** - * This is the parameter that goes into the header - */ - parameterHeader: (string) | null; - /** - * This is the parameter that goes into the path - */ - parameterPath: (string) | null; - /** - * This is the parameter that goes into the body - */ - requestBody: { - [key: string]: unknown; - } | null; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter with a reserved keyword - */ - _default?: string; - /** - * This is the parameter that goes into the cookie - */ - parameterCookie: (string) | null; - /** - * This is the parameter that goes into the request header - */ - parameterHeader: (string) | null; - /** - * This is the parameter that goes into the path - */ - parameterPath1?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath2?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath3?: string; - /** - * This is the parameter that goes into the request query params - */ - parameterQuery: (string) | null; - /** - * This is the parameter that goes into the body - */ - requestBody: (ModelWithString) | null; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - page?: number; - /** - * This is a required parameter - */ - requestBody: ModelWithOneOfEnum; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is a required parameter - */ - parameter: Pageable; - /** - * This is an optional parameter - */ - requestBody?: { - offset?: (number) | null; - }; -}; - -export type PostCallWithOptionalParamResponse = (number | void); - -export type ApiVVersionODataControllerCountResponse = (Model_From_Zendesk); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_transform/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_transform/core/ApiError.ts deleted file mode 100644 index 36675d288..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_transform/core/ApiError.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: unknown; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_transform/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_transform/core/ApiRequestOptions.ts deleted file mode 100644 index 939a0aa4c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_transform/core/ApiRequestOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type ApiRequestOptions = { - readonly body?: any; - readonly cookies?: Record; - readonly errors?: Record; - readonly formData?: Record | any[] | Blob | File; - readonly headers?: Record; - readonly mediaType?: string; - readonly method: - | 'DELETE' - | 'GET' - | 'HEAD' - | 'OPTIONS' - | 'PATCH' - | 'POST' - | 'PUT'; - readonly path?: Record; - readonly query?: Record; - readonly responseHeader?: string; - readonly responseTransformer?: (data: unknown) => Promise; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_transform/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_transform/core/ApiResult.ts deleted file mode 100644 index 4c58e3913..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_transform/core/ApiResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ApiResult = { - readonly body: TData; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_transform/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_transform/core/CancelablePromise.ts deleted file mode 100644 index ccc082e8f..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_transform/core/CancelablePromise.ts +++ /dev/null @@ -1,126 +0,0 @@ -export class CancelError extends Error { - constructor(message: string) { - super(message); - this.name = 'CancelError'; - } - - public get isCancelled(): boolean { - return true; - } -} - -export interface OnCancel { - readonly isResolved: boolean; - readonly isRejected: boolean; - readonly isCancelled: boolean; - - (cancelHandler: () => void): void; -} - -export class CancelablePromise implements Promise { - private _isResolved: boolean; - private _isRejected: boolean; - private _isCancelled: boolean; - readonly cancelHandlers: (() => void)[]; - readonly promise: Promise; - private _resolve?: (value: T | PromiseLike) => void; - private _reject?: (reason?: unknown) => void; - - constructor( - executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: unknown) => void, - onCancel: OnCancel - ) => void - ) { - this._isResolved = false; - this._isRejected = false; - this._isCancelled = false; - this.cancelHandlers = []; - this.promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - - const onResolve = (value: T | PromiseLike): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isResolved = true; - if (this._resolve) this._resolve(value); - }; - - const onReject = (reason?: unknown): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isRejected = true; - if (this._reject) this._reject(reason); - }; - - const onCancel = (cancelHandler: () => void): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this.cancelHandlers.push(cancelHandler); - }; - - Object.defineProperty(onCancel, 'isResolved', { - get: (): boolean => this._isResolved, - }); - - Object.defineProperty(onCancel, 'isRejected', { - get: (): boolean => this._isRejected, - }); - - Object.defineProperty(onCancel, 'isCancelled', { - get: (): boolean => this._isCancelled, - }); - - return executor(onResolve, onReject, onCancel as OnCancel); - }); - } - - get [Symbol.toStringTag]() { - return "Cancellable Promise"; - } - - public then( - onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null - ): Promise { - return this.promise.then(onFulfilled, onRejected); - } - - public catch( - onRejected?: ((reason: unknown) => TResult | PromiseLike) | null - ): Promise { - return this.promise.catch(onRejected); - } - - public finally(onFinally?: (() => void) | null): Promise { - return this.promise.finally(onFinally); - } - - public cancel(): void { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isCancelled = true; - if (this.cancelHandlers.length) { - try { - for (const cancelHandler of this.cancelHandlers) { - cancelHandler(); - } - } catch (error) { - console.warn('Cancellation threw an error', error); - return; - } - } - this.cancelHandlers.length = 0; - if (this._reject) this._reject(new CancelError('Request aborted')); - } - - public get isCancelled(): boolean { - return this._isCancelled; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_transform/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_transform/core/OpenAPI.ts deleted file mode 100644 index 144e25744..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_transform/core/OpenAPI.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; - -type Headers = Record; -type Middleware = (value: T) => T | Promise; -type Resolver = (options: ApiRequestOptions) => Promise; - -export class Interceptors { - _fns: Middleware[]; - - constructor() { - this._fns = []; - } - - eject(fn: Middleware): void { - const index = this._fns.indexOf(fn); - if (index !== -1) { - this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; - } - } - - use(fn: Middleware): void { - this._fns = [...this._fns, fn]; - } -} - -export type OpenAPIConfig = { - BASE: string; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - ENCODE_PATH?: ((path: string) => string) | undefined; - HEADERS?: Headers | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - VERSION: string; - WITH_CREDENTIALS: boolean; - interceptors: { - request: Interceptors; - response: Interceptors; - }; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: 'http://localhost:3000/base', - CREDENTIALS: 'include', - ENCODE_PATH: undefined, - HEADERS: undefined, - PASSWORD: undefined, - TOKEN: undefined, - USERNAME: undefined, - VERSION: '1.0', - WITH_CREDENTIALS: false, - interceptors: { - request: new Interceptors(), - response: new Interceptors(), - }, -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_transform/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_transform/core/request.ts deleted file mode 100644 index 5458a2899..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_transform/core/request.ts +++ /dev/null @@ -1,350 +0,0 @@ -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import { CancelablePromise } from './CancelablePromise'; -import type { OnCancel } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const isString = (value: unknown): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: any): value is Blob => { - return value instanceof Blob; -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const encodePair = (key: string, value: unknown) => { - if (value === undefined || value === null) { - return; - } - - if (value instanceof Date) { - append(key, value.toISOString()); - } else if (Array.isArray(value)) { - value.forEach(v => encodePair(key, v)); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); - } else { - append(key, value); - } - }; - - Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - - return qs.length ? `?${qs.join('&')}` : ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = config.BASE + path; - return options.query ? url + getQueryString(options.query) : url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([, value]) => value !== undefined && value !== null) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { - const [token, username, password, additionalHeaders] = await Promise.all([ - // @ts-ignore - resolve(options, config.TOKEN), - // @ts-ignore - resolve(options, config.USERNAME), - // @ts-ignore - resolve(options, config.PASSWORD), - // @ts-ignore - resolve(options, config.HEADERS), - ]); - - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - }) - .filter(([, value]) => value !== undefined && value !== null) - .reduce((headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), {} as Record); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return new Headers(headers); -}; - -export const getRequestBody = (options: ApiRequestOptions): unknown => { - if (options.body !== undefined) { - if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { - return JSON.stringify(options.body); - } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; -}; - -export const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: any, - formData: FormData | undefined, - headers: Headers, - onCancel: OnCancel -): Promise => { - const controller = new AbortController(); - - let request: RequestInit = { - headers, - body: body ?? formData, - method: options.method, - signal: controller.signal, - }; - - if (config.WITH_CREDENTIALS) { - request.credentials = config.CREDENTIALS; - } - - for (const fn of config.interceptors.request._fns) { - request = await fn(request); - } - - onCancel(() => controller.abort()); - - return await fetch(url, request); -}; - -export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { - if (responseHeader) { - const content = response.headers.get(responseHeader); - if (isString(content)) { - return content; - } - } - return undefined; -}; - -export const getResponseBody = async (response: Response): Promise => { - if (response.status !== 204) { - try { - const contentType = response.headers.get('Content-Type'); - if (contentType) { - const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; - if (contentType.includes('application/json') || contentType.includes('+json')) { - return await response.json(); - } else if (binaryTypes.some(type => contentType.includes(type))) { - return await response.blob(); - } else if (contentType.includes('multipart/form-data')) { - return await response.formData(); - } else if (contentType.includes('text/')) { - return await response.text(); - } - } - } catch (error) { - console.error(error); - } - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 405: 'Method Not Allowed', - 406: 'Not Acceptable', - 407: 'Proxy Authentication Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Payload Too Large', - 414: 'URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Range Not Satisfiable', - 417: 'Expectation Failed', - 418: 'Im a teapot', - 421: 'Misdirected Request', - 422: 'Unprocessable Content', - 423: 'Locked', - 424: 'Failed Dependency', - 425: 'Too Early', - 426: 'Upgrade Required', - 428: 'Precondition Required', - 429: 'Too Many Requests', - 431: 'Request Header Fields Too Large', - 451: 'Unavailable For Legal Reasons', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported', - 506: 'Variant Also Negotiates', - 507: 'Insufficient Storage', - 508: 'Loop Detected', - 510: 'Not Extended', - 511: 'Network Authentication Required', - ...options.errors, - } - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError(options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ -export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options); - - if (!onCancel.isCancelled) { - let response = await sendRequest(config, options, url, body, formData, headers, onCancel); - - for (const fn of config.interceptors.response._fns) { - response = await fn(response); - } - - const responseBody = await getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - let transformedBody = responseBody; - if (options.responseTransformer && response.ok) { - transformedBody = await options.responseTransformer(responseBody) - } - - const result: ApiResult = { - url, - ok: response.ok, - status: response.status, - statusText: response.statusText, - body: responseHeader ?? transformedBody, - }; - - catchErrorCodes(options, result); - - resolve(result.body); - } - } catch (error) { - reject(error); - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_transform/index.ts b/packages/openapi-ts-tests/test/generated/v3_transform/index.ts deleted file mode 100644 index 50a1dd734..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_transform/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export { ApiError } from './core/ApiError'; -export { CancelablePromise, CancelError } from './core/CancelablePromise'; -export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_transform/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_transform/sdk.gen.ts deleted file mode 100644 index 5211e9979..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_transform/sdk.gen.ts +++ /dev/null @@ -1,80 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { CancelablePromise } from './core/CancelablePromise'; -import { OpenAPI } from './core/OpenAPI'; -import { request as __request } from './core/request'; -import { type ParentModelWithDatesResponse, type ModelWithDatesResponse, type ModelWithDatesArrayResponse, type ArrayOfDatesResponse, type DateResponse, type MultipleResponsesResponse, ParentModelWithDatesResponseTransformer, ModelWithDatesResponseTransformer, ModelWithDatesArrayResponseTransformer } from './types.gen'; - -export class DefaultService { - /** - * @returns ParentModelWithDates Success - * @returns unknown Success - * @throws ApiError - */ - public static parentModelWithDates(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/model-with-dates', - responseTransformer: ParentModelWithDatesResponseTransformer - }); - } - - /** - * @returns ModelWithDates Success - * @throws ApiError - */ - public static modelWithDates(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/model-with-dates', - responseTransformer: ModelWithDatesResponseTransformer - }); - } - - /** - * @returns ModelWithDates Success - * @throws ApiError - */ - public static modelWithDatesArray(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/model-with-dates-array', - responseTransformer: ModelWithDatesArrayResponseTransformer - }); - } - - /** - * @returns string Success - * @throws ApiError - */ - public static arrayOfDates(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/array-of-dates' - }); - } - - /** - * @returns string Success - * @throws ApiError - */ - public static date(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/date' - }); - } - - /** - * @returns ModelWithDates Updated - * @returns SimpleModel Created - * @throws ApiError - */ - public static multipleResponses(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/multiple-responses' - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_transform/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_transform/types.gen.ts deleted file mode 100644 index 8c9227850..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_transform/types.gen.ts +++ /dev/null @@ -1,106 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * This is a model that contains a some dates - */ -export type ModelWithDates = { - id: number; - name: string; - readonly enabled: boolean; - readonly modified: Date; - readonly expires?: Date; -}; - -/** - * This is a model that contains a some dates and arrays - */ -export type ParentModelWithDates = { - id: number; - readonly modified?: Date; - items?: Array; - item?: ModelWithDates; - 'nullable-date'?: Array<(Date | null)>; - simpleItems?: Array; - simpleItem?: SimpleModel; - dates?: Array<(Date)>; - strings?: Array<(string)>; -}; - -/** - * This is a model that contains a some dates - */ -export type SimpleModel = { - id: number; - name: string; - readonly enabled: boolean; -}; - -export type ParentModelWithDatesResponse = (ParentModelWithDates | unknown); - -export type ModelWithDatesResponse = (ModelWithDates); - -export type ModelWithDatesArrayResponse = (Array); - -export type ArrayOfDatesResponse = (Array<(Date)>); - -export type DateResponse = (Date); - -export type MultipleResponsesResponse = (Array | Array); - -export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; - -export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; - -export type ModelWithDatesModelResponseTransformer = (data: any) => ModelWithDates; - -export const ModelWithDatesModelResponseTransformer: ModelWithDatesModelResponseTransformer = data => { - if (data?.modified) { - data.modified = new Date(data.modified); - } - if (data?.expires) { - data.expires = new Date(data.expires); - } - return data; -}; - -export const ParentModelWithDatesModelResponseTransformer: ParentModelWithDatesModelResponseTransformer = data => { - if (data?.modified) { - data.modified = new Date(data.modified); - } - if (Array.isArray(data?.items)) { - data.items.forEach(ModelWithDatesModelResponseTransformer); - } - if (data?.item) { - ModelWithDatesModelResponseTransformer(data.item); - } - if (Array.isArray(data?.['nullable-date'])) { - data['nullable-date'] = data['nullable-date'].map(item => item ? new Date(item) : item); - } - if (Array.isArray(data?.dates)) { - data.dates = data.dates.map(item => item ? new Date(item) : item); - } - return data; -}; - -export const ParentModelWithDatesResponseTransformer: ParentModelWithDatesResponseTransformer = async (data) => { - if (data) { - ParentModelWithDatesModelResponseTransformer(data); - } - return data; -}; - -export type ModelWithDatesResponseTransformer = (data: any) => Promise; - -export const ModelWithDatesResponseTransformer: ModelWithDatesResponseTransformer = async (data) => { - ModelWithDatesModelResponseTransformer(data); - return data; -}; - -export type ModelWithDatesArrayResponseTransformer = (data: any) => Promise; - -export const ModelWithDatesArrayResponseTransformer: ModelWithDatesArrayResponseTransformer = async (data) => { - if (Array.isArray(data)) { - data.forEach(ModelWithDatesModelResponseTransformer); - } - return data; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_tree_shakeable/index.ts b/packages/openapi-ts-tests/test/generated/v3_tree_shakeable/index.ts deleted file mode 100644 index 81abc8221..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_tree_shakeable/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_tree_shakeable/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_tree_shakeable/sdk.gen.ts deleted file mode 100644 index 01dbca473..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_tree_shakeable/sdk.gen.ts +++ /dev/null @@ -1,799 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { CancelablePromise } from './core/CancelablePromise'; -import { OpenAPI } from './core/OpenAPI'; -import { request as __request } from './core/request'; -import type { PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, ApiVVersionODataControllerCountResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, PostApiFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, DummyAResponse, DummyBResponse, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartRequestData, MultipartResponseResponse, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderResponse, TestErrorCodeData, TestErrorCodeResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; - -/** - * @throws ApiError - */ -export const export_ = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/no+tag' - }); -}; - -/** - * @returns unknown OK - * @throws ApiError - */ -export const patchApiNoTag = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v{api-version}/no+tag' - }); -}; - -/** - * @param data The data for the request. - * @param data.requestBody - * @returns Model_From_Zendesk Success - * @returns ModelWithReadOnlyAndWriteOnly Default success response - * @throws ApiError - */ -export const import_ = (data: ImportData): CancelablePromise => { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/no+tag', - body: data.requestBody, - mediaType: 'application/json' - }); -}; - -/** - * @returns unknown OK - * @throws ApiError - */ -export const fooWow = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/no+tag' - }); -}; - -/** - * @returns Model_From_Zendesk Success - * @throws ApiError - */ -export const apiVVersionODataControllerCount = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple/$count' - }); -}; - -/** - * @param data The data for the request. - * @param data.fooParam foo in method - * @returns number Response is a simple number - * @throws ApiError - */ -export const getApiSimpleOperation = (data: GetApiSimpleOperationData): CancelablePromise => { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple:operation', - path: { - foo_param: data.fooParam - }, - errors: { - default: 'Default error response' - } - }); -}; - -/** - * @throws ApiError - */ -export const getCallWithoutParametersAndResponse = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple' - }); -}; - -/** - * @throws ApiError - */ -export const putCallWithoutParametersAndResponse = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/simple' - }); -}; - -/** - * @throws ApiError - */ -export const postCallWithoutParametersAndResponse = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/simple' - }); -}; - -/** - * @throws ApiError - */ -export const deleteCallWithoutParametersAndResponse = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/simple' - }); -}; - -/** - * @throws ApiError - */ -export const optionsCallWithoutParametersAndResponse = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'OPTIONS', - url: '/api/v{api-version}/simple' - }); -}; - -/** - * @throws ApiError - */ -export const headCallWithoutParametersAndResponse = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'HEAD', - url: '/api/v{api-version}/simple' - }); -}; - -/** - * @throws ApiError - */ -export const patchCallWithoutParametersAndResponse = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v{api-version}/simple' - }); -}; - -/** - * @param data The data for the request. - * @param data.fooParam foo in method - * @param data.barParam bar in method - * @param data.xFooBar Parameter with illegal characters - * @throws ApiError - */ -export const deleteFoo = (data: DeleteFooData3): CancelablePromise => { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - path: { - foo_param: data.fooParam, - BarParam: data.barParam - }, - headers: { - 'x-Foo-Bar': data.xFooBar - } - }); -}; - -/** - * @param data The data for the request. - * @param data.parameterWithBreaks Testing multiline comments in string: First line - * Second line - * - * Fourth line - * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work - * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work - * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work - * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work - * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work - * @throws ApiError - */ -export const callWithDescriptions = (data: CallWithDescriptionsData = {}): CancelablePromise => { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/descriptions/', - query: { - parameterWithBreaks: data.parameterWithBreaks, - parameterWithBackticks: data.parameterWithBackticks, - parameterWithSlashes: data.parameterWithSlashes, - parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders, - parameterWithQuotes: data.parameterWithQuotes, - parameterWithReservedCharacters: data.parameterWithReservedCharacters - } - }); -}; - -/** - * @deprecated - * @param data The data for the request. - * @param data.parameter This parameter is deprecated - * @throws ApiError - */ -export const deprecatedCall = (data: DeprecatedCallData): CancelablePromise => { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/deprecated', - headers: { - parameter: data.parameter - } - }); -}; - -/** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the header - * @param data.fooAllOfEnum - * @param data.cursor This is the parameter that goes into the query params - * @param data.parameterCookie This is the parameter that goes into the cookie - * @param data.parameterPath This is the parameter that goes into the path - * @param data.requestBody This is the parameter that goes into the body - * @param data.fooRefEnum - * @throws ApiError - */ -export const callWithParameters = (data: CallWithParametersData): CancelablePromise => { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/{parameterPath}', - path: { - parameterPath: data.parameterPath - }, - cookies: { - parameterCookie: data.parameterCookie - }, - headers: { - parameterHeader: data.parameterHeader - }, - query: { - foo_ref_enum: data.fooRefEnum, - foo_all_of_enum: data.fooAllOfEnum, - cursor: data.cursor - }, - body: data.requestBody, - mediaType: 'application/json' - }); -}; - -/** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the request header - * @param data.parameterQuery This is the parameter that goes into the request query params - * @param data.parameterCookie This is the parameter that goes into the cookie - * @param data.requestBody This is the parameter that goes into the body - * @param data.parameterPath1 This is the parameter that goes into the path - * @param data.parameterPath2 This is the parameter that goes into the path - * @param data.parameterPath3 This is the parameter that goes into the path - * @param data._default This is the parameter with a reserved keyword - * @throws ApiError - */ -export const callWithWeirdParameterNames = (data: CallWithWeirdParameterNamesData): CancelablePromise => { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - path: { - 'parameter.path.1': data.parameterPath1, - 'parameter-path-2': data.parameterPath2, - 'PARAMETER-PATH-3': data.parameterPath3 - }, - cookies: { - 'PARAMETER-COOKIE': data.parameterCookie - }, - headers: { - 'parameter.header': data.parameterHeader - }, - query: { - default: data._default, - 'parameter-query': data.parameterQuery - }, - body: data.requestBody, - mediaType: 'application/json' - }); -}; - -/** - * @param data The data for the request. - * @param data.requestBody This is a required parameter - * @param data.page This is an optional parameter - * @throws ApiError - */ -export const getCallWithOptionalParam = (data: GetCallWithOptionalParamData): CancelablePromise => { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/parameters/', - query: { - page: data.page - }, - body: data.requestBody, - mediaType: 'application/json' - }); -}; - -/** - * @param data The data for the request. - * @param data.parameter This is a required parameter - * @param data.requestBody This is an optional parameter - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ -export const postCallWithOptionalParam = (data: PostCallWithOptionalParamData): CancelablePromise => { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/', - query: { - parameter: data.parameter - }, - body: data.requestBody, - mediaType: 'application/json' - }); -}; - -/** - * @param data The data for the request. - * @param data.parameter This is a reusable parameter - * @param data.foo A reusable request body - * @throws ApiError - */ -export const postApiRequestBody = (data: PostApiRequestBodyData = {}): CancelablePromise => { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/requestBody/', - query: { - parameter: data.parameter - }, - body: data.foo, - mediaType: 'application/json' - }); -}; - -/** - * @param data The data for the request. - * @param data.parameter This is a reusable parameter - * @param data.formData A reusable request body - * @throws ApiError - */ -export const postApiFormData = (data: PostApiFormDataData = {}): CancelablePromise => { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/formData/', - query: { - parameter: data.parameter - }, - formData: data.formData, - mediaType: 'multipart/form-data' - }); -}; - -/** - * @param data The data for the request. - * @param data.parameterString This is a simple string with default value - * @param data.parameterNumber This is a simple number with default value - * @param data.parameterBoolean This is a simple boolean with default value - * @param data.parameterEnum This is a simple enum with default value - * @param data.parameterModel This is a simple model with default value - * @throws ApiError - */ -export const callWithDefaultParameters = (data: CallWithDefaultParametersData = {}): CancelablePromise => { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); -}; - -/** - * @param data The data for the request. - * @param data.parameterString This is a simple string that is optional with default value - * @param data.parameterNumber This is a simple number that is optional with default value - * @param data.parameterBoolean This is a simple boolean that is optional with default value - * @param data.parameterEnum This is a simple enum that is optional with default value - * @param data.parameterModel This is a simple model that is optional with default value - * @throws ApiError - */ -export const callWithDefaultOptionalParameters = (data: CallWithDefaultOptionalParametersData = {}): CancelablePromise => { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); -}; - -/** - * @param data The data for the request. - * @param data.parameterStringWithNoDefault This is a string with no default - * @param data.parameterOptionalStringWithDefault This is a optional string with default - * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default - * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default - * @param data.parameterStringWithDefault This is a string with default - * @param data.parameterStringWithEmptyDefault This is a string with empty default - * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default - * @param data.parameterStringNullableWithDefault This is a string that can be null with default - * @throws ApiError - */ -export const callToTestOrderOfParams = (data: CallToTestOrderOfParamsData): CancelablePromise => { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/defaults', - query: { - parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, - parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, - parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, - parameterStringWithDefault: data.parameterStringWithDefault, - parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, - parameterStringWithNoDefault: data.parameterStringWithNoDefault, - parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, - parameterStringNullableWithDefault: data.parameterStringNullableWithDefault - } - }); -}; - -/** - * @throws ApiError - */ -export const duplicateName = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/duplicate' - }); -}; - -/** - * @throws ApiError - */ -export const duplicateName1 = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/duplicate' - }); -}; - -/** - * @throws ApiError - */ -export const duplicateName2 = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/duplicate' - }); -}; - -/** - * @throws ApiError - */ -export const duplicateName3 = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/duplicate' - }); -}; - -/** - * @returns void Success - * @throws ApiError - */ -export const callWithNoContentResponse = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/no-content' - }); -}; - -/** - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ -export const callWithResponseAndNoContentResponse = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/response-and-no-content' - }); -}; - -/** - * @returns _400 - * @throws ApiError - */ -export const dummyA = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/a' - }); -}; - -/** - * @returns void Success - * @throws ApiError - */ -export const dummyB = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); -}; - -/** - * @returns import - * @throws ApiError - */ -export const callWithResponse = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/response' - }); -}; - -/** - * @returns unknown Message for 200 response - * @returns ModelWithString Message for 201 response - * @returns ModelWithString Message for 202 response - * @throws ApiError - */ -export const callWithDuplicateResponses = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/response', - errors: { - 500: 'Message for 500 error', - 501: 'Message for 501 error', - 502: 'Message for 502 error', - '4XX': 'Message for 4XX errors', - default: 'Default error response' - } - }); -}; - -/** - * @returns unknown Message for 200 response - * @returns ModelThatExtends Message for 201 response - * @returns ModelThatExtendsExtends Message for 202 response - * @throws ApiError - */ -export const callWithResponses = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/response', - errors: { - 500: 'Message for 500 error', - 501: 'Message for 501 error', - 502: 'Message for 502 error', - default: 'Message for default response' - } - }); -}; - -/** - * @param data The data for the request. - * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) - * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) - * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) - * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) - * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) - * @throws ApiError - */ -export const collectionFormat = (data: CollectionFormatData): CancelablePromise => { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/collectionFormat', - query: { - parameterArrayCSV: data.parameterArrayCsv, - parameterArraySSV: data.parameterArraySsv, - parameterArrayTSV: data.parameterArrayTsv, - parameterArrayPipes: data.parameterArrayPipes, - parameterArrayMulti: data.parameterArrayMulti - } - }); -}; - -/** - * @param data The data for the request. - * @param data.parameterArray This is an array parameter - * @param data.parameterDictionary This is a dictionary parameter - * @param data.parameterEnum This is an enum parameter - * @param data.parameterTuple This is tuple parameter - * @param data.parameterNumber This is a number parameter - * @param data.parameterString This is a string parameter - * @param data.parameterBoolean This is a boolean parameter - * @param data.parameterObject This is an object parameter - * @param data.id This is a number parameter - * @returns number Response is a simple number - * @returns string Response is a simple string - * @returns boolean Response is a simple boolean - * @returns unknown Response is a simple object - * @throws ApiError - */ -export const types = (data: TypesData): CancelablePromise => { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/types', - path: { - id: data.id - }, - query: { - parameterNumber: data.parameterNumber, - parameterString: data.parameterString, - parameterBoolean: data.parameterBoolean, - parameterObject: data.parameterObject, - parameterArray: data.parameterArray, - parameterDictionary: data.parameterDictionary, - parameterEnum: data.parameterEnum, - parameterTuple: data.parameterTuple - } - }); -}; - -/** - * @param data The data for the request. - * @param data.formData - * @returns boolean - * @throws ApiError - */ -export const uploadFile = (data: UploadFileData): CancelablePromise => { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/upload', - formData: data.formData, - mediaType: 'application/x-www-form-urlencoded' - }); -}; - -/** - * @param data The data for the request. - * @param data.id - * @returns binary Success - * @throws ApiError - */ -export const fileResponse = (data: FileResponseData): CancelablePromise => { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/file/{id}', - path: { - id: data.id - } - }); -}; - -/** - * @param data The data for the request. - * @param data.parameterObject Parameter containing object - * @param data.parameterReference Parameter containing reference - * @returns ModelWithString Successful response - * @throws ApiError - */ -export const complexTypes = (data: ComplexTypesData): CancelablePromise => { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/complex', - query: { - parameterObject: data.parameterObject, - parameterReference: data.parameterReference - }, - errors: { - 400: '400 `server` error', - 500: '500 server error' - } - }); -}; - -/** - * @param data The data for the request. - * @param data.formData - * @throws ApiError - */ -export const multipartRequest = (data: MultipartRequestData = {}): CancelablePromise => { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/multipart', - formData: data.formData, - mediaType: 'multipart/form-data' - }); -}; - -/** - * @returns unknown OK - * @throws ApiError - */ -export const multipartResponse = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multipart' - }); -}; - -/** - * @param data The data for the request. - * @param data.id - * @param data.requestBody - * @returns ModelWithString Success - * @throws ApiError - */ -export const complexParams = (data: ComplexParamsData): CancelablePromise => { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/complex/{id}', - path: { - id: data.id - }, - body: data.requestBody, - mediaType: 'application/json-patch+json' - }); -}; - -/** - * @returns string Successful response - * @throws ApiError - */ -export const callWithResultFromHeader = (): CancelablePromise => { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/header', - responseHeader: 'operation-location', - errors: { - 400: '400 server error', - 500: '500 server error' - } - }); -}; - -/** - * @param data The data for the request. - * @param data.status Status code to return - * @returns unknown Custom message: Successful response - * @throws ApiError - */ -export const testErrorCode = (data: TestErrorCodeData): CancelablePromise => { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/error', - query: { - status: data.status - }, - errors: { - 500: 'Custom message: Internal Server Error', - 501: 'Custom message: Not Implemented', - 502: 'Custom message: Bad Gateway', - 503: 'Custom message: Service Unavailable' - } - }); -}; - -/** - * @param data The data for the request. - * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param - * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response - * @throws ApiError - */ -export const nonAsciiæøåÆøÅöôêÊ字符串 = (data: NonAsciiæøåÆøÅöôêÊ字符串Data): CancelablePromise => { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - query: { - 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ - } - }); -}; - -/** - * Login User - * @param data The data for the request. - * @param data.formData - * @throws ApiError - */ -export const putWithFormUrlEncoded = (data: PutWithFormUrlEncodedData): CancelablePromise => { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - formData: data.formData, - mediaType: 'application/x-www-form-urlencoded' - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_tree_shakeable/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_tree_shakeable/types.gen.ts deleted file mode 100644 index b21a80d15..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_tree_shakeable/types.gen.ts +++ /dev/null @@ -1,1537 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _3e_num_1Период = 'Bird' | 'Dog'; - -export const _3e_num_1Период = { - BIRD: 'Bird', - DOG: 'Dog' -} as const; - -/** - * Model with number-only name - */ -export type _400 = string; - -export type _default = { - name?: string; -}; - -/** - * Model with restricted keyword name - */ -export type _import = string; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: (number) | undefined; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AnyOfAnyAndNull = { - data?: (unknown | null); -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<({ - foo?: string; -} | { - bar?: string; -})>; -}; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<({ - foo?: string; -} | { - bar?: string; -})>; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array<(boolean)>; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array<(number)>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: camelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array<(string)>; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type camelCaseCommentWithBreaks = number; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - firstName: string; - lastname: string; - age: number; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: (({ - boolean?: boolean; -} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: (Array<(_3e_num_1Период | ConstValue)> | null); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(number | string)>; -}); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: ParameterSimpleParameter; -} | { - bar: NonAsciiStringæøåÆØÅöôêÊ字符串; -}) & { - baz: (number) | null; - qux: number; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(boolean)>; -}); -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: (boolean | { - [key: string]: (number); -}); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; - -export type ConstValue = "ConstValue"; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: (string); - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: (string | number | boolean) | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: (string); -}; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple enum with numbers - */ -export const EnumWithExtensions = { - /** - * Used when the status of something is successful - */ - CUSTOM_SUCCESS: 200, - /** - * Used when the status of something has a warning - */ - CUSTOM_WARNING: 400, - /** - * Used when the status of something has an error - */ - CUSTOM_ERROR: 500 -} as const; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * This is a simple enum with numbers - */ -export const EnumWithNumbers = { - '_1': 1, - '_2': 2, - '_3': 3, - '_1.1': 1.1, - '_1.2': 1.2, - '_1.3': 1.3, - '_100': 100, - '_200': 200, - '_300': 300, - '_-100': -100, - '_-200': -200, - '_-300': -300, - '_-1.1': -1.1, - '_-1.2': -1.2, - '_-1.3': -1.3 -} as const; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -export const EnumWithReplacedCharacters = { - _SINGLE_QUOTE_: "'Single Quote'", - _DOUBLE_QUOTES_: '"Double Quotes"', - 'ØÆÅÔÖ_ØÆÅÔÖ字符串': 'øæåôöØÆÅÔÖ字符串', - '_3.1': 3.1, - EMPTY_STRING: '' -} as const; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with strings - */ -export const EnumWithStrings = { - SUCCESS: 'Success', - WARNING: 'Warning', - ERROR: 'Error', - _SINGLE_QUOTE_: "'Single Quote'", - _DOUBLE_QUOTES_: '"Double Quotes"', - 'NON_ASCII__ØÆÅÔÖ_ØÆÅÔÖ字符串': 'Non-ascii: øæåôöØÆÅÔÖ字符串' -} as const; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -export const EnumWithXEnumNames = { - zero: 0, - one: 1, - two: 2 -} as const; - -export type File = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { - item?: boolean; - error?: (string) | null; - readonly hasError?: boolean; - data?: { - [key: string]: unknown; - }; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_String_ = { - item?: (string) | null; - error?: (string) | null; - readonly hasError?: boolean; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type Model_From_Zendesk = string; - -/** - * Circle - */ -export type ModelCircle = { - kind: 'circle'; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: 'square'; - sideLength?: number; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string; -}; - -export type ModelWithAnyOfConstantSizeArray = [ - (number | string), - (number | string), - (number | string) -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - (number & string), - (number & string) -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - ((number) | null | string), - ((number) | null | string), - ((number) | null | string) -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - (number | _import), - (number | _import) -]; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnly = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -export type ModelWithConst = { - String?: "String"; - number?: 0; - null?: null; - withType?: "Some string"; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: (string); - }; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: boolean; -}; - -/** - * This is a simple enum with strings - */ -export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - -/** - * This is a simple enum with strings - */ -export const foo_bar_enum = { - SUCCESS: 'Success', - WARNING: 'Warning', - ERROR: 'Error', - 'ØÆÅ字符串': 'ØÆÅ字符串' -} as const; - -/** - * These are the HTTP error code enums - */ -export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - -/** - * These are the HTTP error code enums - */ -export const statusCode = { - _100: '100', - _200_FOO: '200 FOO', - _300_FOO_BAR: '300 FOO_BAR', - _400_FOO_BAR: '400 foo-bar', - _500_FOO_BAR: '500 foo.bar', - _600_FOO_BAR: '600 foo&bar' -} as const; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -export type foo_bar_baz_qux = '3.0'; - -export const foo_bar_baz_qux = { - _3_0: '3.0' -} as const; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array<(string)>; - data?: (ModelWithNestedArrayEnumsData); -}; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export const ModelWithNestedArrayEnumsDataBar = { - BAZ: 'baz', - QUX: 'qux' -} as const; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export const ModelWithNestedArrayEnumsDataFoo = { - FOO: 'foo', - BAR: 'bar' -} as const; - -export type ModelWithNestedCompositionEnums = { - foo?: (ModelWithNestedArrayEnumsDataFoo); -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: ('Success' | 'Warning' | 'Error'); - }; - dictionaryWithEnumFromDescription?: { - [key: string]: (number); - }; - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; - arrayWithDescription?: Array<(number)>; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedProperties = { - readonly first: { - readonly second: { - readonly third: (string) | null; - } | null; - } | null; -}; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: (string) | null; - /** - * This is a simple string property - */ - nullableProp2?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: (string) | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Период - */ -export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; - -/** - * Период - */ -export const value = { - '_-10': -10, - '_-1': -1, - '_0': 0, - '_1': 1, - '_3': 3, - '_6': 6, - '_12': 12 -} as const; - -export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { - baz: (number) | null; - qux: number; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - (string), - (string) - ]; - foo: 'Corge'; -}; - -export type foo = 'Bar'; - -export const foo = { - BAR: 'Bar' -} as const; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPattern = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - (number | string), - string -]; - -/** - * This is a model with one nested property - */ -export type ModelWithProperties = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: (string) | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -export type ModelWithReadOnlyAndWriteOnly = { - foo: string; - readonly bar: string; - baz: string; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReference = { - prop?: ModelWithProperties; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: (Array<(string | boolean)> | null); -}; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array<(string)>; -}; - -/** - * This is a reusable parameter - */ -export type ParameterSimpleParameter = string; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Parameter with illegal characters - */ -export type Parameterx_Foo_Bar = ModelWithString; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<({ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; -})>; -}; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple file - */ -export type SimpleFile = (Blob | File); - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = (string) | null; - -export type PatchApiNoTagResponse = (unknown); - -export type ImportData = { - requestBody: (ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly); -}; - -export type ImportResponse = (Model_From_Zendesk | ModelWithReadOnlyAndWriteOnly); - -export type FooWowResponse = (unknown); - -export type ApiVVersionODataControllerCountResponse = (Model_From_Zendesk); - -export type GetApiSimpleOperationData = { - /** - * foo in method - */ - fooParam: string; -}; - -export type GetApiSimpleOperationResponse = (number); - -export type DeleteFooData3 = { - /** - * bar in method - */ - barParam: string; - /** - * foo in method - */ - fooParam: string; - /** - * Parameter with illegal characters - */ - xFooBar: ModelWithString; -}; - -export type CallWithDescriptionsData = { - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: unknown; - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: unknown; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: unknown; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: unknown; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: unknown; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: unknown; -}; - -export type DeprecatedCallData = { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: (DeprecatedModel) | null; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the query params - */ - cursor: (string) | null; - fooAllOfEnum: (ModelWithNestedArrayEnumsDataFoo); - fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the cookie - */ - parameterCookie: (string) | null; - /** - * This is the parameter that goes into the header - */ - parameterHeader: (string) | null; - /** - * This is the parameter that goes into the path - */ - parameterPath: (string) | null; - /** - * This is the parameter that goes into the body - */ - requestBody: { - [key: string]: unknown; - } | null; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter with a reserved keyword - */ - _default?: string; - /** - * This is the parameter that goes into the cookie - */ - parameterCookie: (string) | null; - /** - * This is the parameter that goes into the request header - */ - parameterHeader: (string) | null; - /** - * This is the parameter that goes into the path - */ - parameterPath1?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath2?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath3?: string; - /** - * This is the parameter that goes into the request query params - */ - parameterQuery: (string) | null; - /** - * This is the parameter that goes into the body - */ - requestBody: (ModelWithString) | null; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - page?: number; - /** - * This is a required parameter - */ - requestBody: ModelWithOneOfEnum; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is a required parameter - */ - parameter: Pageable; - /** - * This is an optional parameter - */ - requestBody?: { - offset?: (number) | null; - }; -}; - -export type PostCallWithOptionalParamResponse = (number | void); - -export type PostApiRequestBodyData = { - /** - * A reusable request body - */ - foo?: ModelWithString; - /** - * This is a reusable parameter - */ - parameter?: string; -}; - -export type PostApiFormDataData = { - /** - * A reusable request body - */ - formData?: ModelWithString; - /** - * This is a reusable parameter - */ - parameter?: string; -}; - -export type CallWithDefaultParametersData = { - /** - * This is a simple boolean with default value - */ - parameterBoolean?: (boolean) | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: (ModelWithString) | null; - /** - * This is a simple number with default value - */ - parameterNumber?: (number) | null; - /** - * This is a simple string with default value - */ - parameterString?: (string) | null; -}; - -export type CallWithDefaultOptionalParametersData = { - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; -}; - -export type CallToTestOrderOfParamsData = { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: (string) | null; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: (string) | null; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; -}; - -export type CallWithNoContentResponseResponse = (void); - -export type CallWithResponseAndNoContentResponseResponse = (number | void); - -export type DummyAResponse = (_400); - -export type DummyBResponse = (void); - -export type CallWithResponseResponse = (_import); - -export type CallWithDuplicateResponsesResponse = ((ModelWithBoolean & ModelWithInteger) | ModelWithString); - -export type CallWithResponsesResponse = ({ - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; -} | ModelThatExtends | ModelThatExtendsExtends); - -export type CollectionFormatData = { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCsv: Array<(string)> | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array<(string)> | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array<(string)> | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySsv: Array<(string)> | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTsv: Array<(string)> | null; -}; - -export type TypesData = { - /** - * This is a number parameter - */ - id?: number; - /** - * This is an array parameter - */ - parameterArray: Array<(string)> | null; - /** - * This is a boolean parameter - */ - parameterBoolean: (boolean) | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: ('Success' | 'Warning' | 'Error') | null; - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is a string parameter - */ - parameterString: (string) | null; - /** - * This is tuple parameter - */ - parameterTuple: [ - number, - number, - number, - number - ]; -}; - -export type TypesResponse = (number | string | boolean | { - [key: string]: unknown; -}); - -export type UploadFileData = { - formData: (Blob | File); -}; - -export type UploadFileResponse = (boolean); - -export type FileResponseData = { - id: string; -}; - -export type FileResponseResponse = ((Blob | File)); - -export type ComplexTypesData = { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; -}; - -export type ComplexTypesResponse = (Array); - -export type MultipartRequestData = { - formData?: { - content?: (Blob | File); - data?: ((ModelWithString) | null); - }; -}; - -export type MultipartResponseResponse = ({ - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; -}); - -export type ComplexParamsData = { - id: number; - requestBody?: { - readonly key: (string) | null; - name: (string) | null; - enabled?: boolean; - readonly type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array<(string)> | null; - parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); - readonly user?: { - readonly id?: number; - readonly name?: (string) | null; - }; - }; -}; - -export type ComplexParamsResponse = (ModelWithString); - -export type CallWithResultFromHeaderResponse = (string); - -export type TestErrorCodeData = { - /** - * Status code to return - */ - status: number; -}; - -export type TestErrorCodeResponse = (unknown); - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - /** - * Dummy input param - */ - nonAsciiParamæøåÆøÅöôêÊ: number; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = (Array); - -export type PutWithFormUrlEncodedData = { - formData: ArrayWithStrings; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_types/index.ts b/packages/openapi-ts-tests/test/generated/v3_types/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_types/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_types/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_types/types.gen.ts deleted file mode 100644 index f6a6095e3..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_types/types.gen.ts +++ /dev/null @@ -1,1970 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = unknown; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string; - /** - * This is a simple string property - */ - nullableRequiredProp1: string; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReference = { - prop?: ModelWithProperties; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnly = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: { - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithProperties = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedProperties = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPattern = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type File = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - unknown, - unknown - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnly = { - foo: string; - readonly bar: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | string, - number | string, - number | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: unknown; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssue = ((ConstValue | GenericSchemaDuplicateIssue1SystemBoolean) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemString; - -export type GenericSchemaDuplicateIssue1SystemBoolean = { - item?: boolean; - error?: string; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemString = { - item?: string; - error?: string; - readonly hasError?: boolean; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnly; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: unknown; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: unknown; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: unknown; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: unknown; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: unknown; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: unknown; - }; - url: '/api/v{api-version}/descriptions/'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - }; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters/'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters/'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody/'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData/'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string; - /** - * This is a simple number with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - }; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - /** - * This is tuple parameter - */ - parameterTuple: [ - number, - number, - number, - number - ]; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: unknown; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: unknown; -}; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - readonly key: string; - name: string; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array; - listOfStrings?: Array; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - readonly user?: { - readonly id?: number; - readonly name?: string; - }; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_types_no_tree/index.ts b/packages/openapi-ts-tests/test/generated/v3_types_no_tree/index.ts deleted file mode 100644 index 56bade120..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_types_no_tree/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_types_no_tree/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_types_no_tree/types.gen.ts deleted file mode 100644 index f6a6095e3..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_types_no_tree/types.gen.ts +++ /dev/null @@ -1,1970 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * Model with number-only name - */ -export type _400 = string; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CamelCaseCommentWithBreaks = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; - -/** - * This is a simple file - */ -export type SimpleFile = unknown; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = string; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: CamelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<{ - foo?: string; -} | { - bar?: string; -}>; - -export type AnyOfAnyAndNull = { - data?: unknown | null; -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<{ - foo?: string; - } | { - bar?: string; - }>; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: string; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: string | number | boolean | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: string; - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type ModelFromZendesk = string; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: string; - /** - * This is a simple string property - */ - nullableRequiredProp1: string; - /** - * This is a simple string property - */ - nullableProp2?: string | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: string | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: true; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: 'Success' | 'Warning' | 'Error'; - }; - dictionaryWithEnumFromDescription?: { - [key: string]: number; - }; - arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; - arrayWithDescription?: Array; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReference = { - prop?: ModelWithProperties; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnly = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array; - propWithNumber?: Array; -}; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: string; - }; -}; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * Circle - */ -export type ModelCircle = { - kind: string; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: string; - sideLength?: number; -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ({ - kind?: 'circle'; -} & ModelCircle) | ({ - kind?: 'square'; -} & ModelSquare); - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: { - propA?: string; - } | string | number; -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: Array | Array; -}; - -export type _3eNum1Период = 'Bird' | 'Dog'; - -export type ConstValue = 'ConstValue'; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: Array<_3eNum1Период | ConstValue> | null; -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: boolean | { - [key: string]: number; - }; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: boolean | { - [key: string]: Array; - }; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: { - boolean?: boolean; - } & ModelWithEnum & ModelWithArray & ModelWithDictionary; -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: { - boolean?: boolean; - } | ModelWithEnum | ModelWithArray | ModelWithDictionary; -}; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - age: number; - firstName: string; - lastname: string; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithProperties = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: string; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedProperties = { - readonly first: { - readonly second: { - readonly third: string; - }; - }; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPattern = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type File = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -export type Default = { - name?: string; -}; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; - -export type ModelWithConst = { - String?: 'String'; - number?: 0; - null?: null; - withType?: 'Some string'; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string | undefined; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: Array | null; -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: SimpleParameter; -} | { - bar: NonAsciiStringæøåÆøÅöôêÊ字符串; -}) & { - baz: number; - qux: number; -}; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - unknown, - unknown - ]; - foo: 'Corge'; -}; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array; - data?: ModelWithNestedArrayEnumsData; -}; - -export type ModelWithNestedCompositionEnums = { - foo?: ModelWithNestedArrayEnumsDataFoo; -}; - -export type ModelWithReadOnlyAndWriteOnly = { - foo: string; - readonly bar: string; - baz: string; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -export type ModelWithAnyOfConstantSizeArray = [ - number | string, - number | string, - number | string -]; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - number | string, - string -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - number | string, - number | string, - number | string -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - number | Import, - number | Import -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - number & string, - number & string -]; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { - baz: number; - qux: number; -}; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * Model with restricted keyword name - */ -export type Import = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type IoK8sApimachineryPkgApisMetaV1Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: string | number; -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: unknown; -}; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: number; -}; - -export type OneOfAllOfIssue = ((ConstValue | GenericSchemaDuplicateIssue1SystemBoolean) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemString; - -export type GenericSchemaDuplicateIssue1SystemBoolean = { - item?: boolean; - error?: string; - readonly hasError?: boolean; - data?: { - [key: string]: never; - }; -}; - -export type GenericSchemaDuplicateIssue1SystemString = { - item?: string; - error?: string; - readonly hasError?: boolean; -}; - -/** - * This is a reusable parameter - */ -export type SimpleParameter = string; - -/** - * Parameter with illegal characters - */ -export type XFooBar = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleRequestBody = ModelWithString; - -/** - * A reusable request body - */ -export type SimpleFormData = ModelWithString; - -export type ExportData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type PatchApiVbyApiVersionNoTagResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ImportData = { - body: ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type ImportResponses = { - /** - * Success - */ - 200: ModelFromZendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnly; -}; - -export type ImportResponse = ImportResponses[keyof ImportResponses]; - -export type FooWowData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no+tag'; -}; - -export type FooWowResponses = { - /** - * OK - */ - default: unknown; -}; - -export type ApiVVersionODataControllerCountData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple/$count'; -}; - -export type ApiVVersionODataControllerCountResponses = { - /** - * Success - */ - 200: ModelFromZendesk; -}; - -export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; - -export type GetApiVbyApiVersionSimpleOperationData = { - body?: never; - path: { - /** - * foo in method - */ - foo_param: string; - }; - query?: never; - url: '/api/v{api-version}/simple:operation'; -}; - -export type GetApiVbyApiVersionSimpleOperationErrors = { - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; - -export type GetApiVbyApiVersionSimpleOperationResponses = { - /** - * Response is a simple number - */ - 200: number; -}; - -export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; - -export type DeleteCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type GetCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type HeadCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type OptionsCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PatchCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PostCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type PutCallWithoutParametersAndResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/simple'; -}; - -export type DeleteFooData3 = { - body?: never; - headers: { - /** - * Parameter with illegal characters - */ - 'x-Foo-Bar': ModelWithString; - }; - path: { - /** - * foo in method - */ - foo_param: string; - /** - * bar in method - */ - BarParam: string; - }; - query?: never; - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; -}; - -export type CallWithDescriptionsData = { - body?: never; - path?: never; - query?: { - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: unknown; - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: unknown; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: unknown; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: unknown; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: unknown; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: unknown; - }; - url: '/api/v{api-version}/descriptions/'; -}; - -export type DeprecatedCallData = { - body?: never; - headers: { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: DeprecatedModel; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/parameters/deprecated'; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the body - */ - body: { - [key: string]: unknown; - }; - headers: { - /** - * This is the parameter that goes into the header - */ - parameterHeader: string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - parameterPath: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; - foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the query params - */ - cursor: string; - }; - url: '/api/v{api-version}/parameters/{parameterPath}'; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter that goes into the body - */ - body: ModelWithString; - headers: { - /** - * This is the parameter that goes into the request header - */ - 'parameter.header': string; - }; - path: { - /** - * This is the parameter that goes into the path - */ - 'parameter.path.1'?: string; - /** - * This is the parameter that goes into the path - */ - 'parameter-path-2'?: string; - /** - * This is the parameter that goes into the path - */ - 'PARAMETER-PATH-3'?: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query: { - /** - * This is the parameter with a reserved keyword - */ - default?: string; - /** - * This is the parameter that goes into the request query params - */ - 'parameter-query': string; - }; - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is a required parameter - */ - body: ModelWithOneOfEnum; - path?: never; - query?: { - /** - * This is an optional parameter - */ - page?: number; - }; - url: '/api/v{api-version}/parameters/'; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - body?: { - offset?: number; - }; - path?: never; - query: { - /** - * This is a required parameter - */ - parameter: Pageable; - }; - url: '/api/v{api-version}/parameters/'; -}; - -export type PostCallWithOptionalParamResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; - -export type PostApiVbyApiVersionRequestBodyData = { - /** - * A reusable request body - */ - body?: SimpleRequestBody; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/requestBody/'; -}; - -export type PostApiVbyApiVersionFormDataData = { - /** - * A reusable request body - */ - body?: SimpleFormData; - path?: never; - query?: { - /** - * This is a reusable parameter - */ - parameter?: string; - }; - url: '/api/v{api-version}/formData/'; -}; - -export type CallWithDefaultParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string with default value - */ - parameterString?: string; - /** - * This is a simple number with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallWithDefaultOptionalParametersData = { - body?: never; - path?: never; - query?: { - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type CallToTestOrderOfParamsData = { - body?: never; - path?: never; - query: { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: string; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: string; - }; - url: '/api/v{api-version}/defaults'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type DuplicateNameData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/duplicate'; -}; - -export type CallWithNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/no-content'; -}; - -export type CallWithNoContentResponseResponses = { - /** - * Success - */ - 204: void; -}; - -export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; - -export type CallWithResponseAndNoContentResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/response-and-no-content'; -}; - -export type CallWithResponseAndNoContentResponseResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; -}; - -export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; - -export type DummyAData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/a'; -}; - -export type DummyAResponses = { - 200: _400; -}; - -export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; - -export type DummyBData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multiple-tags/b'; -}; - -export type DummyBResponses = { - /** - * Success - */ - 204: void; -}; - -export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; - -export type CallWithResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponseResponses = { - default: Import; -}; - -export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; - -export type CallWithDuplicateResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithDuplicateResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; -}; - -export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; - -export type CallWithDuplicateResponsesResponses = { - /** - * Message for 200 response - */ - 200: ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; -}; - -export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; - -export type CallWithResponsesData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/response'; -}; - -export type CallWithResponsesErrors = { - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; -}; - -export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; - -export type CallWithResponsesResponses = { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; -}; - -export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; - -export type CollectionFormatData = { - body?: never; - path?: never; - query: { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCSV: Array; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySSV: Array; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTSV: Array; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array; - }; - url: '/api/v{api-version}/collectionFormat'; -}; - -export type TypesData = { - body?: never; - path?: { - /** - * This is a number parameter - */ - id?: number; - }; - query: { - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is a string parameter - */ - parameterString: string; - /** - * This is a boolean parameter - */ - parameterBoolean: boolean; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - }; - /** - * This is an array parameter - */ - parameterArray: Array; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - }; - /** - * This is an enum parameter - */ - parameterEnum: 'Success' | 'Warning' | 'Error'; - /** - * This is tuple parameter - */ - parameterTuple: [ - number, - number, - number, - number - ]; - }; - url: '/api/v{api-version}/types'; -}; - -export type TypesResponses = { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; -}; - -export type TypesResponse = TypesResponses[keyof TypesResponses]; - -export type UploadFileData = { - body: unknown; - path: { - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/upload'; -}; - -export type UploadFileResponses = { - 200: boolean; -}; - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; - -export type FileResponseData = { - body?: never; - path: { - id: string; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/file/{id}'; -}; - -export type FileResponseResponses = { - /** - * Success - */ - 200: unknown; -}; - -export type ComplexTypesData = { - body?: never; - path?: never; - query: { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; - }; - url: '/api/v{api-version}/complex'; -}; - -export type ComplexTypesErrors = { - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type ComplexTypesResponses = { - /** - * Successful response - */ - 200: Array; -}; - -export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; - -export type MultipartResponseData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type MultipartResponseResponses = { - /** - * OK - */ - 200: { - file?: Blob | File; - metadata?: { - foo?: string; - bar?: string; - }; - }; -}; - -export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; - -export type MultipartRequestData = { - body?: { - content?: Blob | File; - data?: ModelWithString; - }; - path?: never; - query?: never; - url: '/api/v{api-version}/multipart'; -}; - -export type ComplexParamsData = { - body?: { - readonly key: string; - name: string; - enabled?: boolean; - type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array; - listOfStrings?: Array; - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; - readonly user?: { - readonly id?: number; - readonly name?: string; - }; - }; - path: { - id: number; - /** - * api-version should be required in standalone clients - */ - 'api-version': string; - }; - query?: never; - url: '/api/v{api-version}/complex/{id}'; -}; - -export type ComplexParamsResponses = { - /** - * Success - */ - 200: ModelWithString; -}; - -export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; - -export type CallWithResultFromHeaderData = { - body?: never; - path?: never; - query?: never; - url: '/api/v{api-version}/header'; -}; - -export type CallWithResultFromHeaderErrors = { - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; -}; - -export type CallWithResultFromHeaderResponses = { - /** - * Successful response - */ - 200: unknown; -}; - -export type TestErrorCodeData = { - body?: never; - path?: never; - query: { - /** - * Status code to return - */ - status: number; - }; - url: '/api/v{api-version}/error'; -}; - -export type TestErrorCodeErrors = { - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; -}; - -export type TestErrorCodeResponses = { - /** - * Custom message: Successful response - */ - 200: unknown; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - body?: never; - path?: never; - query: { - /** - * Dummy input param - */ - nonAsciiParamæøåÆØÅöôêÊ: number; - }; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { - /** - * Successful response - */ - 200: Array; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; - -export type PutWithFormUrlEncodedData = { - body: ArrayWithStrings; - path?: never; - query?: never; - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; -}; - -export type ClientOptions = { - baseUrl: 'http://localhost:3000/base' | (string & {}); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiError.ts deleted file mode 100644 index 36675d288..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiError.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: unknown; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiRequestOptions.ts deleted file mode 100644 index 939a0aa4c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiRequestOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type ApiRequestOptions = { - readonly body?: any; - readonly cookies?: Record; - readonly errors?: Record; - readonly formData?: Record | any[] | Blob | File; - readonly headers?: Record; - readonly mediaType?: string; - readonly method: - | 'DELETE' - | 'GET' - | 'HEAD' - | 'OPTIONS' - | 'PATCH' - | 'POST' - | 'PUT'; - readonly path?: Record; - readonly query?: Record; - readonly responseHeader?: string; - readonly responseTransformer?: (data: unknown) => Promise; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiResult.ts deleted file mode 100644 index 4c58e3913..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_xhr/core/ApiResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ApiResult = { - readonly body: TData; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_xhr/core/CancelablePromise.ts deleted file mode 100644 index ccc082e8f..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_xhr/core/CancelablePromise.ts +++ /dev/null @@ -1,126 +0,0 @@ -export class CancelError extends Error { - constructor(message: string) { - super(message); - this.name = 'CancelError'; - } - - public get isCancelled(): boolean { - return true; - } -} - -export interface OnCancel { - readonly isResolved: boolean; - readonly isRejected: boolean; - readonly isCancelled: boolean; - - (cancelHandler: () => void): void; -} - -export class CancelablePromise implements Promise { - private _isResolved: boolean; - private _isRejected: boolean; - private _isCancelled: boolean; - readonly cancelHandlers: (() => void)[]; - readonly promise: Promise; - private _resolve?: (value: T | PromiseLike) => void; - private _reject?: (reason?: unknown) => void; - - constructor( - executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: unknown) => void, - onCancel: OnCancel - ) => void - ) { - this._isResolved = false; - this._isRejected = false; - this._isCancelled = false; - this.cancelHandlers = []; - this.promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - - const onResolve = (value: T | PromiseLike): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isResolved = true; - if (this._resolve) this._resolve(value); - }; - - const onReject = (reason?: unknown): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isRejected = true; - if (this._reject) this._reject(reason); - }; - - const onCancel = (cancelHandler: () => void): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this.cancelHandlers.push(cancelHandler); - }; - - Object.defineProperty(onCancel, 'isResolved', { - get: (): boolean => this._isResolved, - }); - - Object.defineProperty(onCancel, 'isRejected', { - get: (): boolean => this._isRejected, - }); - - Object.defineProperty(onCancel, 'isCancelled', { - get: (): boolean => this._isCancelled, - }); - - return executor(onResolve, onReject, onCancel as OnCancel); - }); - } - - get [Symbol.toStringTag]() { - return "Cancellable Promise"; - } - - public then( - onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null - ): Promise { - return this.promise.then(onFulfilled, onRejected); - } - - public catch( - onRejected?: ((reason: unknown) => TResult | PromiseLike) | null - ): Promise { - return this.promise.catch(onRejected); - } - - public finally(onFinally?: (() => void) | null): Promise { - return this.promise.finally(onFinally); - } - - public cancel(): void { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isCancelled = true; - if (this.cancelHandlers.length) { - try { - for (const cancelHandler of this.cancelHandlers) { - cancelHandler(); - } - } catch (error) { - console.warn('Cancellation threw an error', error); - return; - } - } - this.cancelHandlers.length = 0; - if (this._reject) this._reject(new CancelError('Request aborted')); - } - - public get isCancelled(): boolean { - return this._isCancelled; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_xhr/core/OpenAPI.ts deleted file mode 100644 index 0317507fa..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_xhr/core/OpenAPI.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; - -type Headers = Record; -type Middleware = (value: T) => T | Promise; -type Resolver = (options: ApiRequestOptions) => Promise; - -export class Interceptors { - _fns: Middleware[]; - - constructor() { - this._fns = []; - } - - eject(fn: Middleware): void { - const index = this._fns.indexOf(fn); - if (index !== -1) { - this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; - } - } - - use(fn: Middleware): void { - this._fns = [...this._fns, fn]; - } -} - -export type OpenAPIConfig = { - BASE: string; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - ENCODE_PATH?: ((path: string) => string) | undefined; - HEADERS?: Headers | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - VERSION: string; - WITH_CREDENTIALS: boolean; - interceptors: { - request: Interceptors; - response: Interceptors; - }; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: 'http://localhost:3000/base', - CREDENTIALS: 'include', - ENCODE_PATH: undefined, - HEADERS: undefined, - PASSWORD: undefined, - TOKEN: undefined, - USERNAME: undefined, - VERSION: '1.0', - WITH_CREDENTIALS: false, - interceptors: { - request: new Interceptors(), - response: new Interceptors(), - }, -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_xhr/core/request.ts deleted file mode 100644 index 9b08a59cd..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_xhr/core/request.ts +++ /dev/null @@ -1,350 +0,0 @@ -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import { CancelablePromise } from './CancelablePromise'; -import type { OnCancel } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const isString = (value: unknown): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: any): value is Blob => { - return value instanceof Blob; -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const isSuccess = (status: number): boolean => { - return status >= 200 && status < 300; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const encodePair = (key: string, value: unknown) => { - if (value === undefined || value === null) { - return; - } - - if (value instanceof Date) { - append(key, value.toISOString()); - } else if (Array.isArray(value)) { - value.forEach(v => encodePair(key, v)); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); - } else { - append(key, value); - } - }; - - Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - - return qs.length ? `?${qs.join('&')}` : ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = config.BASE + path; - return options.query ? url + getQueryString(options.query) : url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([, value]) => value !== undefined && value !== null) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { - const [token, username, password, additionalHeaders] = await Promise.all([ - // @ts-ignore - resolve(options, config.TOKEN), - // @ts-ignore - resolve(options, config.USERNAME), - // @ts-ignore - resolve(options, config.PASSWORD), - // @ts-ignore - resolve(options, config.HEADERS), - ]); - - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - }) - .filter(([, value]) => value !== undefined && value !== null) - .reduce((headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), {} as Record); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return new Headers(headers); -}; - -export const getRequestBody = (options: ApiRequestOptions): unknown => { - if (options.body !== undefined) { - if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { - return JSON.stringify(options.body); - } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; -}; - -export const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: any, - formData: FormData | undefined, - headers: Headers, - onCancel: OnCancel -): Promise => { - let xhr = new XMLHttpRequest(); - xhr.open(options.method, url, true); - xhr.withCredentials = config.WITH_CREDENTIALS; - - headers.forEach((value, key) => { - xhr.setRequestHeader(key, value); - }); - - return new Promise(async (resolve, reject) => { - xhr.onload = () => resolve(xhr); - xhr.onabort = () => reject(new Error('Request aborted')); - xhr.onerror = () => reject(new Error('Network error')); - - for (const fn of config.interceptors.request._fns) { - xhr = await fn(xhr); - } - - xhr.send(body ?? formData); - - onCancel(() => xhr.abort()); - }); -}; - -export const getResponseHeader = (xhr: XMLHttpRequest, responseHeader?: string): string | undefined => { - if (responseHeader) { - const content = xhr.getResponseHeader(responseHeader); - if (isString(content)) { - return content; - } - } - return undefined; -}; - -export const getResponseBody = (xhr: XMLHttpRequest): unknown => { - if (xhr.status !== 204) { - try { - const contentType = xhr.getResponseHeader('Content-Type'); - if (contentType) { - if (contentType.includes('application/json') || contentType.includes('+json')) { - return JSON.parse(xhr.responseText); - } else { - return xhr.responseText; - } - } - } catch (error) { - console.error(error); - } - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 405: 'Method Not Allowed', - 406: 'Not Acceptable', - 407: 'Proxy Authentication Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Payload Too Large', - 414: 'URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Range Not Satisfiable', - 417: 'Expectation Failed', - 418: 'Im a teapot', - 421: 'Misdirected Request', - 422: 'Unprocessable Content', - 423: 'Locked', - 424: 'Failed Dependency', - 425: 'Too Early', - 426: 'Upgrade Required', - 428: 'Precondition Required', - 429: 'Too Many Requests', - 431: 'Request Header Fields Too Large', - 451: 'Unavailable For Legal Reasons', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported', - 506: 'Variant Also Negotiates', - 507: 'Insufficient Storage', - 508: 'Loop Detected', - 510: 'Not Extended', - 511: 'Network Authentication Required', - ...options.errors, - } - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError(options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ -export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options); - - if (!onCancel.isCancelled) { - let response = await sendRequest(config, options, url, body, formData, headers, onCancel); - - for (const fn of config.interceptors.response._fns) { - response = await fn(response); - } - - const responseBody = getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - let transformedBody = responseBody; - if (options.responseTransformer && isSuccess(response.status)) { - transformedBody = await options.responseTransformer(responseBody) - } - - const result: ApiResult = { - url, - ok: isSuccess(response.status), - status: response.status, - statusText: response.statusText, - body: responseHeader ?? transformedBody, - }; - - catchErrorCodes(options, result); - - resolve(result.body); - } - } catch (error) { - reject(error); - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr/index.ts b/packages/openapi-ts-tests/test/generated/v3_xhr/index.ts deleted file mode 100644 index 50a1dd734..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_xhr/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export { ApiError } from './core/ApiError'; -export { CancelablePromise, CancelError } from './core/CancelablePromise'; -export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_xhr/sdk.gen.ts deleted file mode 100644 index f62288bcf..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_xhr/sdk.gen.ts +++ /dev/null @@ -1,913 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { CancelablePromise } from './core/CancelablePromise'; -import { OpenAPI } from './core/OpenAPI'; -import { request as __request } from './core/request'; -import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; - -export class CollectionFormatService { - /** - * @param data The data for the request. - * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) - * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) - * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) - * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) - * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) - * @throws ApiError - */ - public static collectionFormat(data: CollectionFormatData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/collectionFormat', - query: { - parameterArrayCSV: data.parameterArrayCsv, - parameterArraySSV: data.parameterArraySsv, - parameterArrayTSV: data.parameterArrayTsv, - parameterArrayPipes: data.parameterArrayPipes, - parameterArrayMulti: data.parameterArrayMulti - } - }); - } - -} - -export class ComplexService { - /** - * @param data The data for the request. - * @param data.parameterObject Parameter containing object - * @param data.parameterReference Parameter containing reference - * @returns ModelWithString Successful response - * @throws ApiError - */ - public static complexTypes(data: ComplexTypesData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/complex', - query: { - parameterObject: data.parameterObject, - parameterReference: data.parameterReference - }, - errors: { - 400: '400 `server` error', - 500: '500 server error' - } - }); - } - - /** - * @param data The data for the request. - * @param data.id - * @param data.requestBody - * @returns ModelWithString Success - * @throws ApiError - */ - public static complexParams(data: ComplexParamsData): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/complex/{id}', - path: { - id: data.id - }, - body: data.requestBody, - mediaType: 'application/json-patch+json' - }); - } - -} - -export class DefaultService { - /** - * @throws ApiError - */ - public static export(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public static patchApiNoTag(): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @param data The data for the request. - * @param data.requestBody - * @returns Model_From_Zendesk Success - * @returns ModelWithReadOnlyAndWriteOnly Default success response - * @throws ApiError - */ - public static import(data: ImportData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/no+tag', - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public static fooWow(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/no+tag' - }); - } - - /** - * @param data The data for the request. - * @param data.fooParam foo in method - * @returns number Response is a simple number - * @throws ApiError - */ - public static getApiSimpleOperation(data: GetApiSimpleOperationData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple:operation', - path: { - foo_param: data.fooParam - }, - errors: { - default: 'Default error response' - } - }); - } - -} - -export class DefaultsService { - /** - * @param data The data for the request. - * @param data.parameterString This is a simple string with default value - * @param data.parameterNumber This is a simple number with default value - * @param data.parameterBoolean This is a simple boolean with default value - * @param data.parameterEnum This is a simple enum with default value - * @param data.parameterModel This is a simple model with default value - * @throws ApiError - */ - public static callWithDefaultParameters(data: CallWithDefaultParametersData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterString This is a simple string that is optional with default value - * @param data.parameterNumber This is a simple number that is optional with default value - * @param data.parameterBoolean This is a simple boolean that is optional with default value - * @param data.parameterEnum This is a simple enum that is optional with default value - * @param data.parameterModel This is a simple model that is optional with default value - * @throws ApiError - */ - public static callWithDefaultOptionalParameters(data: CallWithDefaultOptionalParametersData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/defaults', - query: { - parameterString: data.parameterString, - parameterNumber: data.parameterNumber, - parameterBoolean: data.parameterBoolean, - parameterEnum: data.parameterEnum, - parameterModel: data.parameterModel - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterStringWithNoDefault This is a string with no default - * @param data.parameterOptionalStringWithDefault This is a optional string with default - * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default - * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default - * @param data.parameterStringWithDefault This is a string with default - * @param data.parameterStringWithEmptyDefault This is a string with empty default - * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default - * @param data.parameterStringNullableWithDefault This is a string that can be null with default - * @throws ApiError - */ - public static callToTestOrderOfParams(data: CallToTestOrderOfParamsData): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/defaults', - query: { - parameterOptionalStringWithDefault: data.parameterOptionalStringWithDefault, - parameterOptionalStringWithEmptyDefault: data.parameterOptionalStringWithEmptyDefault, - parameterOptionalStringWithNoDefault: data.parameterOptionalStringWithNoDefault, - parameterStringWithDefault: data.parameterStringWithDefault, - parameterStringWithEmptyDefault: data.parameterStringWithEmptyDefault, - parameterStringWithNoDefault: data.parameterStringWithNoDefault, - parameterStringNullableWithNoDefault: data.parameterStringNullableWithNoDefault, - parameterStringNullableWithDefault: data.parameterStringNullableWithDefault - } - }); - } - -} - -export class DeprecatedService { - /** - * @deprecated - * @param data The data for the request. - * @param data.parameter This parameter is deprecated - * @throws ApiError - */ - public static deprecatedCall(data: DeprecatedCallData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/deprecated', - headers: { - parameter: data.parameter - } - }); - } - -} - -export class DescriptionsService { - /** - * @param data The data for the request. - * @param data.parameterWithBreaks Testing multiline comments in string: First line - * Second line - * - * Fourth line - * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work - * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work - * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work - * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work - * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work - * @throws ApiError - */ - public static callWithDescriptions(data: CallWithDescriptionsData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/descriptions/', - query: { - parameterWithBreaks: data.parameterWithBreaks, - parameterWithBackticks: data.parameterWithBackticks, - parameterWithSlashes: data.parameterWithSlashes, - parameterWithExpressionPlaceholders: data.parameterWithExpressionPlaceholders, - parameterWithQuotes: data.parameterWithQuotes, - parameterWithReservedCharacters: data.parameterWithReservedCharacters - } - }); - } - -} - -export class DuplicateService { - /** - * @throws ApiError - */ - public static duplicateName(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public static duplicateName1(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public static duplicateName2(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/duplicate' - }); - } - - /** - * @throws ApiError - */ - public static duplicateName3(): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/duplicate' - }); - } - -} - -export class ErrorService { - /** - * @param data The data for the request. - * @param data.status Status code to return - * @returns unknown Custom message: Successful response - * @throws ApiError - */ - public static testErrorCode(data: TestErrorCodeData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/error', - query: { - status: data.status - }, - errors: { - 500: 'Custom message: Internal Server Error', - 501: 'Custom message: Not Implemented', - 502: 'Custom message: Bad Gateway', - 503: 'Custom message: Service Unavailable' - } - }); - } - -} - -export class FileResponseService { - /** - * @param data The data for the request. - * @param data.id - * @returns binary Success - * @throws ApiError - */ - public static fileResponse(data: FileResponseData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/file/{id}', - path: { - id: data.id - } - }); - } - -} - -export class FormDataService { - /** - * @param data The data for the request. - * @param data.parameter This is a reusable parameter - * @param data.formData A reusable request body - * @throws ApiError - */ - public static postApiFormData(data: PostApiFormDataData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/formData/', - query: { - parameter: data.parameter - }, - formData: data.formData, - mediaType: 'multipart/form-data' - }); - } - -} - -export class HeaderService { - /** - * @returns string Successful response - * @throws ApiError - */ - public static callWithResultFromHeader(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/header', - responseHeader: 'operation-location', - errors: { - 400: '400 server error', - 500: '500 server error' - } - }); - } - -} - -export class MultipartService { - /** - * @param data The data for the request. - * @param data.formData - * @throws ApiError - */ - public static multipartRequest(data: MultipartRequestData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/multipart', - formData: data.formData, - mediaType: 'multipart/form-data' - }); - } - - /** - * @returns unknown OK - * @throws ApiError - */ - public static multipartResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multipart' - }); - } - -} - -export class MultipleTags1Service { - /** - * @returns _400 - * @throws ApiError - */ - public static dummyA(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/a' - }); - } - - /** - * @returns void Success - * @throws ApiError - */ - public static dummyB(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class MultipleTags2Service { - /** - * @returns _400 - * @throws ApiError - */ - public static dummyA(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/a' - }); - } - - /** - * @returns void Success - * @throws ApiError - */ - public static dummyB(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class MultipleTags3Service { - /** - * @returns void Success - * @throws ApiError - */ - public static dummyB(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/b' - }); - } - -} - -export class NoContentService { - /** - * @returns void Success - * @throws ApiError - */ - public static callWithNoContentResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/no-content' - }); - } - - /** - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public static callWithResponseAndNoContentResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/response-and-no-content' - }); - } - -} - -export class NonAsciiÆøåÆøÅöôêÊService { - /** - * @param data The data for the request. - * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param - * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response - * @throws ApiError - */ - public static nonAsciiæøåÆøÅöôêÊ字符串(data: NonAsciiæøåÆøÅöôêÊ字符串Data): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - query: { - 'nonAsciiParamæøåÆØÅöôêÊ': data.nonAsciiParamæøåÆøÅöôêÊ - } - }); - } - - /** - * Login User - * @param data The data for the request. - * @param data.formData - * @throws ApiError - */ - public static putWithFormUrlEncoded(data: PutWithFormUrlEncodedData): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', - formData: data.formData, - mediaType: 'application/x-www-form-urlencoded' - }); - } - -} - -export class ParametersService { - /** - * @param data The data for the request. - * @param data.fooParam foo in method - * @param data.barParam bar in method - * @param data.xFooBar Parameter with illegal characters - * @throws ApiError - */ - public static deleteFoo(data: DeleteFooData3): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', - path: { - foo_param: data.fooParam, - BarParam: data.barParam - }, - headers: { - 'x-Foo-Bar': data.xFooBar - } - }); - } - - /** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the header - * @param data.fooAllOfEnum - * @param data.cursor This is the parameter that goes into the query params - * @param data.parameterCookie This is the parameter that goes into the cookie - * @param data.parameterPath This is the parameter that goes into the path - * @param data.requestBody This is the parameter that goes into the body - * @param data.fooRefEnum - * @throws ApiError - */ - public static callWithParameters(data: CallWithParametersData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/{parameterPath}', - path: { - parameterPath: data.parameterPath - }, - cookies: { - parameterCookie: data.parameterCookie - }, - headers: { - parameterHeader: data.parameterHeader - }, - query: { - foo_ref_enum: data.fooRefEnum, - foo_all_of_enum: data.fooAllOfEnum, - cursor: data.cursor - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.parameterHeader This is the parameter that goes into the request header - * @param data.parameterQuery This is the parameter that goes into the request query params - * @param data.parameterCookie This is the parameter that goes into the cookie - * @param data.requestBody This is the parameter that goes into the body - * @param data.parameterPath1 This is the parameter that goes into the path - * @param data.parameterPath2 This is the parameter that goes into the path - * @param data.parameterPath3 This is the parameter that goes into the path - * @param data._default This is the parameter with a reserved keyword - * @throws ApiError - */ - public static callWithWeirdParameterNames(data: CallWithWeirdParameterNamesData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', - path: { - 'parameter.path.1': data.parameterPath1, - 'parameter-path-2': data.parameterPath2, - 'PARAMETER-PATH-3': data.parameterPath3 - }, - cookies: { - 'PARAMETER-COOKIE': data.parameterCookie - }, - headers: { - 'parameter.header': data.parameterHeader - }, - query: { - default: data._default, - 'parameter-query': data.parameterQuery - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.requestBody This is a required parameter - * @param data.page This is an optional parameter - * @throws ApiError - */ - public static getCallWithOptionalParam(data: GetCallWithOptionalParamData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/parameters/', - query: { - page: data.page - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - - /** - * @param data The data for the request. - * @param data.parameter This is a required parameter - * @param data.requestBody This is an optional parameter - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public static postCallWithOptionalParam(data: PostCallWithOptionalParamData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/parameters/', - query: { - parameter: data.parameter - }, - body: data.requestBody, - mediaType: 'application/json' - }); - } - -} - -export class RequestBodyService { - /** - * @param data The data for the request. - * @param data.parameter This is a reusable parameter - * @param data.foo A reusable request body - * @throws ApiError - */ - public static postApiRequestBody(data: PostApiRequestBodyData = {}): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/requestBody/', - query: { - parameter: data.parameter - }, - body: data.foo, - mediaType: 'application/json' - }); - } - -} - -export class ResponseService { - /** - * @returns number Response is a simple number - * @returns void Success - * @throws ApiError - */ - public static callWithResponseAndNoContentResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/multiple-tags/response-and-no-content' - }); - } - - /** - * @returns import - * @throws ApiError - */ - public static callWithResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/response' - }); - } - - /** - * @returns unknown Message for 200 response - * @returns ModelWithString Message for 201 response - * @returns ModelWithString Message for 202 response - * @throws ApiError - */ - public static callWithDuplicateResponses(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/response', - errors: { - 500: 'Message for 500 error', - 501: 'Message for 501 error', - 502: 'Message for 502 error', - '4XX': 'Message for 4XX errors', - default: 'Default error response' - } - }); - } - - /** - * @returns unknown Message for 200 response - * @returns ModelThatExtends Message for 201 response - * @returns ModelThatExtendsExtends Message for 202 response - * @throws ApiError - */ - public static callWithResponses(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/response', - errors: { - 500: 'Message for 500 error', - 501: 'Message for 501 error', - 502: 'Message for 502 error', - default: 'Message for default response' - } - }); - } - -} - -export class SimpleService { - /** - * @returns Model_From_Zendesk Success - * @throws ApiError - */ - public static apiVVersionODataControllerCount(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple/$count' - }); - } - - /** - * @throws ApiError - */ - public static getCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static putCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static postCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static deleteCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static optionsCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'OPTIONS', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static headCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'HEAD', - url: '/api/v{api-version}/simple' - }); - } - - /** - * @throws ApiError - */ - public static patchCallWithoutParametersAndResponse(): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v{api-version}/simple' - }); - } - -} - -export class TypesService { - /** - * @param data The data for the request. - * @param data.parameterArray This is an array parameter - * @param data.parameterDictionary This is a dictionary parameter - * @param data.parameterEnum This is an enum parameter - * @param data.parameterTuple This is tuple parameter - * @param data.parameterNumber This is a number parameter - * @param data.parameterString This is a string parameter - * @param data.parameterBoolean This is a boolean parameter - * @param data.parameterObject This is an object parameter - * @param data.id This is a number parameter - * @returns number Response is a simple number - * @returns string Response is a simple string - * @returns boolean Response is a simple boolean - * @returns unknown Response is a simple object - * @throws ApiError - */ - public static types(data: TypesData): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v{api-version}/types', - path: { - id: data.id - }, - query: { - parameterNumber: data.parameterNumber, - parameterString: data.parameterString, - parameterBoolean: data.parameterBoolean, - parameterObject: data.parameterObject, - parameterArray: data.parameterArray, - parameterDictionary: data.parameterDictionary, - parameterEnum: data.parameterEnum, - parameterTuple: data.parameterTuple - } - }); - } - -} - -export class UploadService { - /** - * @param data The data for the request. - * @param data.formData - * @returns boolean - * @throws ApiError - */ - public static uploadFile(data: UploadFileData): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v{api-version}/upload', - formData: data.formData, - mediaType: 'application/x-www-form-urlencoded' - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_xhr/types.gen.ts deleted file mode 100644 index d20c92660..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_xhr/types.gen.ts +++ /dev/null @@ -1,1537 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type _3e_num_1Период = 'Bird' | 'Dog'; - -export const _3e_num_1Период = { - BIRD: 'Bird', - DOG: 'Dog' -} as const; - -/** - * Model with number-only name - */ -export type _400 = string; - -export type _default = { - name?: string; -}; - -/** - * Model with restricted keyword name - */ -export type _import = string; - -export type AdditionalPropertiesIntegerIssue = { - value: number; - [key: string]: (number) | undefined; -}; - -export type AdditionalPropertiesUnknownIssue = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue2 = { - [key: string]: (string | number); -}; - -export type AdditionalPropertiesUnknownIssue3 = string & { - entries: { - [key: string]: AdditionalPropertiesUnknownIssue; - }; -}; - -export type AnyOfAnyAndNull = { - data?: (unknown | null); -}; - -/** - * This is a simple array with any of properties - */ -export type AnyOfArrays = { - results?: Array<({ - foo?: string; -} | { - bar?: string; -})>; -}; - -/** - * This is a simple array with any of properties - */ -export type ArrayWithAnyOfProperties = Array<({ - foo?: string; -} | { - bar?: string; -})>; - -/** - * This is a simple array containing an array - */ -export type ArrayWithArray = Array>; - -/** - * This is a simple array with booleans - */ -export type ArrayWithBooleans = Array<(boolean)>; - -/** - * This is a simple array with numbers - */ -export type ArrayWithNumbers = Array<(number)>; - -/** - * This is a simple array with properties - */ -export type ArrayWithProperties = Array<{ - '16x16'?: camelCaseCommentWithBreaks; - bar?: string; -}>; - -/** - * This is a simple array with references - */ -export type ArrayWithReferences = Array; - -/** - * This is a simple array with strings - */ -export type ArrayWithStrings = Array<(string)>; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type camelCaseCommentWithBreaks = number; - -/** - * Some % character - */ -export type CharactersInDescription = string; - -/** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ -export type CommentWithBackticks = number; - -/** - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work - */ -export type CommentWithBackticksAndQuotes = number; - -/** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ -export type CommentWithBreaks = number; - -/** - * Testing expression placeholders in string: ${expression} should work - */ -export type CommentWithExpressionPlaceholders = number; - -/** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ -export type CommentWithQuotes = number; - -/** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ -export type CommentWithReservedCharacters = number; - -/** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ -export type CommentWithSlashes = number; - -/** - * This is a base model with two simple optional properties - */ -export type CompositionBaseModel = { - firstName?: string; - lastname?: string; -}; - -/** - * This is a model that extends the base model - */ -export type CompositionExtendedModel = CompositionBaseModel & { - firstName: string; - lastname: string; - age: number; -}; - -/** - * This is a model with one property with a 'all of' relationship - */ -export type CompositionWithAllOfAndNullable = { - propA?: (({ - boolean?: boolean; -} & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model with one property with a 'any of' relationship - */ -export type CompositionWithAnyOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithAnyOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with nested 'any of' property with a type null - */ -export type CompositionWithNestedAnyAndTypeNull = { - propA?: (Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>); -}; - -/** - * This is a model with one property with a 'any of' relationship where the options are not $ref - */ -export type CompositionWithNestedAnyOfAndNull = { - propA?: (Array<(_3e_num_1Период | ConstValue)> | null); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOf = { - propA?: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); -}; - -/** - * This is a model that contains a dictionary of complex arrays (composited) within composition - */ -export type CompositionWithOneOfAndComplexArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(number | string)>; -}); -}; - -/** - * This is a model with one property with a 'one of' relationship - */ -export type CompositionWithOneOfAndNullable = { - propA?: (({ - boolean?: boolean; -} | ModelWithEnum | ModelWithArray | ModelWithDictionary) | null); -}; - -export type CompositionWithOneOfAndProperties = ({ - foo: ParameterSimpleParameter; -} | { - bar: NonAsciiStringæøåÆØÅöôêÊ字符串; -}) & { - baz: (number) | null; - qux: number; -}; - -/** - * This is a model that contains a dictionary of simple arrays within composition - */ -export type CompositionWithOneOfAndSimpleArrayDictionary = { - propA?: (boolean | { - [key: string]: Array<(boolean)>; -}); -}; - -/** - * This is a model that contains a simple dictionary within composition - */ -export type CompositionWithOneOfAndSimpleDictionary = { - propA?: (boolean | { - [key: string]: (number); -}); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfAnonymous = { - propA?: ({ - propA?: string; -} | string | number); -}; - -/** - * This is a model with one property with a 'one of' relationship where the options are not $ref - */ -export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; - -export type ConstValue = "ConstValue"; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData = string; - -/** - * Model used to test deduplication strategy - */ -export type DeleteFooData2 = string; - -/** - * This is a deprecated model with a deprecated property - * @deprecated - */ -export type DeprecatedModel = { - /** - * This is a deprecated property - * @deprecated - */ - prop?: string; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithArray = { - [key: string]: Array; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithDictionary = { - [key: string]: { - [key: string]: (string); - }; -}; - -/** - * This is a complex dictionary - */ -export type DictionaryWithProperties = { - [key: string]: { - foo?: string; - bar?: string; - }; -}; - -export type DictionaryWithPropertiesAndAdditionalProperties = { - foo?: number; - bar?: boolean; - [key: string]: (string | number | boolean) | undefined; -}; - -/** - * This is a string reference - */ -export type DictionaryWithReference = { - [key: string]: ModelWithString; -}; - -/** - * This is a string dictionary - */ -export type DictionaryWithString = { - [key: string]: (string); -}; - -/** - * Success=1,Warning=2,Error=3 - */ -export type EnumFromDescription = number; - -/** - * This is a simple enum with numbers - */ -export type EnumWithExtensions = 200 | 400 | 500; - -/** - * This is a simple enum with numbers - */ -export const EnumWithExtensions = { - /** - * Used when the status of something is successful - */ - CUSTOM_SUCCESS: 200, - /** - * Used when the status of something has a warning - */ - CUSTOM_WARNING: 400, - /** - * Used when the status of something has an error - */ - CUSTOM_ERROR: 500 -} as const; - -/** - * This is a simple enum with numbers - */ -export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; - -/** - * This is a simple enum with numbers - */ -export const EnumWithNumbers = { - '_1': 1, - '_2': 2, - '_3': 3, - '_1.1': 1.1, - '_1.2': 1.2, - '_1.3': 1.3, - '_100': 100, - '_200': 200, - '_300': 300, - '_-100': -100, - '_-200': -200, - '_-300': -300, - '_-1.1': -1.1, - '_-1.2': -1.2, - '_-1.3': -1.3 -} as const; - -export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; - -export const EnumWithReplacedCharacters = { - _SINGLE_QUOTE_: "'Single Quote'", - _DOUBLE_QUOTES_: '"Double Quotes"', - 'ØÆÅÔÖ_ØÆÅÔÖ字符串': 'øæåôöØÆÅÔÖ字符串', - '_3.1': 3.1, - EMPTY_STRING: '' -} as const; - -/** - * This is a simple enum with strings - */ -export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; - -/** - * This is a simple enum with strings - */ -export const EnumWithStrings = { - SUCCESS: 'Success', - WARNING: 'Warning', - ERROR: 'Error', - _SINGLE_QUOTE_: "'Single Quote'", - _DOUBLE_QUOTES_: '"Double Quotes"', - 'NON_ASCII__ØÆÅÔÖ_ØÆÅÔÖ字符串': 'Non-ascii: øæåôöØÆÅÔÖ字符串' -} as const; - -export type EnumWithXEnumNames = 0 | 1 | 2; - -export const EnumWithXEnumNames = { - zero: 0, - one: 1, - two: 2 -} as const; - -export type File = { - readonly id?: string; - readonly updated_at?: string; - readonly created_at?: string; - mime: string; - readonly file?: string; -}; - -/** - * This is a free-form object with additionalProperties: {}. - */ -export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { - [key: string]: unknown; -}; - -/** - * This is a free-form object with additionalProperties: true. - */ -export type FreeFormObjectWithAdditionalPropertiesEqTrue = { - [key: string]: unknown; -}; - -/** - * This is a free-form object without additionalProperties. - */ -export type FreeFormObjectWithoutAdditionalProperties = { - [key: string]: unknown; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { - item?: boolean; - error?: (string) | null; - readonly hasError?: boolean; - data?: { - [key: string]: unknown; - }; -}; - -export type Generic_Schema_Duplicate_Issue_1_System_String_ = { - item?: (string) | null; - error?: (string) | null; - readonly hasError?: boolean; -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { - /** - * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. - */ - preconditions?: (io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions); -}; - -/** - * This schema was giving PascalCase transformations a hard time - */ -export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { - /** - * Specifies the target ResourceVersion - */ - resourceVersion?: string; - /** - * Specifies the target UID. - */ - uid?: string; -}; - -/** - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) - */ -export type Model_From_Zendesk = string; - -/** - * Circle - */ -export type ModelCircle = { - kind: 'circle'; - radius?: number; -}; - -/** - * Square - */ -export type ModelSquare = { - kind: 'square'; - sideLength?: number; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtends = ModelWithString & { - propExtendsA?: string; - propExtendsB?: ModelWithString; -}; - -/** - * This is a model that extends another model - */ -export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { - propExtendsC?: string; - propExtendsD?: ModelWithString; -}; - -/** - * This is a model with one property and additionalProperties: true - */ -export type ModelWithAdditionalPropertiesEqTrue = { - /** - * This is a simple string property - */ - prop?: string; - [key: string]: unknown | string; -}; - -export type ModelWithAnyOfConstantSizeArray = [ - (number | string), - (number | string), - (number | string) -]; - -export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ - (number & string), - (number & string) -]; - -export type ModelWithAnyOfConstantSizeArrayNullable = [ - ((number) | null | string), - ((number) | null | string), - ((number) | null | string) -]; - -export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ - (number | _import), - (number | _import) -]; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArray = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * This is a model with one property containing an array - */ -export type ModelWithArrayReadOnlyAndWriteOnly = { - prop?: Array; - propWithFile?: Array<((Blob | File))>; - propWithNumber?: Array<(number)>; -}; - -/** - * Some description with `back ticks` - */ -export type ModelWithBackticksInDescription = { - /** - * The template `that` should be used for parsing and importing the contents of the CSV file. - * - *

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

- *
-     * [
-     * {
-     * "resourceType": "Asset",
-     * "identifier": {
-     * "name": "${1}",
-     * "domain": {
-     * "name": "${2}",
-     * "community": {
-     * "name": "Some Community"
-     * }
-     * }
-     * },
-     * "attributes" : {
-     * "00000000-0000-0000-0000-000000003115" : [ {
-     * "value" : "${3}"
-     * } ],
-     * "00000000-0000-0000-0000-000000000222" : [ {
-     * "value" : "${4}"
-     * } ]
-     * }
-     * }
-     * ]
-     * 
- */ - template?: string; -}; - -/** - * This is a model with one boolean property - */ -export type ModelWithBoolean = { - /** - * This is a simple boolean property - */ - prop?: boolean; -}; - -/** - * This is a model with one property containing a circular reference - */ -export type ModelWithCircularReference = { - prop?: ModelWithCircularReference; -}; - -export type ModelWithConst = { - String?: "String"; - number?: 0; - null?: null; - withType?: "Some string"; -}; - -export type ModelWithConstantSizeArray = [ - number, - number -]; - -/** - * This is a model with one property containing a dictionary - */ -export type ModelWithDictionary = { - prop?: { - [key: string]: (string); - }; -}; - -/** - * This is a model with duplicated imports - */ -export type ModelWithDuplicateImports = { - propA?: ModelWithString; - propB?: ModelWithString; - propC?: ModelWithString; -}; - -/** - * This is a model with duplicated properties - */ -export type ModelWithDuplicateProperties = { - prop?: ModelWithString; -}; - -/** - * This is a model with one enum - */ -export type ModelWithEnum = { - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - /** - * These are the HTTP error code enums - */ - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - /** - * Simple boolean enum - */ - bool?: boolean; -}; - -/** - * This is a simple enum with strings - */ -export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; - -/** - * This is a simple enum with strings - */ -export const foo_bar_enum = { - SUCCESS: 'Success', - WARNING: 'Warning', - ERROR: 'Error', - 'ØÆÅ字符串': 'ØÆÅ字符串' -} as const; - -/** - * These are the HTTP error code enums - */ -export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; - -/** - * These are the HTTP error code enums - */ -export const statusCode = { - _100: '100', - _200_FOO: '200 FOO', - _300_FOO_BAR: '300 FOO_BAR', - _400_FOO_BAR: '400 foo-bar', - _500_FOO_BAR: '500 foo.bar', - _600_FOO_BAR: '600 foo&bar' -} as const; - -/** - * This is a model with one enum - */ -export type ModelWithEnumFromDescription = { - /** - * Success=1,Warning=2,Error=3 - */ - test?: number; -}; - -/** - * This is a model with one enum with escaped name - */ -export type ModelWithEnumWithHyphen = { - 'foo-bar-baz-qux'?: '3.0'; -}; - -export type foo_bar_baz_qux = '3.0'; - -export const foo_bar_baz_qux = { - _3_0: '3.0' -} as const; - -/** - * This is a model with one number property - */ -export type ModelWithInteger = { - /** - * This is a simple number property - */ - prop?: number; -}; - -export type ModelWithNestedArrayEnums = { - array_strings?: Array<(string)>; - data?: (ModelWithNestedArrayEnumsData); -}; - -export type ModelWithNestedArrayEnumsData = { - foo?: Array; - bar?: Array; -}; - -export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; - -export const ModelWithNestedArrayEnumsDataBar = { - BAZ: 'baz', - QUX: 'qux' -} as const; - -export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; - -export const ModelWithNestedArrayEnumsDataFoo = { - FOO: 'foo', - BAR: 'bar' -} as const; - -export type ModelWithNestedCompositionEnums = { - foo?: (ModelWithNestedArrayEnumsDataFoo); -}; - -/** - * This is a model with nested enums - */ -export type ModelWithNestedEnums = { - dictionaryWithEnum?: { - [key: string]: ('Success' | 'Warning' | 'Error'); - }; - dictionaryWithEnumFromDescription?: { - [key: string]: (number); - }; - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; - arrayWithDescription?: Array<(number)>; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -/** - * This is a model with one nested property - */ -export type ModelWithNestedProperties = { - readonly first: { - readonly second: { - readonly third: (string) | null; - } | null; - } | null; -}; - -export type ModelWithNullableObject = { - data?: NullableObject; -}; - -/** - * This is a model with one string property - */ -export type ModelWithNullableString = { - /** - * This is a simple string property - */ - nullableProp1?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp1: (string) | null; - /** - * This is a simple string property - */ - nullableProp2?: (string) | null; - /** - * This is a simple string property - */ - nullableRequiredProp2: (string) | null; - /** - * This is a simple enum with strings - */ - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; -}; - -export type ModelWithNumericEnumUnion = { - /** - * Период - */ - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; -}; - -/** - * Период - */ -export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; - -/** - * Период - */ -export const value = { - '_-10': -10, - '_-1': -1, - '_0': 0, - '_1': 1, - '_3': 3, - '_6': 6, - '_12': 12 -} as const; - -export type ModelWithOneOfAndProperties = (ParameterSimpleParameter | NonAsciiStringæøåÆØÅöôêÊ字符串) & { - baz: (number) | null; - qux: number; -}; - -export type ModelWithOneOfEnum = { - foo: 'Bar'; -} | { - foo: 'Baz'; -} | { - foo: 'Qux'; -} | { - content: string; - foo: 'Quux'; -} | { - content: [ - (string), - (string) - ]; - foo: 'Corge'; -}; - -export type foo = 'Bar'; - -export const foo = { - BAR: 'Bar' -} as const; - -/** - * This is a model with ordered properties - */ -export type ModelWithOrderedProperties = { - zebra?: string; - apple?: string; - hawaii?: string; -}; - -/** - * This is a model that contains a some patterns - */ -export type ModelWithPattern = { - key: string; - name: string; - readonly enabled?: boolean; - readonly modified?: string; - id?: string; - text?: string; - patternWithSingleQuotes?: string; - patternWithNewline?: string; - patternWithBacktick?: string; -}; - -export type ModelWithPrefixItemsConstantSizeArray = [ - ModelWithInteger, - (number | string), - string -]; - -/** - * This is a model with one nested property - */ -export type ModelWithProperties = { - required: string; - readonly requiredAndReadOnly: string; - requiredAndNullable: (string) | null; - string?: string; - number?: number; - boolean?: boolean; - reference?: ModelWithString; - 'property with space'?: string; - default?: string; - try?: string; - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; -}; - -export type ModelWithReadOnlyAndWriteOnly = { - foo: string; - readonly bar: string; - baz: string; -}; - -/** - * This is a model with one property containing a reference - */ -export type ModelWithReference = { - prop?: ModelWithProperties; -}; - -/** - * This is a model with one string property - */ -export type ModelWithString = { - /** - * This is a simple string property - */ - prop?: string; -}; - -/** - * This is a model with one string property - */ -export type ModelWithStringError = { - /** - * This is a simple string property - */ - prop?: string; -}; - -export type NestedAnyOfArraysNullable = { - nullableArray?: (Array<(string | boolean)> | null); -}; - -/** - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) - */ -export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; - -/** - * An object that can be null - */ -export type NullableObject = { - foo?: string; -} | null; - -export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; - -export type Pageable = { - page?: number; - size?: number; - sort?: Array<(string)>; -}; - -/** - * This is a reusable parameter - */ -export type ParameterSimpleParameter = string; - -/** - * Model used to test deduplication strategy (unused) - */ -export type ParameterSimpleParameterUnused = string; - -/** - * Parameter with illegal characters - */ -export type Parameterx_Foo_Bar = ModelWithString; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse = string; - -/** - * Model used to test deduplication strategy - */ -export type PostServiceWithEmptyTagResponse2 = string; - -export type SchemaWithFormRestrictedKeys = { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - object?: { - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; - }; - array?: Array<({ - description?: string; - 'x-enum-descriptions'?: string; - 'x-enum-varnames'?: string; - 'x-enumNames'?: string; - title?: string; -})>; -}; - -/** - * This is a simple boolean - */ -export type SimpleBoolean = boolean; - -/** - * This is a simple file - */ -export type SimpleFile = (Blob | File); - -/** - * This is a simple number - */ -export type SimpleInteger = number; - -/** - * This is a simple reference - */ -export type SimpleReference = ModelWithString; - -/** - * This is a simple string - */ -export type SimpleString = string; - -/** - * This is a simple string - */ -export type SimpleStringWithPattern = (string) | null; - -export type CollectionFormatData = { - /** - * This is an array parameter that is sent as csv format (comma-separated values) - */ - parameterArrayCsv: Array<(string)> | null; - /** - * This is an array parameter that is sent as multi format (multiple parameter instances) - */ - parameterArrayMulti: Array<(string)> | null; - /** - * This is an array parameter that is sent as pipes format (pipe-separated values) - */ - parameterArrayPipes: Array<(string)> | null; - /** - * This is an array parameter that is sent as ssv format (space-separated values) - */ - parameterArraySsv: Array<(string)> | null; - /** - * This is an array parameter that is sent as tsv format (tab-separated values) - */ - parameterArrayTsv: Array<(string)> | null; -}; - -export type ComplexTypesData = { - /** - * Parameter containing object - */ - parameterObject: { - first?: { - second?: { - third?: string; - }; - }; - }; - /** - * Parameter containing reference - */ - parameterReference: ModelWithString; -}; - -export type ComplexTypesResponse = (Array); - -export type ComplexParamsData = { - id: number; - requestBody?: { - readonly key: (string) | null; - name: (string) | null; - enabled?: boolean; - readonly type: 'Monkey' | 'Horse' | 'Bird'; - listOfModels?: Array | null; - listOfStrings?: Array<(string)> | null; - parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); - readonly user?: { - readonly id?: number; - readonly name?: (string) | null; - }; - }; -}; - -export type ComplexParamsResponse = (ModelWithString); - -export type PatchApiNoTagResponse = (unknown); - -export type ImportData = { - requestBody: (ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly); -}; - -export type ImportResponse = (Model_From_Zendesk | ModelWithReadOnlyAndWriteOnly); - -export type FooWowResponse = (unknown); - -export type GetApiSimpleOperationData = { - /** - * foo in method - */ - fooParam: string; -}; - -export type GetApiSimpleOperationResponse = (number); - -export type CallWithDefaultParametersData = { - /** - * This is a simple boolean with default value - */ - parameterBoolean?: (boolean) | null; - /** - * This is a simple enum with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model with default value - */ - parameterModel?: (ModelWithString) | null; - /** - * This is a simple number with default value - */ - parameterNumber?: (number) | null; - /** - * This is a simple string with default value - */ - parameterString?: (string) | null; -}; - -export type CallWithDefaultOptionalParametersData = { - /** - * This is a simple boolean that is optional with default value - */ - parameterBoolean?: boolean; - /** - * This is a simple enum that is optional with default value - */ - parameterEnum?: 'Success' | 'Warning' | 'Error'; - /** - * This is a simple model that is optional with default value - */ - parameterModel?: ModelWithString; - /** - * This is a simple number that is optional with default value - */ - parameterNumber?: number; - /** - * This is a simple string that is optional with default value - */ - parameterString?: string; -}; - -export type CallToTestOrderOfParamsData = { - /** - * This is a optional string with default - */ - parameterOptionalStringWithDefault?: string; - /** - * This is a optional string with empty default - */ - parameterOptionalStringWithEmptyDefault?: string; - /** - * This is a optional string with no default - */ - parameterOptionalStringWithNoDefault?: string; - /** - * This is a string that can be null with default - */ - parameterStringNullableWithDefault?: (string) | null; - /** - * This is a string that can be null with no default - */ - parameterStringNullableWithNoDefault?: (string) | null; - /** - * This is a string with default - */ - parameterStringWithDefault: string; - /** - * This is a string with empty default - */ - parameterStringWithEmptyDefault: string; - /** - * This is a string with no default - */ - parameterStringWithNoDefault: string; -}; - -export type DeprecatedCallData = { - /** - * This parameter is deprecated - * @deprecated - */ - parameter: (DeprecatedModel) | null; -}; - -export type CallWithDescriptionsData = { - /** - * Testing backticks in string: `backticks` and ```multiple backticks``` should work - */ - parameterWithBackticks?: unknown; - /** - * Testing multiline comments in string: First line - * Second line - * - * Fourth line - */ - parameterWithBreaks?: unknown; - /** - * Testing expression placeholders in string: ${expression} should work - */ - parameterWithExpressionPlaceholders?: unknown; - /** - * Testing quotes in string: 'single quote''' and "double quotes""" should work - */ - parameterWithQuotes?: unknown; - /** - * Testing reserved characters in string: * inline * and ** inline ** should work - */ - parameterWithReservedCharacters?: unknown; - /** - * Testing slashes in string: \backwards\\\ and /forwards/// should work - */ - parameterWithSlashes?: unknown; -}; - -export type TestErrorCodeData = { - /** - * Status code to return - */ - status: number; -}; - -export type TestErrorCodeResponse = (unknown); - -export type FileResponseData = { - id: string; -}; - -export type FileResponseResponse = ((Blob | File)); - -export type PostApiFormDataData = { - /** - * A reusable request body - */ - formData?: ModelWithString; - /** - * This is a reusable parameter - */ - parameter?: string; -}; - -export type CallWithResultFromHeaderResponse = (string); - -export type MultipartRequestData = { - formData?: { - content?: (Blob | File); - data?: ((ModelWithString) | null); - }; -}; - -export type MultipartResponseResponse = ({ - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; -}); - -export type DummyAResponse = (_400); - -export type DummyBResponse = (void); - -export type CallWithNoContentResponseResponse = (void); - -export type CallWithResponseAndNoContentResponseResponse = (number | void); - -export type NonAsciiæøåÆøÅöôêÊ字符串Data = { - /** - * Dummy input param - */ - nonAsciiParamæøåÆøÅöôêÊ: number; -}; - -export type NonAsciiæøåÆøÅöôêÊ字符串Response = (Array); - -export type PutWithFormUrlEncodedData = { - formData: ArrayWithStrings; -}; - -export type DeleteFooData3 = { - /** - * bar in method - */ - barParam: string; - /** - * foo in method - */ - fooParam: string; - /** - * Parameter with illegal characters - */ - xFooBar: ModelWithString; -}; - -export type CallWithParametersData = { - /** - * This is the parameter that goes into the query params - */ - cursor: (string) | null; - fooAllOfEnum: (ModelWithNestedArrayEnumsDataFoo); - fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; - /** - * This is the parameter that goes into the cookie - */ - parameterCookie: (string) | null; - /** - * This is the parameter that goes into the header - */ - parameterHeader: (string) | null; - /** - * This is the parameter that goes into the path - */ - parameterPath: (string) | null; - /** - * This is the parameter that goes into the body - */ - requestBody: { - [key: string]: unknown; - } | null; -}; - -export type CallWithWeirdParameterNamesData = { - /** - * This is the parameter with a reserved keyword - */ - _default?: string; - /** - * This is the parameter that goes into the cookie - */ - parameterCookie: (string) | null; - /** - * This is the parameter that goes into the request header - */ - parameterHeader: (string) | null; - /** - * This is the parameter that goes into the path - */ - parameterPath1?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath2?: string; - /** - * This is the parameter that goes into the path - */ - parameterPath3?: string; - /** - * This is the parameter that goes into the request query params - */ - parameterQuery: (string) | null; - /** - * This is the parameter that goes into the body - */ - requestBody: (ModelWithString) | null; -}; - -export type GetCallWithOptionalParamData = { - /** - * This is an optional parameter - */ - page?: number; - /** - * This is a required parameter - */ - requestBody: ModelWithOneOfEnum; -}; - -export type PostCallWithOptionalParamData = { - /** - * This is a required parameter - */ - parameter: Pageable; - /** - * This is an optional parameter - */ - requestBody?: { - offset?: (number) | null; - }; -}; - -export type PostCallWithOptionalParamResponse = (number | void); - -export type PostApiRequestBodyData = { - /** - * A reusable request body - */ - foo?: ModelWithString; - /** - * This is a reusable parameter - */ - parameter?: string; -}; - -export type CallWithResponseResponse = (_import); - -export type CallWithDuplicateResponsesResponse = ((ModelWithBoolean & ModelWithInteger) | ModelWithString); - -export type CallWithResponsesResponse = ({ - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; -} | ModelThatExtends | ModelThatExtendsExtends); - -export type ApiVVersionODataControllerCountResponse = (Model_From_Zendesk); - -export type TypesData = { - /** - * This is a number parameter - */ - id?: number; - /** - * This is an array parameter - */ - parameterArray: Array<(string)> | null; - /** - * This is a boolean parameter - */ - parameterBoolean: (boolean) | null; - /** - * This is a dictionary parameter - */ - parameterDictionary: { - [key: string]: unknown; - } | null; - /** - * This is an enum parameter - */ - parameterEnum: ('Success' | 'Warning' | 'Error') | null; - /** - * This is a number parameter - */ - parameterNumber: number; - /** - * This is an object parameter - */ - parameterObject: { - [key: string]: unknown; - } | null; - /** - * This is a string parameter - */ - parameterString: (string) | null; - /** - * This is tuple parameter - */ - parameterTuple: [ - number, - number, - number, - number - ]; -}; - -export type TypesResponse = (number | string | boolean | { - [key: string]: unknown; -}); - -export type UploadFileData = { - formData: (Blob | File); -}; - -export type UploadFileResponse = (boolean); \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiError.ts b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiError.ts deleted file mode 100644 index 36675d288..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiError.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: unknown; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiRequestOptions.ts b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiRequestOptions.ts deleted file mode 100644 index 939a0aa4c..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiRequestOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type ApiRequestOptions = { - readonly body?: any; - readonly cookies?: Record; - readonly errors?: Record; - readonly formData?: Record | any[] | Blob | File; - readonly headers?: Record; - readonly mediaType?: string; - readonly method: - | 'DELETE' - | 'GET' - | 'HEAD' - | 'OPTIONS' - | 'PATCH' - | 'POST' - | 'PUT'; - readonly path?: Record; - readonly query?: Record; - readonly responseHeader?: string; - readonly responseTransformer?: (data: unknown) => Promise; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiResult.ts b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiResult.ts deleted file mode 100644 index 4c58e3913..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/ApiResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ApiResult = { - readonly body: TData; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly url: string; -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/CancelablePromise.ts b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/CancelablePromise.ts deleted file mode 100644 index ccc082e8f..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/CancelablePromise.ts +++ /dev/null @@ -1,126 +0,0 @@ -export class CancelError extends Error { - constructor(message: string) { - super(message); - this.name = 'CancelError'; - } - - public get isCancelled(): boolean { - return true; - } -} - -export interface OnCancel { - readonly isResolved: boolean; - readonly isRejected: boolean; - readonly isCancelled: boolean; - - (cancelHandler: () => void): void; -} - -export class CancelablePromise implements Promise { - private _isResolved: boolean; - private _isRejected: boolean; - private _isCancelled: boolean; - readonly cancelHandlers: (() => void)[]; - readonly promise: Promise; - private _resolve?: (value: T | PromiseLike) => void; - private _reject?: (reason?: unknown) => void; - - constructor( - executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: unknown) => void, - onCancel: OnCancel - ) => void - ) { - this._isResolved = false; - this._isRejected = false; - this._isCancelled = false; - this.cancelHandlers = []; - this.promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - - const onResolve = (value: T | PromiseLike): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isResolved = true; - if (this._resolve) this._resolve(value); - }; - - const onReject = (reason?: unknown): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isRejected = true; - if (this._reject) this._reject(reason); - }; - - const onCancel = (cancelHandler: () => void): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this.cancelHandlers.push(cancelHandler); - }; - - Object.defineProperty(onCancel, 'isResolved', { - get: (): boolean => this._isResolved, - }); - - Object.defineProperty(onCancel, 'isRejected', { - get: (): boolean => this._isRejected, - }); - - Object.defineProperty(onCancel, 'isCancelled', { - get: (): boolean => this._isCancelled, - }); - - return executor(onResolve, onReject, onCancel as OnCancel); - }); - } - - get [Symbol.toStringTag]() { - return "Cancellable Promise"; - } - - public then( - onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null - ): Promise { - return this.promise.then(onFulfilled, onRejected); - } - - public catch( - onRejected?: ((reason: unknown) => TResult | PromiseLike) | null - ): Promise { - return this.promise.catch(onRejected); - } - - public finally(onFinally?: (() => void) | null): Promise { - return this.promise.finally(onFinally); - } - - public cancel(): void { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isCancelled = true; - if (this.cancelHandlers.length) { - try { - for (const cancelHandler of this.cancelHandlers) { - cancelHandler(); - } - } catch (error) { - console.warn('Cancellation threw an error', error); - return; - } - } - this.cancelHandlers.length = 0; - if (this._reject) this._reject(new CancelError('Request aborted')); - } - - public get isCancelled(): boolean { - return this._isCancelled; - } -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/OpenAPI.ts b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/OpenAPI.ts deleted file mode 100644 index 0317507fa..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/OpenAPI.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions'; - -type Headers = Record; -type Middleware = (value: T) => T | Promise; -type Resolver = (options: ApiRequestOptions) => Promise; - -export class Interceptors { - _fns: Middleware[]; - - constructor() { - this._fns = []; - } - - eject(fn: Middleware): void { - const index = this._fns.indexOf(fn); - if (index !== -1) { - this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; - } - } - - use(fn: Middleware): void { - this._fns = [...this._fns, fn]; - } -} - -export type OpenAPIConfig = { - BASE: string; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - ENCODE_PATH?: ((path: string) => string) | undefined; - HEADERS?: Headers | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - VERSION: string; - WITH_CREDENTIALS: boolean; - interceptors: { - request: Interceptors; - response: Interceptors; - }; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: 'http://localhost:3000/base', - CREDENTIALS: 'include', - ENCODE_PATH: undefined, - HEADERS: undefined, - PASSWORD: undefined, - TOKEN: undefined, - USERNAME: undefined, - VERSION: '1.0', - WITH_CREDENTIALS: false, - interceptors: { - request: new Interceptors(), - response: new Interceptors(), - }, -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/request.ts b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/request.ts deleted file mode 100644 index 9b08a59cd..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/core/request.ts +++ /dev/null @@ -1,350 +0,0 @@ -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import { CancelablePromise } from './CancelablePromise'; -import type { OnCancel } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const isString = (value: unknown): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: any): value is Blob => { - return value instanceof Blob; -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const isSuccess = (status: number): boolean => { - return status >= 200 && status < 300; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const encodePair = (key: string, value: unknown) => { - if (value === undefined || value === null) { - return; - } - - if (value instanceof Date) { - append(key, value.toISOString()); - } else if (Array.isArray(value)) { - value.forEach(v => encodePair(key, v)); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); - } else { - append(key, value); - } - }; - - Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - - return qs.length ? `?${qs.join('&')}` : ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = config.BASE + path; - return options.query ? url + getQueryString(options.query) : url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([, value]) => value !== undefined && value !== null) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { - const [token, username, password, additionalHeaders] = await Promise.all([ - // @ts-ignore - resolve(options, config.TOKEN), - // @ts-ignore - resolve(options, config.USERNAME), - // @ts-ignore - resolve(options, config.PASSWORD), - // @ts-ignore - resolve(options, config.HEADERS), - ]); - - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - }) - .filter(([, value]) => value !== undefined && value !== null) - .reduce((headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), {} as Record); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return new Headers(headers); -}; - -export const getRequestBody = (options: ApiRequestOptions): unknown => { - if (options.body !== undefined) { - if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { - return JSON.stringify(options.body); - } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; -}; - -export const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: any, - formData: FormData | undefined, - headers: Headers, - onCancel: OnCancel -): Promise => { - let xhr = new XMLHttpRequest(); - xhr.open(options.method, url, true); - xhr.withCredentials = config.WITH_CREDENTIALS; - - headers.forEach((value, key) => { - xhr.setRequestHeader(key, value); - }); - - return new Promise(async (resolve, reject) => { - xhr.onload = () => resolve(xhr); - xhr.onabort = () => reject(new Error('Request aborted')); - xhr.onerror = () => reject(new Error('Network error')); - - for (const fn of config.interceptors.request._fns) { - xhr = await fn(xhr); - } - - xhr.send(body ?? formData); - - onCancel(() => xhr.abort()); - }); -}; - -export const getResponseHeader = (xhr: XMLHttpRequest, responseHeader?: string): string | undefined => { - if (responseHeader) { - const content = xhr.getResponseHeader(responseHeader); - if (isString(content)) { - return content; - } - } - return undefined; -}; - -export const getResponseBody = (xhr: XMLHttpRequest): unknown => { - if (xhr.status !== 204) { - try { - const contentType = xhr.getResponseHeader('Content-Type'); - if (contentType) { - if (contentType.includes('application/json') || contentType.includes('+json')) { - return JSON.parse(xhr.responseText); - } else { - return xhr.responseText; - } - } - } catch (error) { - console.error(error); - } - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 405: 'Method Not Allowed', - 406: 'Not Acceptable', - 407: 'Proxy Authentication Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Payload Too Large', - 414: 'URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Range Not Satisfiable', - 417: 'Expectation Failed', - 418: 'Im a teapot', - 421: 'Misdirected Request', - 422: 'Unprocessable Content', - 423: 'Locked', - 424: 'Failed Dependency', - 425: 'Too Early', - 426: 'Upgrade Required', - 428: 'Precondition Required', - 429: 'Too Many Requests', - 431: 'Request Header Fields Too Large', - 451: 'Unavailable For Legal Reasons', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported', - 506: 'Variant Also Negotiates', - 507: 'Insufficient Storage', - 508: 'Loop Detected', - 510: 'Not Extended', - 511: 'Network Authentication Required', - ...options.errors, - } - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError(options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ -export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options); - - if (!onCancel.isCancelled) { - let response = await sendRequest(config, options, url, body, formData, headers, onCancel); - - for (const fn of config.interceptors.response._fns) { - response = await fn(response); - } - - const responseBody = getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - let transformedBody = responseBody; - if (options.responseTransformer && isSuccess(response.status)) { - transformedBody = await options.responseTransformer(responseBody) - } - - const result: ApiResult = { - url, - ok: isSuccess(response.status), - status: response.status, - statusText: response.statusText, - body: responseHeader ?? transformedBody, - }; - - catchErrorCodes(options, result); - - resolve(result.body); - } - } catch (error) { - reject(error); - } - }); -}; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/index.ts b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/index.ts deleted file mode 100644 index 50a1dd734..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export { ApiError } from './core/ApiError'; -export { CancelablePromise, CancelError } from './core/CancelablePromise'; -export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/sdk.gen.ts b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/sdk.gen.ts deleted file mode 100644 index 5211e9979..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/sdk.gen.ts +++ /dev/null @@ -1,80 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { CancelablePromise } from './core/CancelablePromise'; -import { OpenAPI } from './core/OpenAPI'; -import { request as __request } from './core/request'; -import { type ParentModelWithDatesResponse, type ModelWithDatesResponse, type ModelWithDatesArrayResponse, type ArrayOfDatesResponse, type DateResponse, type MultipleResponsesResponse, ParentModelWithDatesResponseTransformer, ModelWithDatesResponseTransformer, ModelWithDatesArrayResponseTransformer } from './types.gen'; - -export class DefaultService { - /** - * @returns ParentModelWithDates Success - * @returns unknown Success - * @throws ApiError - */ - public static parentModelWithDates(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/model-with-dates', - responseTransformer: ParentModelWithDatesResponseTransformer - }); - } - - /** - * @returns ModelWithDates Success - * @throws ApiError - */ - public static modelWithDates(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/model-with-dates', - responseTransformer: ModelWithDatesResponseTransformer - }); - } - - /** - * @returns ModelWithDates Success - * @throws ApiError - */ - public static modelWithDatesArray(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/model-with-dates-array', - responseTransformer: ModelWithDatesArrayResponseTransformer - }); - } - - /** - * @returns string Success - * @throws ApiError - */ - public static arrayOfDates(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/array-of-dates' - }); - } - - /** - * @returns string Success - * @throws ApiError - */ - public static date(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/date' - }); - } - - /** - * @returns ModelWithDates Updated - * @returns SimpleModel Created - * @throws ApiError - */ - public static multipleResponses(): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/multiple-responses' - }); - } - -} \ No newline at end of file diff --git a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/types.gen.ts b/packages/openapi-ts-tests/test/generated/v3_xhr_transform/types.gen.ts deleted file mode 100644 index 8c9227850..000000000 --- a/packages/openapi-ts-tests/test/generated/v3_xhr_transform/types.gen.ts +++ /dev/null @@ -1,106 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * This is a model that contains a some dates - */ -export type ModelWithDates = { - id: number; - name: string; - readonly enabled: boolean; - readonly modified: Date; - readonly expires?: Date; -}; - -/** - * This is a model that contains a some dates and arrays - */ -export type ParentModelWithDates = { - id: number; - readonly modified?: Date; - items?: Array; - item?: ModelWithDates; - 'nullable-date'?: Array<(Date | null)>; - simpleItems?: Array; - simpleItem?: SimpleModel; - dates?: Array<(Date)>; - strings?: Array<(string)>; -}; - -/** - * This is a model that contains a some dates - */ -export type SimpleModel = { - id: number; - name: string; - readonly enabled: boolean; -}; - -export type ParentModelWithDatesResponse = (ParentModelWithDates | unknown); - -export type ModelWithDatesResponse = (ModelWithDates); - -export type ModelWithDatesArrayResponse = (Array); - -export type ArrayOfDatesResponse = (Array<(Date)>); - -export type DateResponse = (Date); - -export type MultipleResponsesResponse = (Array | Array); - -export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; - -export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; - -export type ModelWithDatesModelResponseTransformer = (data: any) => ModelWithDates; - -export const ModelWithDatesModelResponseTransformer: ModelWithDatesModelResponseTransformer = data => { - if (data?.modified) { - data.modified = new Date(data.modified); - } - if (data?.expires) { - data.expires = new Date(data.expires); - } - return data; -}; - -export const ParentModelWithDatesModelResponseTransformer: ParentModelWithDatesModelResponseTransformer = data => { - if (data?.modified) { - data.modified = new Date(data.modified); - } - if (Array.isArray(data?.items)) { - data.items.forEach(ModelWithDatesModelResponseTransformer); - } - if (data?.item) { - ModelWithDatesModelResponseTransformer(data.item); - } - if (Array.isArray(data?.['nullable-date'])) { - data['nullable-date'] = data['nullable-date'].map(item => item ? new Date(item) : item); - } - if (Array.isArray(data?.dates)) { - data.dates = data.dates.map(item => item ? new Date(item) : item); - } - return data; -}; - -export const ParentModelWithDatesResponseTransformer: ParentModelWithDatesResponseTransformer = async (data) => { - if (data) { - ParentModelWithDatesModelResponseTransformer(data); - } - return data; -}; - -export type ModelWithDatesResponseTransformer = (data: any) => Promise; - -export const ModelWithDatesResponseTransformer: ModelWithDatesResponseTransformer = async (data) => { - ModelWithDatesModelResponseTransformer(data); - return data; -}; - -export type ModelWithDatesArrayResponseTransformer = (data: any) => Promise; - -export const ModelWithDatesArrayResponseTransformer: ModelWithDatesArrayResponseTransformer = async (data) => { - if (Array.isArray(data)) { - data.forEach(ModelWithDatesModelResponseTransformer); - } - return data; -}; \ No newline at end of file From 48109085fb9c26a055b959ca180f76a5aef475a5 Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Thu, 24 Jul 2025 08:30:37 -0400 Subject: [PATCH 23/26] test(nx-plugin): add experimental parser validation to configuration tests --- packages/nx-plugin/src/executors/update-api/updateApi.spec.ts | 1 + .../src/generators/openapi-client/openapiClient.spec.ts | 1 + packages/nx-plugin/src/utils.spec.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/packages/nx-plugin/src/executors/update-api/updateApi.spec.ts b/packages/nx-plugin/src/executors/update-api/updateApi.spec.ts index fad018e1f..6c833655d 100644 --- a/packages/nx-plugin/src/executors/update-api/updateApi.spec.ts +++ b/packages/nx-plugin/src/executors/update-api/updateApi.spec.ts @@ -27,6 +27,7 @@ vi.mock('@hey-api/openapi-ts/internal', async (importOriginal) => { config: { input: config?.input ?? 'default-input', output: config?.output ?? 'default-output', + parser: { validate_EXPERIMENTAL: true }, plugins: config?.plugins ?? [], }, errors: [], diff --git a/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts b/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts index e3306e936..e3167fee6 100644 --- a/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts +++ b/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts @@ -37,6 +37,7 @@ vi.mock('@hey-api/openapi-ts/internal', async (importOriginal) => { config: { input: config?.input ?? 'default-input', output: config?.output ?? 'default-output', + parser: { validate_EXPERIMENTAL: true }, plugins: config?.plugins ?? [], }, errors: [], diff --git a/packages/nx-plugin/src/utils.spec.ts b/packages/nx-plugin/src/utils.spec.ts index 4a77f4c06..b08c6eb8e 100644 --- a/packages/nx-plugin/src/utils.spec.ts +++ b/packages/nx-plugin/src/utils.spec.ts @@ -53,6 +53,7 @@ vi.mock('@hey-api/openapi-ts/internal', async (importOriginal) => { config: { input: config?.input ?? 'default-input', output: config?.output ?? 'default-output', + parser: { validate_EXPERIMENTAL: true }, plugins: config?.plugins ?? [], }, errors: [], From a2fb1da5b80affb64f310d00b2dc9c1bff7205e1 Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Thu, 24 Jul 2025 13:33:40 -0400 Subject: [PATCH 24/26] test(nx-plugin): add parser configuration for tests --- .../executors/update-api/updateApi.spec.ts | 25 ++++++++++++++++++- .../openapi-client/openapiClient.spec.ts | 25 ++++++++++++++++++- packages/nx-plugin/src/utils.spec.ts | 25 ++++++++++++++++++- 3 files changed, 72 insertions(+), 3 deletions(-) diff --git a/packages/nx-plugin/src/executors/update-api/updateApi.spec.ts b/packages/nx-plugin/src/executors/update-api/updateApi.spec.ts index 6c833655d..671331387 100644 --- a/packages/nx-plugin/src/executors/update-api/updateApi.spec.ts +++ b/packages/nx-plugin/src/executors/update-api/updateApi.spec.ts @@ -27,7 +27,30 @@ vi.mock('@hey-api/openapi-ts/internal', async (importOriginal) => { config: { input: config?.input ?? 'default-input', output: config?.output ?? 'default-output', - parser: { validate_EXPERIMENTAL: true }, + parser: { + pagination: { + keywords: [ + 'after', + 'before', + 'cursor', + 'offset', + 'page', + 'start', + ], + }, + transforms: { + enums: { + case: 'PascalCase', + enabled: false, + mode: 'root', + name: (n: string) => n, + }, + readWrite: { + enabled: false, + }, + }, + validate_EXPERIMENTAL: true, + }, plugins: config?.plugins ?? [], }, errors: [], diff --git a/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts b/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts index e3167fee6..950521c44 100644 --- a/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts +++ b/packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts @@ -37,7 +37,30 @@ vi.mock('@hey-api/openapi-ts/internal', async (importOriginal) => { config: { input: config?.input ?? 'default-input', output: config?.output ?? 'default-output', - parser: { validate_EXPERIMENTAL: true }, + parser: { + pagination: { + keywords: [ + 'after', + 'before', + 'cursor', + 'offset', + 'page', + 'start', + ], + }, + transforms: { + enums: { + case: 'PascalCase', + enabled: false, + mode: 'root', + name: (n: string) => n, + }, + readWrite: { + enabled: false, + }, + }, + validate_EXPERIMENTAL: true, + }, plugins: config?.plugins ?? [], }, errors: [], diff --git a/packages/nx-plugin/src/utils.spec.ts b/packages/nx-plugin/src/utils.spec.ts index b08c6eb8e..64d8d1dfa 100644 --- a/packages/nx-plugin/src/utils.spec.ts +++ b/packages/nx-plugin/src/utils.spec.ts @@ -53,7 +53,30 @@ vi.mock('@hey-api/openapi-ts/internal', async (importOriginal) => { config: { input: config?.input ?? 'default-input', output: config?.output ?? 'default-output', - parser: { validate_EXPERIMENTAL: true }, + parser: { + pagination: { + keywords: [ + 'after', + 'before', + 'cursor', + 'offset', + 'page', + 'start', + ], + }, + transforms: { + enums: { + case: 'PascalCase', + enabled: false, + mode: 'root', + name: (n: string) => n, + }, + readWrite: { + enabled: false, + }, + }, + validate_EXPERIMENTAL: true, + }, plugins: config?.plugins ?? [], }, errors: [], From 1314d5d70445f319a1463acde8bfe3c0f7300155 Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Thu, 24 Jul 2025 14:18:55 -0400 Subject: [PATCH 25/26] fix(operation): ensure output case handling is robust by checking for object type before accessing 'case' property --- packages/openapi-ts/src/openApi/shared/utils/operation.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/openapi-ts/src/openApi/shared/utils/operation.ts b/packages/openapi-ts/src/openApi/shared/utils/operation.ts index 2e8c625d4..cc7e1cc1b 100644 --- a/packages/openapi-ts/src/openApi/shared/utils/operation.ts +++ b/packages/openapi-ts/src/openApi/shared/utils/operation.ts @@ -39,8 +39,9 @@ export const operationToId = ({ const { output } = context.config; const targetCase = - (output !== undefined && 'case' in output ? output.case : undefined) ?? - 'camelCase'; + (output !== undefined && typeof output === 'object' && 'case' in output + ? output.case + : undefined) ?? 'camelCase'; if ( id && From a5eb2fa380f4077a412a73aace632224f3579c9e Mon Sep 17 00:00:00 2001 From: Landon Gavin Date: Thu, 24 Jul 2025 14:19:16 -0400 Subject: [PATCH 26/26] fix(openapi-client): update temp folder handling to use absolute path for directory creation --- .../nx-plugin/src/generators/openapi-client/openapiClient.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nx-plugin/src/generators/openapi-client/openapiClient.ts b/packages/nx-plugin/src/generators/openapi-client/openapiClient.ts index bdb540441..51efd19a4 100644 --- a/packages/nx-plugin/src/generators/openapi-client/openapiClient.ts +++ b/packages/nx-plugin/src/generators/openapi-client/openapiClient.ts @@ -246,9 +246,9 @@ export default async function ( logger.debug(`Found ${Object.keys(clientPlugins).length} client plugins`); // Create the temp folder - if (!existsSync(tempFolder)) { + if (!existsSync(absoluteTempFolder)) { logger.debug(`Creating temp folder: ${tempFolder}`); - await makeDir(tempFolder); + await makeDir(absoluteTempFolder); } else { logger.debug(`Temp folder already exists: ${tempFolder}`); }